@dropins/storefront-quote-management 0.0.1-alpha9 → 1.0.0-beta10
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/LICENSE.md +25 -26
- package/api/acceptQuoteTemplate/acceptQuoteTemplate.d.ts +13 -0
- package/api/{getCustomerData/getCustomerData.d.ts → acceptQuoteTemplate/graphql/acceptQuoteTemplate.d.ts} +2 -2
- package/{data/transforms/__fixtures__/customerData.d.ts → api/acceptQuoteTemplate/index.d.ts} +2 -2
- package/api/addQuoteTemplateLineItemNote/addQuoteTemplateLineItemNote.d.ts +15 -0
- package/api/addQuoteTemplateLineItemNote/graphql/setQuoteTemplateLineItemNote.d.ts +10 -0
- package/api/addQuoteTemplateLineItemNote/index.d.ts +10 -0
- package/api/addQuoteTemplateShippingAddress/addQuoteTemplateShippingAddress.d.ts +37 -0
- package/api/addQuoteTemplateShippingAddress/graphql/setNegotiableQuoteTemplateShippingAddress.d.ts +10 -0
- package/api/addQuoteTemplateShippingAddress/index.d.ts +10 -0
- package/api/cancelQuoteTemplate/cancelQuoteTemplate.d.ts +14 -0
- package/api/cancelQuoteTemplate/graphql/cancelQuoteTemplate.d.ts +10 -0
- package/api/cancelQuoteTemplate/index.d.ts +10 -0
- package/api/closeNegotiableQuote/closeNegotiableQuote.d.ts +31 -0
- package/api/closeNegotiableQuote/graphql/CloseNegotiableQuoteMutation.d.ts +2 -0
- package/api/closeNegotiableQuote/index.d.ts +10 -0
- package/api/createQuoteTemplate/createQuoteTemplate.d.ts +4 -0
- package/api/createQuoteTemplate/graphql/createQuoteTemplate.d.ts +10 -0
- package/api/createQuoteTemplate/index.d.ts +10 -0
- package/api/deleteQuote/deleteQuote.d.ts +28 -0
- package/api/deleteQuote/graphql/DeleteQuoteMutation.d.ts +10 -0
- package/api/{getCustomerData → deleteQuote}/index.d.ts +1 -1
- package/{data/models/customer-model.d.ts → api/deleteQuoteTemplate/deleteQuoteTemplate.d.ts} +6 -8
- package/api/deleteQuoteTemplate/graphql/deleteQuoteTemplate.d.ts +10 -0
- package/api/deleteQuoteTemplate/index.d.ts +10 -0
- package/api/duplicateNegotiableQuote/duplicateNegotiableQuote.d.ts +9 -0
- package/api/duplicateNegotiableQuote/graphql/duplicateNegotiableQuoteMutation.d.ts +10 -0
- package/api/duplicateNegotiableQuote/index.d.ts +10 -0
- package/api/generateQuoteFromTemplate/generateQuoteFromTemplate.d.ts +15 -0
- package/api/generateQuoteFromTemplate/graphql/generateNegotiableQuoteFromTemplate.d.ts +10 -0
- package/api/generateQuoteFromTemplate/index.d.ts +10 -0
- package/api/getQuoteData/getQuoteData.d.ts +10 -0
- package/api/getQuoteData/graphql/QuoteDataQuery.d.ts +2 -0
- package/api/getQuoteData/index.d.ts +10 -0
- package/api/getQuoteTemplateData/getQuoteTemplateData.d.ts +4 -0
- package/api/getQuoteTemplateData/graphql/getQuoteTemplateData.d.ts +10 -0
- package/api/getQuoteTemplateData/index.d.ts +10 -0
- package/api/getQuoteTemplates/getQuoteTemplates.d.ts +34 -0
- package/api/getQuoteTemplates/graphql/getQuoteTemplates.d.ts +10 -0
- package/api/getQuoteTemplates/index.d.ts +10 -0
- package/api/getStoreConfig/getStoreConfig.d.ts +4 -0
- package/api/getStoreConfig/graphql/StoreConfigQuery.d.ts +10 -0
- package/api/getStoreConfig/index.d.ts +10 -0
- package/api/graphql/NegotiableQuoteAddressFragment.d.ts +10 -0
- package/api/graphql/NegotiableQuoteFragment.d.ts +5 -13
- package/api/graphql/NegotiableQuoteListFragment.d.ts +10 -0
- package/api/graphql/NegotiableQuoteTemplateFragment.d.ts +10 -0
- package/api/graphql/SearchResultPageInfoFragment.d.ts +10 -0
- package/api/graphql/ShippingMethodFragment.d.ts +10 -0
- package/api/graphql/SortFieldsFragment.d.ts +10 -0
- package/api/index.d.ts +34 -1
- package/api/initialize/initialize.d.ts +2 -0
- package/api/negotiableQuotes/graphql/NegotiableQuotesQuery.d.ts +10 -0
- package/api/negotiableQuotes/index.d.ts +10 -0
- package/api/negotiableQuotes/negotiableQuotes.d.ts +39 -0
- package/api/openQuoteTemplate/graphql/openQuoteTemplate.d.ts +10 -0
- package/api/openQuoteTemplate/index.d.ts +10 -0
- package/api/openQuoteTemplate/openQuoteTemplate.d.ts +13 -0
- package/api/removeNegotiableQuoteItems/graphql/RemoveNegotiableQuoteItemsMutation.d.ts +10 -0
- package/api/removeNegotiableQuoteItems/index.d.ts +10 -0
- package/api/removeNegotiableQuoteItems/removeNegotiableQuoteItems.d.ts +8 -0
- package/api/removeQuoteTemplateItems/graphql/removeNegotiableQuoteTemplateItems.d.ts +10 -0
- package/api/removeQuoteTemplateItems/index.d.ts +10 -0
- package/api/removeQuoteTemplateItems/removeQuoteTemplateItems.d.ts +14 -0
- package/api/renameNegotiableQuote/graphql/RenameNegotiableQuoteMutation.d.ts +10 -0
- package/api/renameNegotiableQuote/index.d.ts +10 -0
- package/api/renameNegotiableQuote/renameNegotiableQuote.d.ts +9 -0
- package/api/requestNegotiableQuote/graphql/RequestNegotiableQuoteMutation.d.ts +4 -12
- package/api/requestNegotiableQuote/requestNegotiableQuote.d.ts +0 -3
- package/api/sendForReview/graphql/SendNegotiableQuoteForReviewMutation.d.ts +10 -0
- package/api/sendForReview/index.d.ts +10 -0
- package/api/sendForReview/sendForReview.d.ts +11 -0
- package/api/sendQuoteTemplateForReview/graphql/sendQuoteTemplateForReview.d.ts +10 -0
- package/api/sendQuoteTemplateForReview/index.d.ts +10 -0
- package/api/sendQuoteTemplateForReview/sendQuoteTemplateForReview.d.ts +25 -0
- package/api/setLineItemNote/graphql/SetLineItemNoteMutation.d.ts +10 -0
- package/api/setLineItemNote/index.d.ts +10 -0
- package/api/setLineItemNote/setLineItemNote.d.ts +10 -0
- package/api/setShippingAddress/graphql/SetNegotiableQuoteShippingAddressMutation.d.ts +10 -0
- package/api/setShippingAddress/index.d.ts +2 -0
- package/api/setShippingAddress/setShippingAddress.d.ts +110 -0
- package/api/updateQuantities/graphql/UpdateNegotiableQuoteQuantitiesMutation.d.ts +10 -0
- package/api/updateQuantities/index.d.ts +10 -0
- package/api/updateQuantities/updateQuantities.d.ts +36 -0
- package/api/updateQuoteTemplateItemQuantities/graphql/updateNegotiableQuoteTemplateQuantities.d.ts +10 -0
- package/api/updateQuoteTemplateItemQuantities/index.d.ts +10 -0
- package/api/updateQuoteTemplateItemQuantities/updateQuoteTemplateItemQuantities.d.ts +20 -0
- package/api/uploadFile/graphql/FinishUploadMutation.d.ts +10 -0
- package/api/uploadFile/graphql/InitiateUploadMutation.d.ts +10 -0
- package/api/uploadFile/index.d.ts +10 -0
- package/api/uploadFile/uploadFile.d.ts +12 -0
- package/api.js +58 -22
- package/api.js.map +1 -1
- package/chunks/AttachedFilesList.js +4 -0
- package/chunks/AttachedFilesList.js.map +1 -0
- package/chunks/CheckWithCircle.js +4 -0
- package/chunks/CheckWithCircle.js.map +1 -0
- package/chunks/ChevronDown.js +4 -0
- package/chunks/ChevronDown.js.map +1 -0
- package/chunks/ConfirmationModal.js +4 -0
- package/chunks/ConfirmationModal.js.map +1 -0
- package/chunks/ItemsQuoted.js +4 -0
- package/chunks/ItemsQuoted.js.map +1 -0
- package/chunks/ItemsQuotedTemplate.js +4 -0
- package/chunks/ItemsQuotedTemplate.js.map +1 -0
- package/chunks/LineItemNoteModal.js +4 -0
- package/chunks/LineItemNoteModal.js.map +1 -0
- package/chunks/NegotiableQuoteFragment.js +392 -0
- package/chunks/NegotiableQuoteFragment.js.map +1 -0
- package/chunks/NegotiableQuoteTemplateFragment.js +338 -0
- package/chunks/NegotiableQuoteTemplateFragment.js.map +1 -0
- package/chunks/OrderSummaryLine.js +4 -0
- package/chunks/OrderSummaryLine.js.map +1 -0
- package/chunks/QuoteCommentsList.js +4 -0
- package/chunks/QuoteCommentsList.js.map +1 -0
- package/chunks/QuoteCommentsList3.js +4 -0
- package/chunks/QuoteCommentsList3.js.map +1 -0
- package/chunks/QuoteHistoryLog.js +4 -0
- package/chunks/QuoteHistoryLog.js.map +1 -0
- package/chunks/QuoteHistoryLog3.js +4 -0
- package/chunks/QuoteHistoryLog3.js.map +1 -0
- package/chunks/QuoteTemplateCommentsList.js +4 -0
- package/chunks/QuoteTemplateCommentsList.js.map +1 -0
- package/chunks/QuoteTemplateHistoryLog.js +4 -0
- package/chunks/QuoteTemplateHistoryLog.js.map +1 -0
- package/chunks/RenameQuoteModal.js +4 -0
- package/chunks/RenameQuoteModal.js.map +1 -0
- package/chunks/ShippingAddressDisplay.js +4 -0
- package/chunks/ShippingAddressDisplay.js.map +1 -0
- package/chunks/WarningFilled.js +4 -0
- package/chunks/WarningFilled.js.map +1 -0
- package/chunks/addQuoteTemplateLineItemNote.js +33 -0
- package/chunks/addQuoteTemplateLineItemNote.js.map +1 -0
- package/chunks/dateUtils.js +4 -0
- package/chunks/dateUtils.js.map +1 -0
- package/chunks/duplicateNegotiableQuote.js +121 -0
- package/chunks/duplicateNegotiableQuote.js.map +1 -0
- package/chunks/generateQuoteFromTemplate.js +12 -0
- package/chunks/generateQuoteFromTemplate.js.map +1 -0
- package/chunks/getQuoteTemplates.js +52 -0
- package/chunks/getQuoteTemplates.js.map +1 -0
- package/chunks/negotiableQuotes.js +77 -0
- package/chunks/negotiableQuotes.js.map +1 -0
- package/chunks/openQuoteTemplate.js +52 -0
- package/chunks/openQuoteTemplate.js.map +1 -0
- package/chunks/requestNegotiableQuote.js +6 -81
- package/chunks/requestNegotiableQuote.js.map +1 -1
- package/chunks/setLineItemNote.js +47 -0
- package/chunks/setLineItemNote.js.map +1 -0
- package/chunks/state.js +4 -0
- package/chunks/state.js.map +1 -0
- package/chunks/transform-quote-template.js +4 -0
- package/chunks/transform-quote-template.js.map +1 -0
- package/chunks/transform-quote.js +4 -0
- package/chunks/transform-quote.js.map +1 -0
- package/chunks/uploadFile.js +20 -0
- package/chunks/uploadFile.js.map +1 -0
- package/components/ActionsBar/ActionsBar.d.ts +15 -0
- package/components/ActionsBar/index.d.ts +11 -0
- package/components/AttachedFilesList/AttachedFilesList.d.ts +16 -0
- package/components/AttachedFilesList/index.d.ts +11 -0
- package/components/ConfirmationModal/ConfirmationModal.d.ts +17 -0
- package/components/ConfirmationModal/index.d.ts +11 -0
- package/components/ItemsQuoted/ItemsQuoted.d.ts +11 -0
- package/components/ItemsQuoted/index.d.ts +11 -0
- package/components/LineItemNoteModal/LineItemNoteModal.d.ts +17 -0
- package/components/LineItemNoteModal/index.d.ts +11 -0
- package/components/ManageNegotiableQuote/ManageNegotiableQuote.d.ts +22 -0
- package/components/ManageNegotiableQuote/__fixtures__/ManageNegotiableQuoteProps.d.ts +4 -0
- package/components/ManageNegotiableQuote/index.d.ts +11 -0
- package/components/ManageNegotiableQuoteTemplate/ManageNegotiableQuoteTemplate.d.ts +23 -0
- package/components/ManageNegotiableQuoteTemplate/__fixtures__/ManageNegotiableQuoteTemplateProps.d.ts +4 -0
- package/components/ManageNegotiableQuoteTemplate/index.d.ts +11 -0
- package/components/OrderSummary/OrderSummary.d.ts +48 -0
- package/components/OrderSummary/index.d.ts +11 -0
- package/components/OrderSummaryLine/OrderSummaryLine.d.ts +13 -0
- package/components/OrderSummaryLine/index.d.ts +11 -0
- package/components/ProductListTable/ProductListTable.d.ts +17 -0
- package/components/ProductListTable/index.d.ts +11 -0
- package/components/QuoteCommentsList/QuoteCommentsList.d.ts +17 -0
- package/components/QuoteCommentsList/index.d.ts +11 -0
- package/components/QuoteHistoryLog/QuoteHistoryLog.d.ts +77 -0
- package/components/QuoteHistoryLog/index.d.ts +11 -0
- package/components/QuotePricesSummary/QuotePricesSummary.d.ts +16 -0
- package/components/QuotePricesSummary/index.d.ts +11 -0
- package/components/QuoteSummaryList/QuoteSummaryList.d.ts +13 -0
- package/components/QuoteSummaryList/index.d.ts +11 -0
- package/components/QuoteTemplatesListTable/QuoteTemplatesListTable.d.ts +29 -0
- package/components/QuoteTemplatesListTable/index.d.ts +10 -0
- package/components/QuotesListTable/QuotesListTable.d.ts +29 -0
- package/components/QuotesListTable/index.d.ts +11 -0
- package/components/ReferenceDocumentFormModal/ReferenceDocumentFormModal.d.ts +30 -0
- package/components/ReferenceDocumentFormModal/index.d.ts +11 -0
- package/components/ReferenceDocumentsList/ReferenceDocumentsList.d.ts +18 -0
- package/components/ReferenceDocumentsList/index.d.ts +11 -0
- package/components/RenameQuoteModal/RenameQuoteModal.d.ts +18 -0
- package/components/RenameQuoteModal/index.d.ts +11 -0
- package/components/RequestNegotiableQuoteForm/RequestNegotiableQuoteForm.d.ts +1 -0
- package/components/ShippingAddressDisplay/ShippingAddressDisplay.d.ts +12 -0
- package/components/ShippingAddressDisplay/index.d.ts +11 -0
- package/components/TabbedContent/TabbedContent.d.ts +10 -0
- package/components/TabbedContent/index.d.ts +11 -0
- package/components/index.d.ts +30 -0
- package/containers/ItemsQuoted/ItemsQuoted.d.ts +30 -0
- package/containers/ItemsQuoted/index.d.ts +11 -0
- package/containers/ItemsQuoted.d.ts +3 -0
- package/containers/ItemsQuoted.js +4 -0
- package/containers/ItemsQuoted.js.map +1 -0
- package/containers/ItemsQuotedTemplate/ItemsQuotedTemplate.d.ts +25 -0
- package/containers/ItemsQuotedTemplate/index.d.ts +11 -0
- package/containers/ItemsQuotedTemplate.d.ts +3 -0
- package/containers/ItemsQuotedTemplate.js +4 -0
- package/containers/ItemsQuotedTemplate.js.map +1 -0
- package/containers/ManageNegotiableQuote/ManageNegotiableQuote.d.ts +90 -0
- package/containers/ManageNegotiableQuote/index.d.ts +11 -0
- package/containers/ManageNegotiableQuote.d.ts +3 -0
- package/containers/ManageNegotiableQuote.js +4 -0
- package/containers/ManageNegotiableQuote.js.map +1 -0
- package/containers/ManageNegotiableQuoteTemplate/ManageNegotiableQuoteTemplate.d.ts +108 -0
- package/containers/ManageNegotiableQuoteTemplate/index.d.ts +11 -0
- package/containers/ManageNegotiableQuoteTemplate.d.ts +3 -0
- package/containers/ManageNegotiableQuoteTemplate.js +6 -0
- package/containers/ManageNegotiableQuoteTemplate.js.map +1 -0
- package/containers/OrderSummary/OrderSummary.d.ts +11 -0
- package/containers/OrderSummary/index.d.ts +11 -0
- package/containers/OrderSummary.d.ts +3 -0
- package/containers/OrderSummary.js +4 -0
- package/containers/OrderSummary.js.map +1 -0
- package/containers/OrderSummaryLine/OrderSummaryLine.d.ts +14 -0
- package/containers/OrderSummaryLine/index.d.ts +11 -0
- package/containers/OrderSummaryLine.d.ts +3 -0
- package/containers/OrderSummaryLine.js +4 -0
- package/containers/OrderSummaryLine.js.map +1 -0
- package/containers/QuoteCommentsList/QuoteCommentsList.d.ts +9 -0
- package/containers/QuoteCommentsList/index.d.ts +11 -0
- package/containers/QuoteCommentsList.d.ts +3 -0
- package/containers/QuoteCommentsList.js +4 -0
- package/containers/QuoteCommentsList.js.map +1 -0
- package/containers/QuoteHistoryLog/QuoteHistoryLog.d.ts +9 -0
- package/containers/QuoteHistoryLog/index.d.ts +11 -0
- package/containers/QuoteHistoryLog.d.ts +3 -0
- package/containers/QuoteHistoryLog.js +4 -0
- package/containers/QuoteHistoryLog.js.map +1 -0
- package/containers/QuoteSummaryList/QuoteSummaryList.d.ts +51 -0
- package/containers/QuoteSummaryList/index.d.ts +11 -0
- package/containers/QuoteSummaryList.d.ts +3 -0
- package/containers/QuoteSummaryList.js +4 -0
- package/containers/QuoteSummaryList.js.map +1 -0
- package/containers/QuoteTemplateCommentsList/QuoteTemplateCommentsList.d.ts +9 -0
- package/containers/QuoteTemplateCommentsList/index.d.ts +11 -0
- package/containers/QuoteTemplateCommentsList.d.ts +3 -0
- package/containers/QuoteTemplateCommentsList.js +4 -0
- package/containers/QuoteTemplateCommentsList.js.map +1 -0
- package/containers/QuoteTemplateHistoryLog/QuoteTemplateHistoryLog.d.ts +9 -0
- package/containers/QuoteTemplateHistoryLog/index.d.ts +11 -0
- package/containers/QuoteTemplateHistoryLog.d.ts +3 -0
- package/containers/QuoteTemplateHistoryLog.js +4 -0
- package/containers/QuoteTemplateHistoryLog.js.map +1 -0
- package/containers/QuoteTemplatesListTable/QuoteTemplatesListTable.d.ts +74 -0
- package/containers/QuoteTemplatesListTable/index.d.ts +11 -0
- package/containers/QuoteTemplatesListTable.d.ts +3 -0
- package/containers/QuoteTemplatesListTable.js +4 -0
- package/containers/QuoteTemplatesListTable.js.map +1 -0
- package/containers/QuotesListTable/QuotesListTable.d.ts +72 -0
- package/containers/QuotesListTable/index.d.ts +11 -0
- package/containers/QuotesListTable.d.ts +3 -0
- package/containers/QuotesListTable.js +4 -0
- package/containers/QuotesListTable.js.map +1 -0
- package/containers/RequestNegotiableQuoteForm/RequestNegotiableQuoteForm.d.ts +10 -1
- package/containers/RequestNegotiableQuoteForm.js +1 -1
- package/containers/RequestNegotiableQuoteForm.js.map +1 -1
- package/containers/ShippingAddressDisplay/ShippingAddressDisplay.d.ts +10 -0
- package/containers/ShippingAddressDisplay/index.d.ts +11 -0
- package/containers/ShippingAddressDisplay.d.ts +1 -0
- package/containers/ShippingAddressDisplay.js +4 -0
- package/containers/ShippingAddressDisplay.js.map +1 -0
- package/containers/index.d.ts +22 -0
- package/data/models/__fixtures__/negotiableQuoteModel.d.ts +8 -0
- package/data/models/__fixtures__/negotiableQuoteTemplateModel.d.ts +4 -0
- package/data/models/__fixtures__/negotiableQuoteTemplatesListModel.d.ts +5 -0
- package/data/models/__fixtures__/negotiableQuotesListModel.d.ts +5 -0
- package/data/models/__fixtures__/storeConfigModel.d.ts +5 -0
- package/data/models/index.d.ts +11 -1
- package/data/models/negotiable-quote-model.d.ts +263 -27
- package/data/models/negotiable-quote-template-model.d.ts +112 -0
- package/data/models/store-config-model.d.ts +29 -0
- package/data/transforms/__fixtures__/negotiableQuoteData.d.ts +673 -2
- package/data/transforms/__fixtures__/negotiableQuoteTemplateData.d.ts +2151 -0
- package/data/transforms/__fixtures__/storeConfigData.d.ts +35 -0
- package/data/transforms/index.d.ts +6 -13
- package/data/transforms/transform-history.d.ts +15 -0
- package/data/transforms/transform-quote-items.d.ts +15 -0
- package/data/transforms/transform-quote-template.d.ts +5 -0
- package/data/transforms/transform-quote.d.ts +13 -2
- package/data/transforms/transform-store-config.d.ts +4 -0
- package/hooks/useItemsQuotedTemplate.d.ts +15 -0
- package/hooks/useQuoteSummaryData.d.ts +10 -0
- package/hooks/useReferenceDocumentLinks.d.ts +34 -0
- package/hooks/useRemoveTemplateItems.d.ts +25 -0
- package/hooks/useRenameTemplate.d.ts +71 -0
- package/hooks/useUpdateTemplateQuantities.d.ts +27 -0
- package/i18n/en_US.json.d.ts +447 -1
- package/lib/configurationTransformers.d.ts +27 -0
- package/lib/itemFormatters.d.ts +47 -0
- package/lib/priceCalculators.d.ts +41 -0
- package/lib/state.d.ts +6 -0
- package/package.json +1 -1
- package/render.js +6 -2
- package/render.js.map +1 -1
- package/types/state.types.d.ts +13 -0
- package/utils/dateUtils.d.ts +26 -0
- package/utils/fileUtils.d.ts +46 -0
- package/utils/mapAuthPermissions.d.ts +39 -0
- package/api/getCustomerData/graphql/CustomerQuery.d.ts +0 -2
- package/api/graphql/CustomerFragment.d.ts +0 -2
- package/data/models/__fixtures__/customerModel.d.ts +0 -4
- package/data/transforms/transform-customer.d.ts +0 -15
|
@@ -1,59 +1,6 @@
|
|
|
1
1
|
/*! Copyright 2025 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
|
-
import{
|
|
4
|
-
fragment NegotiableQuoteFragment on RequestNegotiableQuoteOutput {
|
|
5
|
-
quote {
|
|
6
|
-
uid
|
|
7
|
-
created_at
|
|
8
|
-
status
|
|
9
|
-
buyer {
|
|
10
|
-
firstname
|
|
11
|
-
lastname
|
|
12
|
-
}
|
|
13
|
-
comments {
|
|
14
|
-
uid
|
|
15
|
-
created_at
|
|
16
|
-
author {
|
|
17
|
-
firstname
|
|
18
|
-
lastname
|
|
19
|
-
}
|
|
20
|
-
attachments {
|
|
21
|
-
name
|
|
22
|
-
url
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
items {
|
|
26
|
-
product {
|
|
27
|
-
uid
|
|
28
|
-
sku
|
|
29
|
-
name
|
|
30
|
-
price_range {
|
|
31
|
-
maximum_price {
|
|
32
|
-
regular_price {
|
|
33
|
-
value
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
quantity
|
|
39
|
-
}
|
|
40
|
-
prices {
|
|
41
|
-
subtotal_excluding_tax {
|
|
42
|
-
value
|
|
43
|
-
}
|
|
44
|
-
subtotal_including_tax {
|
|
45
|
-
value
|
|
46
|
-
}
|
|
47
|
-
subtotal_with_discount_excluding_tax {
|
|
48
|
-
value
|
|
49
|
-
}
|
|
50
|
-
grand_total {
|
|
51
|
-
value
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
`,b=`
|
|
3
|
+
import{events as f}from"@dropins/tools/event-bus.js";import{N}from"./NegotiableQuoteFragment.js";import{f as d,t as l}from"./transform-quote.js";import"./state.js";const g=`
|
|
57
4
|
mutation REQUEST_NEGOTIABLE_QUOTE_MUTATION(
|
|
58
5
|
$cartId: ID!
|
|
59
6
|
$quoteName: String!
|
|
@@ -68,33 +15,11 @@ import{fetchGraphQl as g}from"@dropins/tools/fetch-graphql.js";import{events as
|
|
|
68
15
|
is_draft: $isDraft
|
|
69
16
|
}
|
|
70
17
|
) {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
}
|
|
74
|
-
${q}
|
|
75
|
-
`,y=async a=>{const{cartId:t,quoteName:e,comment:o,attachments:u,isDraft:i}=a;if(!t)throw new Error("Cart ID is required");if(!e)throw new Error("Quote name is required");if(!o)throw new Error("Comment is required");return g(b,{variables:{cartId:t,quoteName:e,comment:u!=null&&u.length?{comment:o,attachments:u}:{comment:o},isDraft:i}}).then(l=>{const{errors:r}=l;if(r){const c=r.map(d=>d.message).join("; ");throw new Error(`Failed to request negotiable quote: ${c}`)}const n=N(l);if(!n)throw new Error("Failed to transform quote data: Invalid response structure");return h.emit("quote-management/negotiable-quote-requested",{quote:n,input:{cartId:t,quoteName:e,comment:o,attachments:u,isDraft:i}}),n})},v=async a=>{var i,l;const t=a==null?void 0:a.name;if(!a||!t)throw new Error("Invalid file");const e="NEGOTIABLE_QUOTE_ATTACHMENT",o=`
|
|
76
|
-
mutation INITIATE_UPLOAD_MUTATION(
|
|
77
|
-
$input: initiateUploadInput!
|
|
78
|
-
){
|
|
79
|
-
initiateUpload(
|
|
80
|
-
input: $input
|
|
81
|
-
){
|
|
82
|
-
upload_url
|
|
83
|
-
key
|
|
84
|
-
expires_at
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
`,u=`
|
|
88
|
-
mutation FINISH_UPLOAD_MUTATION(
|
|
89
|
-
$input: finishUploadInput!
|
|
90
|
-
){
|
|
91
|
-
finishUpload(
|
|
92
|
-
input: $input
|
|
93
|
-
){
|
|
94
|
-
success
|
|
95
|
-
key
|
|
96
|
-
message
|
|
18
|
+
quote {
|
|
19
|
+
...NegotiableQuoteFragment
|
|
97
20
|
}
|
|
98
21
|
}
|
|
99
|
-
|
|
22
|
+
}
|
|
23
|
+
${N}
|
|
24
|
+
`,p=async q=>{const{cartId:r,quoteName:o,comment:t,attachments:e,isDraft:n}=q;if(!r)throw new Error("Cart ID is required");if(!o)throw new Error("Quote name is required");if(!t)throw new Error("Comment is required");return d(g,{variables:{cartId:r,quoteName:o,comment:e!=null&&e.length?{comment:t,attachments:e}:{comment:t},isDraft:n}}).then(i=>{var m,s;const{errors:u}=i;if(u){const E=u.map(c=>c.message).join("; ");throw new Error(`Failed to request negotiable quote: ${E}`)}const a=l((s=(m=i.data)==null?void 0:m.requestNegotiableQuote)==null?void 0:s.quote);if(!a)throw new Error("Failed to transform quote data: Invalid response structure");return f.emit("quote-management/negotiable-quote-requested",{quote:a,input:{cartId:r,quoteName:o,comment:t,attachments:e,isDraft:n}}),a})};export{p as r};
|
|
100
25
|
//# sourceMappingURL=requestNegotiableQuote.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"requestNegotiableQuote.js","sources":["/@dropins/storefront-quote-management/src/lib/state.ts","/@dropins/storefront-quote-management/src/data/transforms/transform-quote.ts","/@dropins/storefront-quote-management/src/api/graphql/NegotiableQuoteFragment.ts","/@dropins/storefront-quote-management/src/api/requestNegotiableQuote/graphql/RequestNegotiableQuoteMutation.ts","/@dropins/storefront-quote-management/src/api/requestNegotiableQuote/requestNegotiableQuote.ts"],"sourcesContent":["/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this \n * file in accordance with the terms of the Adobe license agreement \n * accompanying it. \n *******************************************************************/\n\nimport { State } from '../types/state.types';\n\nexport const DEFAULT_PERMISSIONS = {\n requestQuote: false,\n editQuote: false,\n deleteQuote: false,\n};\n\nconst _state: State = {\n authenticated: false,\n permissions: DEFAULT_PERMISSIONS,\n}\n\n// Proxy state to make it reactive\nexport const state = new Proxy(_state, {\n get: (target, key) => {\n return target[key as keyof State];\n },\n set: (target, key, value) => {\n target[key as keyof State] = value;\n return true;\n }\n})","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\nimport { NegotiableQuoteModel } from '@/quote-management/data/models/negotiable-quote-model';\n\nexport function transformQuote(response: any): NegotiableQuoteModel | null {\n if (!response || !response.data || !response.data.requestNegotiableQuote) {\n return null;\n }\n\n const quote = response.data.requestNegotiableQuote.quote;\n\n return {\n uid: quote.uid,\n createdAt: quote.created_at,\n status: quote.status,\n buyer: quote.buyer,\n comments: quote.comments.map((comment: any) => {\n const baseComment: any = {\n uid: comment.uid,\n createdAt: comment.created_at,\n author: comment.author,\n };\n\n if (Array.isArray(comment.attachments) && comment.attachments.length > 0) {\n baseComment.attachments = comment.attachments.map((a: any) => ({\n name: a.name,\n url: a.url,\n }));\n }\n\n return baseComment;\n }),\n items: quote.items.map((item: any) => ({\n product: {\n uid: item.product.uid,\n sku: item.product.sku,\n name: item.product.name,\n priceRange: {\n maximumPrice: {\n regularPrice: {\n value: item.product.price_range.maximum_price.regular_price.value,\n },\n },\n },\n },\n quantity: item.quantity,\n prices: {\n subtotalExcludingTax: {\n value: quote.prices.subtotal_excluding_tax.value,\n },\n subtotalIncludingTax: {\n value: quote.prices.subtotal_including_tax.value,\n },\n subtotalWithDiscountExcludingTax: {\n value: quote.prices.subtotal_with_discount_excluding_tax.value,\n },\n grandTotal: {\n value: quote.prices.grand_total.value,\n },\n },\n })),\n };\n}\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nexport const NEGOTIABLE_QUOTE_FRAGMENT = /* GraphQL */ `\n fragment NegotiableQuoteFragment on RequestNegotiableQuoteOutput {\n quote {\n uid\n created_at\n status\n buyer {\n firstname\n lastname\n }\n comments {\n uid\n created_at\n author {\n firstname\n lastname\n }\n attachments {\n name\n url\n }\n }\n items {\n product {\n uid\n sku\n name\n price_range {\n maximum_price {\n regular_price {\n value\n }\n }\n }\n }\n quantity\n }\n prices {\n subtotal_excluding_tax {\n value\n }\n subtotal_including_tax {\n value\n }\n subtotal_with_discount_excluding_tax {\n value\n }\n grand_total {\n value\n }\n }\n }\n }\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { NEGOTIABLE_QUOTE_FRAGMENT } from '@/quote-management/api/graphql/NegotiableQuoteFragment';\n\nexport const REQUEST_NEGOTIABLE_QUOTE_MUTATION = `\n mutation REQUEST_NEGOTIABLE_QUOTE_MUTATION(\n $cartId: ID!\n $quoteName: String!\n $comment: NegotiableQuoteCommentInput!\n $isDraft: Boolean\n ) {\n requestNegotiableQuote(\n input: {\n cart_id: $cartId\n quote_name: $quoteName\n comment: $comment\n is_draft: $isDraft\n }\n ) {\n ...NegotiableQuoteFragment\n }\n }\n ${NEGOTIABLE_QUOTE_FRAGMENT}\n`;\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { fetchGraphQl } from '@adobe-commerce/fetch-graphql';\nimport { events } from '@adobe-commerce/event-bus';\nimport { REQUEST_NEGOTIABLE_QUOTE_MUTATION } from './graphql/RequestNegotiableQuoteMutation';\nimport { NegotiableQuoteModel } from '@/quote-management/data/models/negotiable-quote-model';\nimport { transformQuote } from '@/quote-management/data/transforms';\n\nexport interface RequestNegotiableQuoteInput {\n cartId: string;\n quoteName: string;\n comment: string;\n isDraft?: boolean;\n attachments?: { key: string }[];\n}\n\nexport const requestNegotiableQuote = async (\n input: RequestNegotiableQuoteInput\n): Promise<NegotiableQuoteModel | null> => {\n const { cartId, quoteName, comment, attachments, isDraft } = input;\n\n if (!cartId) {\n throw new Error('Cart ID is required');\n }\n\n if (!quoteName) {\n throw new Error('Quote name is required');\n }\n\n if (!comment) {\n throw new Error('Comment is required');\n }\n\n return fetchGraphQl(REQUEST_NEGOTIABLE_QUOTE_MUTATION, {\n variables: {\n cartId,\n quoteName,\n comment: attachments?.length ? { comment, attachments } : { comment },\n isDraft,\n },\n }).then((response) => {\n const { errors } = response;\n\n if (errors) {\n // Provide more detailed error information\n const errorMessages = errors.map((error) => error.message).join('; ');\n throw new Error(`Failed to request negotiable quote: ${errorMessages}`);\n }\n\n // Transform the quote data\n const quoteData = transformQuote(response);\n\n if (!quoteData) {\n throw new Error(\n 'Failed to transform quote data: Invalid response structure'\n );\n }\n\n // Emit event with transformed quote data on success\n events.emit('quote-management/negotiable-quote-requested', {\n quote: quoteData,\n input: { cartId, quoteName, comment, attachments, isDraft },\n });\n\n return quoteData;\n });\n};\n\nexport const uploadFile = async (file: File): Promise<{ key: string }> => {\n const filename = file?.name;\n if (!file || !filename) throw new Error('Invalid file');\n\n const media_resource_type = 'NEGOTIABLE_QUOTE_ATTACHMENT';\n\n const INITIATE_UPLOAD_MUTATION = `\n mutation INITIATE_UPLOAD_MUTATION(\n $input: initiateUploadInput!\n ){\n initiateUpload(\n input: $input\n ){\n upload_url\n key\n expires_at\n }\n }\n `;\n\n const FINISH_UPLOAD_MUTATION = `\n mutation FINISH_UPLOAD_MUTATION(\n $input: finishUploadInput!\n ){\n finishUpload(\n input: $input\n ){\n success\n key\n message\n }\n }\n `;\n\n try {\n const { data: initialData, errors: initialErrors }: any = await fetchGraphQl(INITIATE_UPLOAD_MUTATION, {\n variables: { input: { key: filename, media_resource_type } },\n });\n if (initialErrors?.length) throw new Error(initialErrors.map((e: any) => e?.message).join('; '));\n\n const { upload_url, key } = initialData?.initiateUpload || {};\n if (!upload_url || !key) throw new Error('Failed to initiate upload');\n\n const put = await fetch(upload_url, { method: 'PUT', body: file });\n if (!put.ok) throw new Error(`Upload failed: ${put.status} ${put.statusText}`);\n\n const { data: finishData, errors: finishErrors }: any = await fetchGraphQl(FINISH_UPLOAD_MUTATION, {\n variables: { input: { key, media_resource_type } },\n });\n if (finishErrors?.length) throw new Error(finishErrors.map((e: any) => e?.message).join('; '));\n\n const { success, key: finalizedKey, message } = finishData?.finishUpload || {};\n if (!success || !finalizedKey) throw new Error(message || 'Failed to finish upload');\n\n return { key: finalizedKey };\n } catch (err: any) {\n try {\n (events as any)?.emit?.('quote-management/file-upload-error', {\n error: err?.message || 'File upload failed',\n fileName: file?.name,\n });\n } catch {}\n throw err instanceof Error ? err : new Error('File upload failed');\n }\n};\n"],"names":["DEFAULT_PERMISSIONS","_state","state","target","key","value","transformQuote","response","quote","comment","baseComment","a","item","NEGOTIABLE_QUOTE_FRAGMENT","REQUEST_NEGOTIABLE_QUOTE_MUTATION","requestNegotiableQuote","input","cartId","quoteName","attachments","isDraft","fetchGraphQl","errors","errorMessages","error","quoteData","events","uploadFile","file","filename","media_resource_type","INITIATE_UPLOAD_MUTATION","FINISH_UPLOAD_MUTATION","initialData","initialErrors","e","upload_url","put","finishData","finishErrors","success","finalizedKey","message","err","_b","_a"],"mappings":"oHAWO,MAAMA,EAAsB,CAC/B,aAAc,GACd,UAAW,GACX,YAAa,EACjB,EAEMC,EAAgB,CAClB,cAAe,GACf,YAAaD,CACjB,EAGaE,EAAQ,IAAI,MAAMD,EAAQ,CACnC,IAAK,CAACE,EAAQC,IACHD,EAAOC,CAAkB,EAEpC,IAAK,CAACD,EAAQC,EAAKC,KACfF,EAAOC,CAAkB,EAAIC,EACtB,GAEf,CAAC,ECbM,SAASC,EAAeC,EAA4C,CACzE,GAAI,CAACA,GAAY,CAACA,EAAS,MAAQ,CAACA,EAAS,KAAK,uBAChD,OAAO,KAGT,MAAMC,EAAQD,EAAS,KAAK,uBAAuB,MAEnD,MAAO,CACL,IAAKC,EAAM,IACX,UAAWA,EAAM,WACjB,OAAQA,EAAM,OACd,MAAOA,EAAM,MACb,SAAUA,EAAM,SAAS,IAAKC,GAAiB,CAC7C,MAAMC,EAAmB,CACvB,IAAKD,EAAQ,IACb,UAAWA,EAAQ,WACnB,OAAQA,EAAQ,MAAA,EAGlB,OAAI,MAAM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,EAAM,IAAI,MAAM,oBAAoB,CACnE,CACF"}
|
|
1
|
+
{"version":3,"file":"requestNegotiableQuote.js","sources":["/@dropins/storefront-quote-management/src/api/requestNegotiableQuote/graphql/RequestNegotiableQuoteMutation.ts","/@dropins/storefront-quote-management/src/api/requestNegotiableQuote/requestNegotiableQuote.ts"],"sourcesContent":["/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { NEGOTIABLE_QUOTE_FRAGMENT } from '@/quote-management/api/graphql/NegotiableQuoteFragment';\n\nexport const REQUEST_NEGOTIABLE_QUOTE_MUTATION = `\n mutation REQUEST_NEGOTIABLE_QUOTE_MUTATION(\n $cartId: ID!\n $quoteName: String!\n $comment: NegotiableQuoteCommentInput!\n $isDraft: Boolean\n ) {\n requestNegotiableQuote(\n input: {\n cart_id: $cartId\n quote_name: $quoteName\n comment: $comment\n is_draft: $isDraft\n }\n ) {\n quote {\n ...NegotiableQuoteFragment\n }\n }\n }\n ${NEGOTIABLE_QUOTE_FRAGMENT}\n`;\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { fetchGraphQl } from '@/quote-management/api';\nimport { events } from '@adobe-commerce/event-bus';\nimport { REQUEST_NEGOTIABLE_QUOTE_MUTATION } from './graphql/RequestNegotiableQuoteMutation';\nimport { NegotiableQuoteModel } from '@/quote-management/data/models/negotiable-quote-model';\nimport { transformQuote } from '@/quote-management/data/transforms';\n\nexport interface RequestNegotiableQuoteInput {\n cartId: string;\n quoteName: string;\n comment: string;\n isDraft?: boolean;\n attachments?: { key: string }[];\n}\n\nexport const requestNegotiableQuote = async (\n input: RequestNegotiableQuoteInput\n): Promise<NegotiableQuoteModel | null> => {\n const { cartId, quoteName, comment, attachments, isDraft } = input;\n\n if (!cartId) {\n throw new Error('Cart ID is required');\n }\n\n if (!quoteName) {\n throw new Error('Quote name is required');\n }\n\n if (!comment) {\n throw new Error('Comment is required');\n }\n\n return fetchGraphQl(REQUEST_NEGOTIABLE_QUOTE_MUTATION, {\n variables: {\n cartId,\n quoteName,\n comment: attachments?.length ? { comment, attachments } : { comment },\n isDraft,\n },\n }).then((response) => {\n const { errors } = response;\n\n if (errors) {\n // Provide more detailed error information\n const errorMessages = errors.map((error) => error.message).join('; ');\n throw new Error(`Failed to request negotiable quote: ${errorMessages}`);\n }\n\n // Transform the quote data\n const quoteData = transformQuote(response.data?.requestNegotiableQuote?.quote);\n\n if (!quoteData) {\n throw new Error(\n 'Failed to transform quote data: Invalid response structure'\n );\n }\n\n // Emit event with transformed quote data on success\n events.emit('quote-management/negotiable-quote-requested', {\n quote: quoteData,\n input: { cartId, quoteName, comment, attachments, isDraft },\n });\n\n return quoteData;\n });\n};\n"],"names":["REQUEST_NEGOTIABLE_QUOTE_MUTATION","NEGOTIABLE_QUOTE_FRAGMENT","requestNegotiableQuote","input","cartId","quoteName","comment","attachments","isDraft","fetchGraphQl","response","errors","errorMessages","error","quoteData","transformQuote","_b","_a","events"],"mappings":"oKAWO,MAAMA,EAAoC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAoB7CC,CAAyB;AAAA,ECRhBC,EAAyB,MACpCC,GACyC,CACzC,KAAM,CAAE,OAAAC,EAAQ,UAAAC,EAAW,QAAAC,EAAS,YAAAC,EAAa,QAAAC,GAAYL,EAE7D,GAAI,CAACC,EACH,MAAM,IAAI,MAAM,qBAAqB,EAGvC,GAAI,CAACC,EACH,MAAM,IAAI,MAAM,wBAAwB,EAG1C,GAAI,CAACC,EACH,MAAM,IAAI,MAAM,qBAAqB,EAGvC,OAAOG,EAAaT,EAAmC,CACrD,UAAW,CACT,OAAAI,EACA,UAAAC,EACA,QAASE,GAAA,MAAAA,EAAa,OAAS,CAAE,QAAAD,EAAS,YAAAC,CAAA,EAAgB,CAAE,QAAAD,CAAA,EAC5D,QAAAE,CAAA,CACF,CACD,EAAE,KAAME,GAAa,SACpB,KAAM,CAAE,OAAAC,GAAWD,EAEnB,GAAIC,EAAQ,CAEV,MAAMC,EAAgBD,EAAO,IAAKE,GAAUA,EAAM,OAAO,EAAE,KAAK,IAAI,EACpE,MAAM,IAAI,MAAM,uCAAuCD,CAAa,EAAE,CACxE,CAGA,MAAME,EAAYC,GAAeC,GAAAC,EAAAP,EAAS,OAAT,YAAAO,EAAe,yBAAf,YAAAD,EAAuC,KAAK,EAE7E,GAAI,CAACF,EACH,MAAM,IAAI,MACR,4DAAA,EAKJ,OAAAI,EAAO,KAAK,8CAA+C,CACzD,MAAOJ,EACP,MAAO,CAAE,OAAAV,EAAQ,UAAAC,EAAW,QAAAC,EAAS,YAAAC,EAAa,QAAAC,CAAA,CAAQ,CAC3D,EAEMM,CACT,CAAC,CACH"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/*! Copyright 2025 Adobe
|
|
2
|
+
All Rights Reserved. */
|
|
3
|
+
import{events as d}from"@dropins/tools/event-bus.js";import{f as E,t as U}from"./transform-quote.js";import{s as I}from"./state.js";import{N as w}from"./NegotiableQuoteFragment.js";const f=`
|
|
4
|
+
mutation UPDATE_NEGOTIABLE_QUOTE_QUANTITIES_MUTATION(
|
|
5
|
+
$quoteUid: ID!
|
|
6
|
+
$items: [NegotiableQuoteItemQuantityInput!]!
|
|
7
|
+
) {
|
|
8
|
+
updateNegotiableQuoteQuantities(
|
|
9
|
+
input: {
|
|
10
|
+
quote_uid: $quoteUid
|
|
11
|
+
items: $items
|
|
12
|
+
}
|
|
13
|
+
) {
|
|
14
|
+
quote {
|
|
15
|
+
...NegotiableQuoteFragment
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
${w}
|
|
20
|
+
`,Q=async s=>{if(!I.authenticated)return Promise.reject(new Error("Unauthorized"));const{quoteUid:o,items:e}=s;if(!o)throw new Error("Quote UID is required");if(!e||!Array.isArray(e)||e.length===0)throw new Error("Items array is required and must not be empty");for(const t of e){if(!t.quoteItemUid)throw new Error("Each item must have a quoteItemUid");if(typeof t.quantity!="number"||t.quantity<=0)throw new Error(`Invalid quantity for item ${t.quoteItemUid}: quantity must be a positive number`);if(!Number.isInteger(t.quantity))throw new Error(`Invalid quantity for item ${t.quoteItemUid}: quantity must be an integer`)}const a=e.map(t=>({quote_item_uid:t.quoteItemUid,quantity:t.quantity}));return E(f,{variables:{quoteUid:o,items:a}}).then(t=>{var u,i;const{errors:n}=t;if(n){const m=n.map(q=>q.message).join("; ");throw new Error(`Failed to update quote quantities: ${m}`)}const r=U((i=(u=t.data)==null?void 0:u.updateNegotiableQuoteQuantities)==null?void 0:i.quote);if(!r)throw new Error("Failed to transform quote data: Invalid response structure");return d.emit("quote-management/quantities-updated",{quote:r,input:{quoteUid:o,items:e}}),r})},_=`
|
|
21
|
+
mutation REMOVE_NEGOTIABLE_QUOTE_ITEMS_MUTATION(
|
|
22
|
+
$quoteUid: ID!
|
|
23
|
+
$quoteItemUids: [ID!]!
|
|
24
|
+
) {
|
|
25
|
+
removeNegotiableQuoteItems(
|
|
26
|
+
input: {
|
|
27
|
+
quote_uid: $quoteUid
|
|
28
|
+
quote_item_uids: $quoteItemUids
|
|
29
|
+
}
|
|
30
|
+
) {
|
|
31
|
+
quote {
|
|
32
|
+
...NegotiableQuoteFragment
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
${w}
|
|
37
|
+
`,y=async s=>{var u;if(!I.authenticated)return Promise.reject(new Error("Unauthorized"));const{quoteUid:o,quoteItemUids:e}=s;if(!o)throw new Error("Quote UID is required");if(!Array.isArray(e)||e.length===0)throw new Error("At least one quote item UID is required");const a=await E(_,{variables:{quoteUid:o,quoteItemUids:e}}),{errors:t,data:n}=a;if(t!=null&&t.length){const i=t.map(m=>m.message).join("; ");throw new Error(`Failed to remove negotiable quote items: ${i}`)}const r=U((u=n==null?void 0:n.removeNegotiableQuoteItems)==null?void 0:u.quote);if(!r)throw new Error("Failed to transform quote data: Invalid response structure");return d.emit("quote-management/quote-items-removed",{quote:r,removedItemUids:e,input:s}),r},N=`
|
|
38
|
+
mutation SET_LINE_ITEM_NOTE_MUTATION($input: LineItemNoteInput!) {
|
|
39
|
+
setLineItemNote(input: $input) {
|
|
40
|
+
quote {
|
|
41
|
+
...NegotiableQuoteFragment
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
${w}
|
|
46
|
+
`,A=async s=>{if(!I.authenticated)throw new Error("Unauthorized");const{quoteUid:o,itemUid:e,note:a,quantity:t}=s;if(!o)throw new Error("Quote UID is required");if(!e)throw new Error("Item UID is required");if(!a)throw new Error("Note is required");const n={quote_uid:o,quote_item_uid:e,note:a.trim()};return E(N,{variables:{input:n}}).then(r=>{var m,q;const{errors:u}=r;if(u){const T=u.map(c=>c.message).join("; ");throw new Error(`Failed to set line item note: ${T}`)}const i=U((q=(m=r.data)==null?void 0:m.setLineItemNote)==null?void 0:q.quote);if(!i)throw new Error("Failed to transform quote data: Invalid response structure");return d.emit("quote-management/line-item-note-set",{quote:i,input:{quoteUid:o,itemUid:e,note:a,quantity:t}}),d.emit("quote-management/quote-data",{quote:i,permissions:I.permissions}),i})};export{y as r,A as s,Q as u};
|
|
47
|
+
//# sourceMappingURL=setLineItemNote.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setLineItemNote.js","sources":["/@dropins/storefront-quote-management/src/api/updateQuantities/graphql/UpdateNegotiableQuoteQuantitiesMutation.ts","/@dropins/storefront-quote-management/src/api/updateQuantities/updateQuantities.ts","/@dropins/storefront-quote-management/src/api/removeNegotiableQuoteItems/graphql/RemoveNegotiableQuoteItemsMutation.ts","/@dropins/storefront-quote-management/src/api/removeNegotiableQuoteItems/removeNegotiableQuoteItems.ts","/@dropins/storefront-quote-management/src/api/setLineItemNote/graphql/SetLineItemNoteMutation.ts","/@dropins/storefront-quote-management/src/api/setLineItemNote/setLineItemNote.ts"],"sourcesContent":["/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { NEGOTIABLE_QUOTE_FRAGMENT } from '@/quote-management/api/graphql/NegotiableQuoteFragment';\n\nexport const UPDATE_NEGOTIABLE_QUOTE_QUANTITIES_MUTATION = `\n mutation UPDATE_NEGOTIABLE_QUOTE_QUANTITIES_MUTATION(\n $quoteUid: ID!\n $items: [NegotiableQuoteItemQuantityInput!]!\n ) {\n updateNegotiableQuoteQuantities(\n input: {\n quote_uid: $quoteUid\n items: $items\n }\n ) {\n quote {\n ...NegotiableQuoteFragment\n }\n }\n }\n ${NEGOTIABLE_QUOTE_FRAGMENT}\n`;\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { fetchGraphQl } from '@/quote-management/api';\nimport { events } from '@adobe-commerce/event-bus';\nimport { state } from '@/quote-management/lib/state';\nimport { UPDATE_NEGOTIABLE_QUOTE_QUANTITIES_MUTATION } from './graphql/UpdateNegotiableQuoteQuantitiesMutation';\nimport { NegotiableQuoteModel } from '@/quote-management/data/models/negotiable-quote-model';\nimport { transformQuote } from '@/quote-management/data/transforms';\n\nexport interface QuantityItem {\n /** The unique ID of the quote item */\n quoteItemUid: string;\n /** The new quantity for the item (must be greater than 0) */\n quantity: number;\n}\n\nexport interface UpdateQuantitiesInput {\n /** The unique ID of the negotiable quote */\n quoteUid: string;\n /** Array of items with their new quantities */\n items: QuantityItem[];\n}\n\n/**\n * Updates the quantities of items in a negotiable quote.\n *\n * @param input - The input parameters for updating quantities\n * @param input.quoteUid - The unique ID of the negotiable quote\n * @param input.items - Array of items with their new quantities\n * @returns Promise that resolves to the updated quote model\n * @throws Error if validation fails or GraphQL operation fails\n *\n * @example\n * ```ts\n * const quote = await updateQuantities({\n * quoteUid: 'quote-123',\n * items: [\n * { quoteItemUid: 'item-1', quantity: 5 },\n * { quoteItemUid: 'item-2', quantity: 3 }\n * ]\n * });\n * ```\n */\nexport const updateQuantities = async (\n input: UpdateQuantitiesInput\n): Promise<NegotiableQuoteModel | null> => {\n if (!state.authenticated) {\n return Promise.reject(new Error('Unauthorized'));\n }\n\n const { quoteUid, items } = input;\n\n // Validate quoteUid\n if (!quoteUid) {\n throw new Error('Quote UID is required');\n }\n\n // Validate items array\n if (!items || !Array.isArray(items) || items.length === 0) {\n throw new Error('Items array is required and must not be empty');\n }\n\n // Validate each item\n for (const item of items) {\n if (!item.quoteItemUid) {\n throw new Error('Each item must have a quoteItemUid');\n }\n if (typeof item.quantity !== 'number' || item.quantity <= 0) {\n throw new Error(\n `Invalid quantity for item ${item.quoteItemUid}: quantity must be a positive number`\n );\n }\n // Ensure quantity is an integer\n if (!Number.isInteger(item.quantity)) {\n throw new Error(\n `Invalid quantity for item ${item.quoteItemUid}: quantity must be an integer`\n );\n }\n }\n\n // Transform items to snake_case for GraphQL\n const transformedItems = items.map((item) => ({\n quote_item_uid: item.quoteItemUid,\n quantity: item.quantity,\n }));\n\n return fetchGraphQl(UPDATE_NEGOTIABLE_QUOTE_QUANTITIES_MUTATION, {\n variables: {\n quoteUid,\n items: transformedItems,\n },\n }).then((response) => {\n const { errors } = response;\n\n if (errors) {\n // Provide more detailed error information\n const errorMessages = errors.map((error) => error.message).join('; ');\n throw new Error(`Failed to update quote quantities: ${errorMessages}`);\n }\n\n // Transform the quote data\n const quoteData = transformQuote(\n response.data?.updateNegotiableQuoteQuantities?.quote\n );\n\n if (!quoteData) {\n throw new Error(\n 'Failed to transform quote data: Invalid response structure'\n );\n }\n\n // Emit event with transformed quote data on success\n events.emit('quote-management/quantities-updated', {\n quote: quoteData,\n input: { quoteUid, items },\n });\n\n return quoteData;\n });\n};\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { NEGOTIABLE_QUOTE_FRAGMENT } from '@/quote-management/api/graphql/NegotiableQuoteFragment';\n\nexport const REMOVE_NEGOTIABLE_QUOTE_ITEMS_MUTATION = `\n mutation REMOVE_NEGOTIABLE_QUOTE_ITEMS_MUTATION(\n $quoteUid: ID!\n $quoteItemUids: [ID!]!\n ) {\n removeNegotiableQuoteItems(\n input: {\n quote_uid: $quoteUid\n quote_item_uids: $quoteItemUids\n }\n ) {\n quote {\n ...NegotiableQuoteFragment\n }\n }\n }\n ${NEGOTIABLE_QUOTE_FRAGMENT}\n`;\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { fetchGraphQl } from '@/quote-management/api';\nimport { events } from '@adobe-commerce/event-bus';\nimport { state } from '@/quote-management/lib/state';\nimport { NegotiableQuoteModel } from '@/quote-management/data/models/negotiable-quote-model';\nimport { transformQuote } from '@/quote-management/data/transforms';\nimport { REMOVE_NEGOTIABLE_QUOTE_ITEMS_MUTATION } from './graphql/RemoveNegotiableQuoteItemsMutation';\n\nexport interface RemoveNegotiableQuoteItemsInput {\n quoteUid: string;\n quoteItemUids: string[];\n}\n\nexport const removeNegotiableQuoteItems = async (\n input: RemoveNegotiableQuoteItemsInput\n): Promise<NegotiableQuoteModel | null> => {\n if (!state.authenticated) {\n return Promise.reject(new Error('Unauthorized'));\n }\n\n const { quoteUid, quoteItemUids } = input;\n\n if (!quoteUid) {\n throw new Error('Quote UID is required');\n }\n\n if (!Array.isArray(quoteItemUids) || quoteItemUids.length === 0) {\n throw new Error('At least one quote item UID is required');\n }\n\n const response = await fetchGraphQl(REMOVE_NEGOTIABLE_QUOTE_ITEMS_MUTATION, {\n variables: {\n quoteUid,\n quoteItemUids,\n },\n });\n\n const { errors, data } = response;\n\n if (errors?.length) {\n const errorMessages = errors.map((error) => error.message).join('; ');\n throw new Error(\n `Failed to remove negotiable quote items: ${errorMessages}`\n );\n }\n\n const quote = transformQuote(data?.removeNegotiableQuoteItems?.quote);\n\n if (!quote) {\n throw new Error(\n 'Failed to transform quote data: Invalid response structure'\n );\n }\n\n events.emit('quote-management/quote-items-removed', {\n quote,\n removedItemUids: quoteItemUids,\n input,\n });\n\n return quote;\n};\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { NEGOTIABLE_QUOTE_FRAGMENT } from '@/quote-management/api/graphql/NegotiableQuoteFragment';\n\nexport const SET_LINE_ITEM_NOTE_MUTATION = /* GraphQL */ `\n mutation SET_LINE_ITEM_NOTE_MUTATION($input: LineItemNoteInput!) {\n setLineItemNote(input: $input) {\n quote {\n ...NegotiableQuoteFragment\n }\n }\n }\n ${NEGOTIABLE_QUOTE_FRAGMENT}\n`;\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { fetchGraphQl } from '@/quote-management/api';\nimport { events } from '@adobe-commerce/event-bus';\nimport { SET_LINE_ITEM_NOTE_MUTATION } from './graphql/SetLineItemNoteMutation';\nimport { NegotiableQuoteModel } from '@/quote-management/data/models/negotiable-quote-model';\nimport { transformQuote } from '@/quote-management/data/transforms';\nimport { state } from '@/quote-management/lib/state';\n\nexport interface SetLineItemNoteInput {\n quoteUid: string;\n itemUid: string;\n note: string;\n quantity?: number;\n}\n\nexport const setLineItemNote = async (\n input: SetLineItemNoteInput\n): Promise<NegotiableQuoteModel | null> => {\n if (!state.authenticated) {\n throw new Error('Unauthorized');\n }\n\n const { quoteUid, itemUid, note, quantity } = input;\n\n if (!quoteUid) {\n throw new Error('Quote UID is required');\n }\n\n if (!itemUid) {\n throw new Error('Item UID is required');\n }\n\n if (!note) {\n throw new Error('Note is required');\n }\n\n // Build the mutation input\n const mutationInput: any = {\n quote_uid: quoteUid,\n quote_item_uid: itemUid,\n note: note.trim(),\n };\n\n return fetchGraphQl(SET_LINE_ITEM_NOTE_MUTATION, {\n variables: {\n input: mutationInput,\n },\n }).then((response) => {\n const { errors } = response;\n\n if (errors) {\n // Provide more detailed error information\n const errorMessages = errors.map((error) => error.message).join('; ');\n throw new Error(`Failed to set line item note: ${errorMessages}`);\n }\n\n // Transform the quote data\n const quoteData = transformQuote(response.data?.setLineItemNote?.quote);\n\n if (!quoteData) {\n throw new Error(\n 'Failed to transform quote data: Invalid response structure'\n );\n }\n\n // Emit event with transformed quote data on success\n events.emit('quote-management/line-item-note-set', {\n quote: quoteData,\n input: { quoteUid, itemUid, note, quantity },\n });\n\n // Also emit the general quote-data event to update all listeners\n events.emit('quote-management/quote-data', {\n quote: quoteData,\n permissions: state.permissions,\n });\n\n return quoteData;\n });\n};\n"],"names":["UPDATE_NEGOTIABLE_QUOTE_QUANTITIES_MUTATION","NEGOTIABLE_QUOTE_FRAGMENT","updateQuantities","input","state","quoteUid","items","item","transformedItems","fetchGraphQl","response","errors","errorMessages","error","quoteData","transformQuote","_b","_a","events","REMOVE_NEGOTIABLE_QUOTE_ITEMS_MUTATION","removeNegotiableQuoteItems","quoteItemUids","data","quote","SET_LINE_ITEM_NOTE_MUTATION","setLineItemNote","itemUid","note","quantity","mutationInput"],"mappings":"qLAWO,MAAMA,EAA8C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;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,CAAE,SAAAC,EAAU,QAAAqB,EAAS,KAAAC,EAAM,SAAAC,GAAazB,EAE9C,GAAI,CAACE,EACH,MAAM,IAAI,MAAM,uBAAuB,EAGzC,GAAI,CAACqB,EACH,MAAM,IAAI,MAAM,sBAAsB,EAGxC,GAAI,CAACC,EACH,MAAM,IAAI,MAAM,kBAAkB,EAIpC,MAAME,EAAqB,CACzB,UAAWxB,EACX,eAAgBqB,EAChB,KAAMC,EAAK,KAAA,CAAK,EAGlB,OAAOlB,EAAae,EAA6B,CAC/C,UAAW,CACT,MAAOK,CAAA,CACT,CACD,EAAE,KAAMnB,GAAa,SACpB,KAAM,CAAE,OAAAC,GAAWD,EAEnB,GAAIC,EAAQ,CAEV,MAAMC,EAAgBD,EAAO,IAAKE,GAAUA,EAAM,OAAO,EAAE,KAAK,IAAI,EACpE,MAAM,IAAI,MAAM,iCAAiCD,CAAa,EAAE,CAClE,CAGA,MAAME,EAAYC,GAAeC,GAAAC,EAAAP,EAAS,OAAT,YAAAO,EAAe,kBAAf,YAAAD,EAAgC,KAAK,EAEtE,GAAI,CAACF,EACH,MAAM,IAAI,MACR,4DAAA,EAKJ,OAAAI,EAAO,KAAK,sCAAuC,CACjD,MAAOJ,EACP,MAAO,CAAE,SAAAT,EAAU,QAAAqB,EAAS,KAAAC,EAAM,SAAAC,CAAA,CAAS,CAC5C,EAGDV,EAAO,KAAK,8BAA+B,CACzC,MAAOJ,EACP,YAAaV,EAAM,WAAA,CACpB,EAEMU,CACT,CAAC,CACH"}
|
package/chunks/state.js
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/*! Copyright 2025 Adobe
|
|
2
|
+
All Rights Reserved. */
|
|
3
|
+
var a=(e=>(e[e.TAX_EXCLUDED=1]="TAX_EXCLUDED",e[e.TAX_INCLUDED=2]="TAX_INCLUDED",e[e.TAX_INCLUDED_AND_EXCLUDED=3]="TAX_INCLUDED_AND_EXCLUDED",e))(a||{});const l={requestQuote:!1,editQuote:!1,deleteQuote:!1,checkoutQuote:!1,viewQuoteTemplates:!1,manageQuoteTemplates:!1,generateQuoteFromTemplate:!1},u={quoteSummaryDisplayTotal:1,quoteSummaryMaxItems:10,quoteDisplaySettings:{zeroTax:!1,subtotal:a.TAX_INCLUDED,price:a.TAX_INCLUDED,shipping:a.TAX_INCLUDED,fullSummary:!1,grandTotal:!0},useConfigurableParentThumbnail:!0,quoteMinimumAmount:null,quoteMinimumAmountMessage:null},D={authenticated:!1,permissions:l,config:u,initialized:!1,quoteDataLoaded:!1,quoteDataInitialized:!1},r=new Proxy(D,{get:(e,t)=>e[t],set:(e,t,s)=>(e[t]=s,!0)});export{l as D,a as Q,u as a,r as s};
|
|
4
|
+
//# sourceMappingURL=state.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"state.js","sources":["/@dropins/storefront-quote-management/src/data/models/store-config-model.ts","/@dropins/storefront-quote-management/src/lib/state.ts"],"sourcesContent":["/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nexport enum QuoteDisplayAmount {\n TAX_EXCLUDED = 1,\n TAX_INCLUDED = 2,\n TAX_INCLUDED_AND_EXCLUDED = 3,\n}\n\nexport interface StoreConfigModel {\n quoteSummaryDisplayTotal: number;\n quoteSummaryMaxItems: number;\n quoteDisplaySettings: {\n zeroTax: boolean;\n subtotal: QuoteDisplayAmount;\n price: QuoteDisplayAmount;\n shipping: QuoteDisplayAmount;\n fullSummary: boolean;\n grandTotal: boolean;\n };\n useConfigurableParentThumbnail: boolean;\n quoteMinimumAmount: number | null;\n quoteMinimumAmountMessage: string | null;\n}\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport {\n QuoteDisplayAmount,\n StoreConfigModel,\n} from '@/quote-management/data/models';\nimport { State } from '@/quote-management/types/state.types';\n\nexport const DEFAULT_PERMISSIONS = {\n requestQuote: false,\n editQuote: false,\n deleteQuote: false,\n checkoutQuote: false,\n viewQuoteTemplates: false,\n manageQuoteTemplates: false,\n generateQuoteFromTemplate: false,\n};\n\nexport const DEFAULT_CONFIG: StoreConfigModel = {\n quoteSummaryDisplayTotal: 1,\n quoteSummaryMaxItems: 10,\n quoteDisplaySettings: {\n zeroTax: false,\n subtotal: QuoteDisplayAmount.TAX_INCLUDED,\n price: QuoteDisplayAmount.TAX_INCLUDED,\n shipping: QuoteDisplayAmount.TAX_INCLUDED,\n fullSummary: false,\n grandTotal: true,\n },\n useConfigurableParentThumbnail: true,\n quoteMinimumAmount: null,\n quoteMinimumAmountMessage: null,\n};\n\nconst _state: State = {\n authenticated: false,\n permissions: DEFAULT_PERMISSIONS,\n config: DEFAULT_CONFIG,\n initialized: false,\n quoteDataLoaded: false,\n quoteDataInitialized: false,\n};\n\n// Proxy state to make it reactive\nexport const state = new Proxy(_state, {\n get: (target, key) => {\n return target[key as keyof State];\n },\n set: (target, key, value) => {\n target[key as keyof State] = value;\n return true;\n },\n});\n"],"names":["QuoteDisplayAmount","DEFAULT_PERMISSIONS","DEFAULT_CONFIG","_state","state","target","key","value"],"mappings":"AASO,IAAKA,GAAAA,IACVA,EAAAA,EAAA,aAAe,CAAA,EAAf,eACAA,EAAAA,EAAA,aAAe,CAAA,EAAf,eACAA,EAAAA,EAAA,0BAA4B,CAAA,EAA5B,4BAHUA,IAAAA,GAAA,CAAA,CAAA,ECML,MAAMC,EAAsB,CACjC,aAAc,GACd,UAAW,GACX,YAAa,GACb,cAAe,GACf,mBAAoB,GACpB,qBAAsB,GACtB,0BAA2B,EAC7B,EAEaC,EAAmC,CAC9C,yBAA0B,EAC1B,qBAAsB,GACtB,qBAAsB,CACpB,QAAS,GACT,SAAUF,EAAmB,aAC7B,MAAOA,EAAmB,aAC1B,SAAUA,EAAmB,aAC7B,YAAa,GACb,WAAY,EAAA,EAEd,+BAAgC,GAChC,mBAAoB,KACpB,0BAA2B,IAC7B,EAEMG,EAAgB,CACpB,cAAe,GACf,YAAaF,EACb,OAAQC,EACR,YAAa,GACb,gBAAiB,GACjB,qBAAsB,EACxB,EAGaE,EAAQ,IAAI,MAAMD,EAAQ,CACrC,IAAK,CAACE,EAAQC,IACLD,EAAOC,CAAkB,EAElC,IAAK,CAACD,EAAQC,EAAKC,KACjBF,EAAOC,CAAkB,EAAIC,EACtB,GAEX,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/*! Copyright 2025 Adobe
|
|
2
|
+
All Rights Reserved. */
|
|
3
|
+
import{a as _,b as E,c as f}from"./transform-quote.js";var i=(n=>(n.ACTIVE="Active",n.IN_REVIEW="In Review",n.INACTIVE="Inactive",n.SUBMITTED="Submitted",n.PENDING="Pending",n.CLOSED="Closed",n.OPEN="Open",n.UPDATED="Updated",n.EDITED="Edited",n.NEW="New",n.DRAFT="Draft",n.DECLINED="Declined",n.CANCELED="Canceled",n.EXPIRED="Expired",n))(i||{});function l(n){var u,e,s,c;return n?{id:n.template_id,uid:n.uid,name:n.name,createdAt:n.created_at,updatedAt:n.updated_at,expirationDate:n.expiration_date,status:n.status,salesRepName:n.sales_rep_name,buyer:{firstname:n.buyer.firstname,lastname:n.buyer.lastname},comments:(u=n.comments)==null?void 0:u.map(r=>{var o;return{uid:r.uid,createdAt:r.created_at,author:{firstname:r.author.firstname,lastname:r.author.lastname},text:r.text,attachments:(o=r.attachments)==null?void 0:o.map(d=>({name:d.name,url:d.url}))}}),prices:n.prices&&{subtotalExcludingTax:n.prices.subtotal_excluding_tax&&{value:n.prices.subtotal_excluding_tax.value,currency:n.prices.subtotal_excluding_tax.currency},subtotalIncludingTax:n.prices.subtotal_including_tax&&{value:n.prices.subtotal_including_tax.value,currency:n.prices.subtotal_including_tax.currency},subtotalWithDiscountExcludingTax:n.prices.subtotal_with_discount_excluding_tax&&{value:n.prices.subtotal_with_discount_excluding_tax.value,currency:n.prices.subtotal_with_discount_excluding_tax.currency},appliedTaxes:(e=n.prices.applied_taxes)==null?void 0:e.map(r=>({amount:{value:r.amount.value,currency:r.amount.currency},label:r.label})),grandTotal:n.prices.grand_total&&{value:n.prices.grand_total.value,currency:n.prices.grand_total.currency}},history:E(n.history),items:_(n.items),shippingAddresses:(s=n.shipping_addresses)==null?void 0:s.map(r=>({uid:r.uid,firstname:r.firstname,lastname:r.lastname,company:r.company,street:r.street,city:r.city,postcode:r.postcode,country:{code:r.country.code,label:r.country.label},telephone:r.telephone,region:r.region?{code:r.region.code,label:r.region.label,regionId:r.region.region_id}:void 0})),referenceDocuments:(c=n.reference_document_links)==null?void 0:c.map(r=>({uid:r.link_id,name:r.document_name,identifier:r.document_identifier,url:r.reference_document_url})),canAccept:[i.SUBMITTED,i.PENDING,i.OPEN].includes(n.status),canDelete:n.status===i.DRAFT,canReopen:[i.DECLINED,i.CANCELED,i.EXPIRED].includes(n.status),canCancel:[i.SUBMITTED,i.PENDING,i.OPEN,i.ACTIVE,i.EDITED].includes(n.status),canSendForReview:[i.OPEN,i.DRAFT,i.NEW,i.EDITED].includes(n.status),canGenerateQuoteFromTemplate:[i.ACTIVE].includes(n.status),canEditTemplateItems:[i.SUBMITTED,i.DRAFT,i.OPEN,i.EDITED].includes(n.status)}:null}function I(n){var s;if(!n)return null;const u={items:((s=n.items)==null?void 0:s.map(c=>{var r,o,d;return{id:c.template_id,uid:c.uid,name:c.name,createdAt:c.created_at,updatedAt:c.updated_at,status:c.status,state:c.state,prices:{grandTotal:(r=c.prices)!=null&&r.grand_total?{value:c.prices.grand_total.value,currency:c.prices.grand_total.currency}:{value:0,currency:"USD"},minNegotiatedGrandTotal:{value:c.min_negotiated_grand_total,currency:((d=(o=c.prices)==null?void 0:o.grand_total)==null?void 0:d.currency)||"USD"}},lastSharedAt:c.last_shared_at,lastOrderedAt:c.last_ordered_at,expirationDate:c.expiration_date,ordersPlaced:c.orders_placed,canGenerateQuoteFromTemplate:[i.ACTIVE].includes(c.status)}}))||[],pageInfo:{currentPage:n.page_info.current_page,pageSize:n.page_info.page_size,totalPages:n.page_info.total_pages},totalCount:n.total_count,sortFields:n.sort_fields?{default:n.sort_fields.default,options:n.sort_fields.options}:void 0},e=f(u);return{...u,paginationInfo:e||void 0}}export{i as N,l as a,I as t};
|
|
4
|
+
//# sourceMappingURL=transform-quote-template.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transform-quote-template.js","sources":["/@dropins/storefront-quote-management/src/data/models/negotiable-quote-template-model.ts","/@dropins/storefront-quote-management/src/data/transforms/transform-quote-template.ts"],"sourcesContent":["/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport {\n Currency,\n PaginationInfo,\n ShippingAddress,\n NegotiableQuoteHistoryEntry,\n CartItemModel,\n} from './negotiable-quote-model';\n\nexport interface NegotiableQuoteTemplateModel {\n id: string;\n uid: string;\n name: string;\n createdAt: string;\n updatedAt: string;\n expirationDate?: string;\n status: NegotiableQuoteTemplateStatus;\n salesRepName: string;\n buyer: {\n firstname: string;\n lastname: string;\n };\n comments?: QuoteTemplateComment[];\n history?: NegotiableQuoteHistoryEntry[];\n prices: {\n subtotalExcludingTax?: Currency;\n subtotalIncludingTax?: Currency;\n subtotalWithDiscountExcludingTax?: Currency;\n grandTotal?: Currency;\n appliedTaxes?: {\n amount: Currency;\n label: string;\n }[];\n };\n items: CartItemModel[];\n shippingAddresses?: ShippingAddress[];\n referenceDocuments?: {\n uid: string;\n name: string;\n identifier?: string;\n url: string;\n }[];\n // Template-specific fields\n quantityThresholds?: {\n min?: number;\n max?: number;\n };\n canAccept: boolean;\n canDelete: boolean;\n canReopen: boolean;\n canCancel: boolean;\n canSendForReview: boolean;\n canGenerateQuoteFromTemplate: boolean;\n canEditTemplateItems: boolean;\n}\n\nexport enum NegotiableQuoteTemplateStatus {\n ACTIVE = 'Active',\n IN_REVIEW = 'In Review',\n INACTIVE = 'Inactive',\n SUBMITTED = 'Submitted',\n PENDING = 'Pending',\n CLOSED = 'Closed',\n OPEN = 'Open',\n UPDATED = 'Updated',\n EDITED = 'Edited',\n NEW = 'New',\n DRAFT = 'Draft',\n DECLINED = 'Declined',\n CANCELED = 'Canceled',\n EXPIRED = 'Expired',\n}\n\n\nexport interface QuoteTemplateComment {\n uid: string;\n createdAt: string;\n author: {\n firstname: string;\n lastname: string;\n };\n text: string;\n attachments?: {\n name: string;\n url: string;\n }[];\n}\n\n// List model for getQuoteTemplates\nexport interface NegotiableQuoteTemplatesListModel {\n items: NegotiableQuoteTemplateListEntry[];\n pageInfo: {\n currentPage: number;\n pageSize: number;\n totalPages: number;\n };\n totalCount: number;\n paginationInfo?: PaginationInfo;\n sortFields?: {\n default: string;\n options: Array<{\n label: string;\n value: string;\n }>;\n };\n}\n\nexport interface NegotiableQuoteTemplateListEntry {\n id: string;\n uid: string;\n name: string;\n createdAt: string;\n updatedAt: string;\n status: NegotiableQuoteTemplateStatus;\n state: 'active' | 'inactive' | 'in_review';\n lastSharedAt: string;\n lastOrderedAt: string;\n expirationDate: string;\n ordersPlaced: number;\n prices: {\n grandTotal: Currency;\n minNegotiatedGrandTotal: Currency;\n };\n canGenerateQuoteFromTemplate?: boolean;\n}\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport {\n NegotiableQuoteTemplateModel,\n NegotiableQuoteTemplatesListModel,\n NegotiableQuoteTemplateStatus,\n} from '../models/negotiable-quote-template-model';\nimport { transformPaginationInfo } from './transform-quote';\nimport { transformHistory } from './transform-history';\nimport { transformQuoteItems } from './transform-quote-items';\n\nexport function transformQuoteTemplate(\n templateData: any\n): NegotiableQuoteTemplateModel | null {\n if (!templateData) {\n return null;\n }\n\n return {\n id: templateData.template_id,\n uid: templateData.uid,\n name: templateData.name,\n createdAt: templateData.created_at,\n updatedAt: templateData.updated_at,\n expirationDate: templateData.expiration_date,\n status: templateData.status,\n salesRepName: templateData.sales_rep_name,\n buyer: {\n firstname: templateData.buyer.firstname,\n lastname: templateData.buyer.lastname,\n },\n comments: templateData.comments?.map((comment: any) => ({\n uid: comment.uid,\n createdAt: comment.created_at,\n author: {\n firstname: comment.author.firstname,\n lastname: comment.author.lastname,\n },\n text: comment.text,\n attachments: comment.attachments?.map((a: any) => ({\n name: a.name,\n url: a.url,\n })),\n })),\n prices: templateData.prices && {\n subtotalExcludingTax: templateData.prices.subtotal_excluding_tax && {\n value: templateData.prices.subtotal_excluding_tax.value,\n currency: templateData.prices.subtotal_excluding_tax.currency,\n },\n subtotalIncludingTax: templateData.prices.subtotal_including_tax && {\n value: templateData.prices.subtotal_including_tax.value,\n currency: templateData.prices.subtotal_including_tax.currency,\n },\n subtotalWithDiscountExcludingTax: templateData.prices\n .subtotal_with_discount_excluding_tax && {\n value: templateData.prices.subtotal_with_discount_excluding_tax.value,\n currency:\n templateData.prices.subtotal_with_discount_excluding_tax.currency,\n },\n appliedTaxes: templateData.prices.applied_taxes?.map((tax: any) => ({\n amount: { value: tax.amount.value, currency: tax.amount.currency },\n label: tax.label,\n })),\n grandTotal: templateData.prices.grand_total && {\n value: templateData.prices.grand_total.value,\n currency: templateData.prices.grand_total.currency,\n },\n },\n history: transformHistory(templateData.history),\n items: transformQuoteItems(templateData.items),\n shippingAddresses: templateData.shipping_addresses?.map((address: any) => ({\n uid: address.uid,\n firstname: address.firstname,\n lastname: address.lastname,\n company: address.company,\n street: address.street,\n city: address.city,\n postcode: address.postcode,\n country: {\n code: address.country.code,\n label: address.country.label,\n },\n telephone: address.telephone,\n region: address.region\n ? {\n code: address.region.code,\n label: address.region.label,\n regionId: address.region.region_id,\n }\n : undefined,\n })),\n referenceDocuments: templateData.reference_document_links?.map((doc: any) => ({\n uid: doc.link_id,\n name: doc.document_name,\n identifier: doc.document_identifier,\n url: doc.reference_document_url,\n })),\n // Calculate permissions based on status\n canAccept: [\n NegotiableQuoteTemplateStatus.SUBMITTED,\n NegotiableQuoteTemplateStatus.PENDING,\n NegotiableQuoteTemplateStatus.OPEN,\n ].includes(templateData.status),\n canDelete: templateData.status === NegotiableQuoteTemplateStatus.DRAFT,\n canReopen: [\n NegotiableQuoteTemplateStatus.DECLINED,\n NegotiableQuoteTemplateStatus.CANCELED,\n NegotiableQuoteTemplateStatus.EXPIRED,\n ].includes(templateData.status),\n canCancel: [\n NegotiableQuoteTemplateStatus.SUBMITTED,\n NegotiableQuoteTemplateStatus.PENDING,\n NegotiableQuoteTemplateStatus.OPEN,\n NegotiableQuoteTemplateStatus.ACTIVE,\n NegotiableQuoteTemplateStatus.EDITED,\n ].includes(templateData.status),\n canSendForReview: [\n NegotiableQuoteTemplateStatus.OPEN,\n NegotiableQuoteTemplateStatus.DRAFT,\n NegotiableQuoteTemplateStatus.NEW,\n NegotiableQuoteTemplateStatus.EDITED,\n ].includes(templateData.status),\n canGenerateQuoteFromTemplate: [\n NegotiableQuoteTemplateStatus.ACTIVE,\n ].includes(templateData.status),\n canEditTemplateItems: [\n NegotiableQuoteTemplateStatus.SUBMITTED,\n NegotiableQuoteTemplateStatus.DRAFT,\n NegotiableQuoteTemplateStatus.OPEN,\n NegotiableQuoteTemplateStatus.EDITED,\n ].includes(templateData.status),\n };\n}\n\nexport function transformQuoteTemplatesList(\n templatesData: any\n): NegotiableQuoteTemplatesListModel | null {\n if (!templatesData) {\n return null;\n }\n\n const transformedModel = {\n items:\n templatesData.items?.map((template: any) => ({\n id: template.template_id,\n uid: template.uid,\n name: template.name,\n createdAt: template.created_at,\n updatedAt: template.updated_at,\n status: template.status,\n state: template.state,\n prices: {\n grandTotal: template.prices?.grand_total\n ? {\n value: template.prices.grand_total.value,\n currency: template.prices.grand_total.currency,\n }\n : {\n value: 0,\n currency: 'USD',\n },\n minNegotiatedGrandTotal: {\n value: template.min_negotiated_grand_total,\n currency: template.prices?.grand_total?.currency || 'USD',\n },\n },\n lastSharedAt: template.last_shared_at,\n lastOrderedAt: template.last_ordered_at,\n expirationDate: template.expiration_date,\n ordersPlaced: template.orders_placed,\n canGenerateQuoteFromTemplate: [\n NegotiableQuoteTemplateStatus.ACTIVE,\n ].includes(template.status),\n })) || [],\n pageInfo: {\n currentPage: templatesData.page_info.current_page,\n pageSize: templatesData.page_info.page_size,\n totalPages: templatesData.page_info.total_pages,\n },\n totalCount: templatesData.total_count,\n sortFields: templatesData.sort_fields\n ? {\n default: templatesData.sort_fields.default,\n options: templatesData.sort_fields.options,\n }\n : undefined,\n };\n\n // Calculate pagination info\n const paginationInfo = transformPaginationInfo(transformedModel);\n\n return {\n ...transformedModel,\n paginationInfo: paginationInfo || undefined,\n };\n}\n"],"names":["NegotiableQuoteTemplateStatus","transformQuoteTemplate","templateData","_a","comment","a","_b","tax","transformHistory","transformQuoteItems","_c","address","_d","doc","transformQuoteTemplatesList","templatesData","transformedModel","template","paginationInfo","transformPaginationInfo"],"mappings":"uDAgEO,IAAKA,GAAAA,IACVA,EAAA,OAAS,SACTA,EAAA,UAAY,YACZA,EAAA,SAAW,WACXA,EAAA,UAAY,YACZA,EAAA,QAAU,UACVA,EAAA,OAAS,SACTA,EAAA,KAAO,OACPA,EAAA,QAAU,UACVA,EAAA,OAAS,SACTA,EAAA,IAAM,MACNA,EAAA,MAAQ,QACRA,EAAA,SAAW,WACXA,EAAA,SAAW,WACXA,EAAA,QAAU,UAdAA,IAAAA,GAAA,CAAA,CAAA,EC9CL,SAASC,EACdC,EACqC,aACrC,OAAKA,EAIE,CACL,GAAIA,EAAa,YACjB,IAAKA,EAAa,IAClB,KAAMA,EAAa,KACnB,UAAWA,EAAa,WACxB,UAAWA,EAAa,WACxB,eAAgBA,EAAa,gBAC7B,OAAQA,EAAa,OACrB,aAAcA,EAAa,eAC3B,M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AAMA,EAAS,KACf,UAAWA,EAAS,WACpB,UAAWA,EAAS,WACpB,OAAQA,EAAS,OACjB,MAAOA,EAAS,MAChB,OAAQ,CACN,YAAYd,EAAAc,EAAS,SAAT,MAAAd,EAAiB,YACzB,CACE,MAAOc,EAAS,OAAO,YAAY,MACnC,SAAUA,EAAS,OAAO,YAAY,QAAA,EAExC,CACE,MAAO,EACP,SAAU,KAAA,EAEhB,wBAAyB,CACvB,MAAOA,EAAS,2BAChB,WAAUP,GAAAJ,EAAAW,EAAS,SAAT,YAAAX,EAAiB,cAAjB,YAAAI,EAA8B,WAAY,KAAA,CACtD,EAEF,aAAcO,EAAS,eACvB,cAAeA,EAAS,gBACxB,eAAgBA,EAAS,gBACzB,aAAcA,EAAS,cACvB,6BAA8B,CAC5BjB,EAA8B,MAAA,EAC9B,SAASiB,EAAS,MAAM,CAAA,MACrB,CAAA,EACT,SAAU,CACR,YAAaF,EAAc,UAAU,aACrC,SAAUA,EAAc,UAAU,UAClC,WAAYA,EAAc,UAAU,WAAA,EAEtC,WAAYA,EAAc,YAC1B,WAAYA,EAAc,YACtB,CACE,QAASA,EAAc,YAAY,QACnC,QAASA,EAAc,YAAY,OAAA,EAErC,MAAA,EAIAG,EAAiBC,EAAwBH,CAAgB,EAE/D,MAAO,CACL,GAAGA,EACH,eAAgBE,GAAkB,MAAA,CAEtC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/*! Copyright 2025 Adobe
|
|
2
|
+
All Rights Reserved. */
|
|
3
|
+
import{FetchGraphQL as b}from"@dropins/tools/fetch-graphql.js";import{s as _}from"./state.js";var d=(e=>(e.NEW="NEW",e.SUBMITTED="SUBMITTED",e.PENDING="PENDING",e.UPDATED="UPDATED",e.OPEN="OPEN",e.ORDERED="ORDERED",e.CLOSED="CLOSED",e.DECLINED="DECLINED",e.EXPIRED="EXPIRED",e.DRAFT="DRAFT",e))(d||{});const{setEndpoint:L,setFetchGraphQlHeader:M,removeFetchGraphQlHeader:B,setFetchGraphQlHeaders:G,fetchGraphQl:z,getConfig:H}=new b().getMethods();function h(e){var a,r,c,i,u,s,o;return{uid:e.uid,createdAt:e.created_at,author:{firstname:e.author.firstname,lastname:e.author.lastname},changeType:e.change_type,changes:{commentAdded:((a=e.changes)==null?void 0:a.comment_added)&&{comment:e.changes.comment_added.comment},customChanges:((r=e.changes)==null?void 0:r.custom_changes)&&{new_value:e.changes.custom_changes.new_value,old_value:e.changes.custom_changes.old_value,title:e.changes.custom_changes.title},expiration:((c=e.changes)==null?void 0:c.expiration)&&{newExpiration:e.changes.expiration.new_expiration,oldExpiration:e.changes.expiration.old_expiration},productsRemoved:((i=e.changes)==null?void 0:i.products_removed)&&{productsRemovedFromCatalog:e.changes.products_removed.products_removed_from_catalog||[],productsRemovedFromQuote:e.changes.products_removed.products_removed_from_quote||[]},statuses:((u=e.changes)==null?void 0:u.statuses)&&{changes:((s=e.changes.statuses.changes)==null?void 0:s.map(l=>({newStatus:l==null?void 0:l.new_status,oldStatus:l==null?void 0:l.old_status})))||[]},total:((o=e.changes)==null?void 0:o.total)&&e.changes.total.new_price&&e.changes.total.old_price&&{newPrice:{value:e.changes.total.new_price.value,currency:e.changes.total.new_price.currency},oldPrice:{value:e.changes.total.old_price.value,currency:e.changes.total.old_price.currency}}}}}function y(e){if(e)return e.map(h)}function v(e,a){return e!=null&&e.length&&[...e].sort((c,i)=>i.quantity-c.quantity).find(c=>a>=c.quantity)||null}function T(e){var r,c,i,u;const a=_.config;return{src:a!=null&&a.useConfigurableParentThumbnail?e.product.thumbnail.url:((c=(r=e.configured_variant)==null?void 0:r.thumbnail)==null?void 0:c.url)||e.product.thumbnail.url,alt:a!=null&&a.useConfigurableParentThumbnail?e.product.thumbnail.label:((u=(i=e.configured_variant)==null?void 0:i.thumbnail)==null?void 0:u.label)||e.product.thumbnail.label}}function I(e){var a;return((a=e.links)==null?void 0:a.length)>0?{count:e.links.length,result:e.links.map(r=>r.title).join(", ")}:null}function D(e){var s,o,l,t;const a=e.quantity,r=e.__typename==="ConfigurableCartItem",c=r?(s=e.configured_variant)==null?void 0:s.price_tiers:e.product.price_tiers,i=r?(o=e.configured_variant)==null?void 0:o.price_range:e.product.price_range,u=v(c,a);return u?u.discount.amount_off>0:(((t=(l=i==null?void 0:i.maximum_price)==null?void 0:l.discount)==null?void 0:t.amount_off)??0)>0}function E(e){var i,u,s,o,l,t,n,p;const a=e.quantity,r=v(e.product.price_tiers,a);if(r)return Math.round(r.discount.percent_off);let c;if(e.__typename==="ConfigurableCartItem")c=(o=(s=(u=(i=e==null?void 0:e.configured_variant)==null?void 0:i.price_range)==null?void 0:u.maximum_price)==null?void 0:s.discount)==null?void 0:o.percent_off;else{if(e.__typename==="BundleCartItem")return;c=(p=(n=(t=(l=e==null?void 0:e.product)==null?void 0:l.price_range)==null?void 0:t.maximum_price)==null?void 0:n.discount)==null?void 0:p.percent_off}if(c!==0)return Math.round(c)}function P(e){var a,r,c,i;return e.__typename==="ConfigurableCartItem"?{value:(r=(a=e.configured_variant)==null?void 0:a.price_range)==null?void 0:r.maximum_price.regular_price.value,currency:(i=(c=e.configured_variant)==null?void 0:c.price_range)==null?void 0:i.maximum_price.regular_price.currency}:{value:e.prices.original_item_price.value,currency:e.prices.original_item_price.currency}}function w(e){var c,i,u,s,o,l;let a,r;if(a=((i=(c=e==null?void 0:e.prices)==null?void 0:c.original_row_total)==null?void 0:i.value)-((s=(u=e==null?void 0:e.prices)==null?void 0:u.row_total)==null?void 0:s.value),r=(l=(o=e==null?void 0:e.prices)==null?void 0:o.row_total)==null?void 0:l.currency,a!==0)return{value:a,currency:r}}function C(e){var a,r,c,i,u,s,o,l;return{itemType:e.__typename,uid:e.uid,product:{uid:e.product.uid,sku:e.product.sku,name:e.product.name,priceRange:{maximumPrice:{regularPrice:{value:e.product.price_range.maximum_price.regular_price.value,currency:e.product.price_range.maximum_price.regular_price.currency}}}},image:T(e),links:I(e),discounted:D(e),discountedTotal:{value:e.prices.row_total.value,currency:e.prices.row_total.currency},catalogDiscount:{amountOff:e.prices.catalog_discount.amount_off,percentOff:e.prices.catalog_discount.percent_off},discounts:((r=(a=e.prices)==null?void 0:a.discounts)==null?void 0:r.map(t=>({label:t.label,value:t.value,amount:{value:t.amount.value,currency:t.amount.currency}})))??[],discountPercentage:E(e),insufficientQuantity:(e.__typename==="ConfigurableCartItem"?((c=e.configured_variant)==null?void 0:c.stock_status)??e.product.stock_status:e.product.stock_status)==="IN_STOCK"&&!e.is_available,outOfStock:e.product.stock_status==="OUT_OF_STOCK",stockStatus:e.product.stock_status,quantity:e.quantity,prices:{regularPrice:P(e),priceIncludingTax:{value:e.prices.price_including_tax.value,currency:e.prices.price_including_tax.currency},originalItemPrice:{value:e.prices.original_item_price.value,currency:e.prices.original_item_price.currency},originalRowTotal:{value:e.prices.original_row_total.value,currency:e.prices.original_row_total.currency},rowTotal:{value:e.prices.row_total.value,currency:e.prices.row_total.currency},rowTotalIncludingTax:{value:e.prices.row_total_including_tax.value,currency:e.prices.row_total_including_tax.currency}},savingsAmount:w(e),noteFromBuyer:(i=e.note_from_buyer)==null?void 0:i.map(t=>({createdAt:t.created_at,creatorId:t.creator_id,creatorType:t.creator_type,negotiableQuoteItemUid:t.negotiable_quote_item_uid,note:t.note,noteUid:t.note_uid})),noteFromSeller:(u=e.note_from_seller)==null?void 0:u.map(t=>({createdAt:t.created_at,creatorId:t.creator_id,creatorType:t.creator_type,negotiableQuoteItemUid:t.negotiable_quote_item_uid,note:t.note,noteUid:t.note_uid})),configurableOptions:(s=e.configurable_options)==null?void 0:s.map(t=>({optionLabel:t.option_label,valueLabel:t.value_label})),bundleOptions:(o=e.bundle_options)==null?void 0:o.map(t=>({label:t.label,values:t.values.map(n=>({label:n.label,quantity:n.quantity,originalPrice:{value:n.original_price.value,currency:n.original_price.currency},price:{value:n.priceV2.value,currency:n.priceV2.currency}}))})),customizableOptions:(l=e.customizable_options)==null?void 0:l.map(t=>({type:t.type,label:t.label,values:t.values.map(n=>({label:n.label,value:n.value}))}))}}function A(e){return e?e.map(C):[]}const f=["DRAFT","UPDATED","DECLINED","EXPIRED","NEW","OPEN"];function O(e){if(!e.items)return 0;const a=_.config;return(a==null?void 0:a.quoteSummaryDisplayTotal)===0?e.items.length:(a==null?void 0:a.quoteSummaryDisplayTotal)===1?e.total_quantity:e.items.length}function R(e){return e.every(a=>!a.outOfStock&&!a.insufficientQuantity)}function S(e){var i,u,s,o,l,t;const a=x(e),r=!!((i=e.template_name)!=null&&i.trim()),c=A(e.items);return{uid:e.uid,name:e.name,createdAt:e.created_at,updatedAt:e.updated_at,expirationDate:e.expiration_date,status:a?d.NEW:e.status,isVirtual:!!e.is_virtual,salesRepName:e.sales_rep_name,buyer:{firstname:e.buyer.firstname,lastname:e.buyer.lastname},email:e.email,templateName:e.template_name,totalQuantity:O(e),comments:(u=e.comments)==null?void 0:u.map(n=>{const p={uid:n.uid,createdAt:n.created_at,author:{firstname:n.author.firstname,lastname:n.author.lastname},text:n.text};return Array.isArray(n.attachments)&&n.attachments.length>0&&(p.attachments=n.attachments.map(g=>({name:g.name,url:g.url}))),p}),prices:e.prices&&{appliedDiscounts:(s=e.prices.discounts)==null?void 0:s.map(n=>({amount:{value:n.amount.value,currency:n.amount.currency},label:n.label,coupon:n.coupon})),appliedTaxes:(o=e.prices.applied_taxes)==null?void 0:o.map(n=>({amount:{value:n.amount.value,currency:n.amount.currency},label:n.label})),discount:e.prices.discounts&&e.prices.grand_total&&m(e.prices.discounts,e.prices.grand_total.currency),grandTotal:e.prices.grand_total&&{value:e.prices.grand_total.value,currency:e.prices.grand_total.currency},grandTotalExcludingTax:e.prices.grand_total_excluding_tax&&{value:e.prices.grand_total_excluding_tax.value,currency:e.prices.grand_total_excluding_tax.currency},subtotalExcludingTax:e.prices.subtotal_excluding_tax&&{value:e.prices.subtotal_excluding_tax.value,currency:e.prices.subtotal_excluding_tax.currency},subtotalIncludingTax:e.prices.subtotal_including_tax&&{value:e.prices.subtotal_including_tax.value,currency:e.prices.subtotal_including_tax.currency},subtotalWithDiscountExcludingTax:e.prices.subtotal_with_discount_excluding_tax&&{value:e.prices.subtotal_with_discount_excluding_tax.value,currency:e.prices.subtotal_with_discount_excluding_tax.currency},...Q(e),totalTax:e.prices.applied_taxes&&e.prices.grand_total&&m(e.prices.applied_taxes,e.prices.grand_total.currency)},history:y(e.history),items:c,shippingAddresses:(l=e.shipping_addresses)==null?void 0:l.map(n=>{const p={uid:n.uid,firstname:n.firstname,lastname:n.lastname,company:n.company,street:n.street,city:n.city,postcode:n.postcode,country:{code:n.country.code,label:n.country.label},telephone:n.telephone};return n.region&&(p.region={code:n.region.code,label:n.region.label,regionId:n.region.region_id}),p}),canCheckout:["UPDATED","DECLINED"].includes(e.status)&&_.permissions.checkoutQuote&&((t=e.shipping_addresses)==null?void 0:t.length)>0&&R(c),canSendForReview:!r&&(a||f.includes(e.status))&&_.permissions.editQuote,canUpdateQuote:!r&&(a||f.includes(e.status))&&_.permissions.editQuote,canDelete:!r&&!["PENDING","SUBMITTED","ORDERED"].includes(e.status)&&_.permissions.deleteQuote,canClose:e.status?!r&&!["DRAFT","CLOSED","ORDERED","OPEN"].includes(e.status):!1,readOnly:r||!a&&["ORDERED","SUBMITTED","CLOSED","PENDING"].includes(e.status)||!_.permissions.editQuote}}function W(e){return e?S(e):null}function x(e){return e.status==="SUBMITTED"&&!(e.history??[]).some(a=>{var r,c;return a.change_type==="UPDATED"&&(((c=(r=a.changes)==null?void 0:r.statuses)==null?void 0:c.changes)??[]).length>0})}function N(e){const a=x(e);return{uid:e.uid,name:e.name,createdAt:e.created_at,updatedAt:e.updated_at,status:a?d.NEW:e.status,buyer:{firstname:e.buyer.firstname,lastname:e.buyer.lastname},templateName:e.template_name,prices:{grandTotal:{value:e.prices.grand_total.value,currency:e.prices.grand_total.currency}}}}function V(e){var c;if(!e)return null;const a={items:((c=e.items)==null?void 0:c.filter(i=>i==null?void 0:i.uid).map(N))||[],pageInfo:{currentPage:e.page_info.current_page,pageSize:e.page_info.page_size,totalPages:e.page_info.total_pages},totalCount:e.total_count,sortFields:e.sort_fields?{default:e.sort_fields.default,options:e.sort_fields.options}:void 0},r=k(a);return{...a,paginationInfo:r||void 0}}function k(e){if(!(e!=null&&e.pageInfo)||!e.totalCount)return null;const{currentPage:a,pageSize:r,totalPages:c}=e.pageInfo,{totalCount:i}=e,u=i>0?(a-1)*r+1:0,s=Math.min(a*r,i);return{currentPage:a,totalCount:i,pageSize:r,startItem:u,endItem:s,totalPages:c,pageSizeOptions:[20,30,50,100,200]}}const X=()=>[20,30,50,100,200];function m(e,a){return e!=null&&e.length?e.reduce((r,c)=>({value:r.value+c.amount.value,currency:c.amount.currency}),{value:0,currency:a}):{value:0,currency:a}}function Q(e){var c;if(!e||!((c=e.shipping_addresses)!=null&&c.length))return{};const r=e.shipping_addresses[0].selected_shipping_method;return r?{shippingIncludingTax:r.price_incl_tax&&{value:r.price_incl_tax.value,currency:r.price_incl_tax.currency},shippingExcludingTax:r.price_excl_tax&&{value:r.price_excl_tax.value,currency:r.price_excl_tax.currency}}:{}}export{A as a,y as b,k as c,V as d,M as e,z as f,X as g,G as h,H as i,B as r,L as s,W as t};
|
|
4
|
+
//# sourceMappingURL=transform-quote.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transform-quote.js","sources":["/@dropins/storefront-quote-management/src/data/models/negotiable-quote-model.ts","/@dropins/storefront-quote-management/src/api/fetch-graphql/fetch-graphql.ts","/@dropins/storefront-quote-management/src/data/transforms/transform-history.ts","/@dropins/storefront-quote-management/src/data/transforms/transform-quote-items.ts","/@dropins/storefront-quote-management/src/data/transforms/transform-quote.ts"],"sourcesContent":["/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nexport interface ShippingAddress {\n /**\n * The unique string identifier of the address\n */\n uid?: string;\n firstname: string;\n lastname: string;\n company?: string;\n street: string[];\n city: string;\n region?: {\n code: string;\n label: string;\n regionId: number;\n };\n postcode: string;\n country: {\n code: string;\n label: string;\n };\n telephone: string;\n}\n\nexport interface NegotiableQuoteModel {\n uid: string;\n name: string;\n createdAt: string;\n salesRepName: string;\n expirationDate: string;\n updatedAt: string;\n status: NegotiableQuoteStatus;\n isVirtual: boolean;\n buyer: {\n firstname: string;\n lastname: string;\n };\n email?: string;\n templateName?: string;\n totalQuantity: number;\n comments?: {\n uid: string;\n createdAt: string;\n author: {\n firstname: string;\n lastname: string;\n };\n text: string;\n attachments?: {\n name: string;\n url: string;\n }[];\n }[];\n history?: NegotiableQuoteHistoryEntry[];\n prices: {\n appliedDiscounts?: Discount[];\n appliedTaxes?: Tax[];\n discount?: Currency;\n grandTotal?: Currency;\n grandTotalExcludingTax?: Currency;\n shippingExcludingTax?: Currency;\n shippingIncludingTax?: Currency;\n subtotalExcludingTax?: Currency;\n subtotalIncludingTax?: Currency;\n subtotalWithDiscountExcludingTax?: Currency;\n totalTax?: Currency;\n };\n items: CartItemModel[];\n shippingAddresses?: ShippingAddress[];\n canCheckout: boolean;\n canSendForReview: boolean;\n lockedForEditing?: boolean;\n canDelete: boolean;\n canClose: boolean;\n canUpdateQuote: boolean;\n readOnly: boolean;\n}\n\nexport interface ConfigurableOption {\n optionLabel: string;\n valueLabel: string;\n}\n\nexport interface BundleOption {\n label: string;\n values: {\n label: string;\n quantity: number;\n originalPrice: Currency;\n price: Currency;\n }[];\n}\n\nexport interface CustomizableOption {\n type: string;\n label: string;\n values: {\n label: string;\n value: string;\n }[];\n}\n\nexport interface CartItemModel {\n itemType: string;\n uid: string;\n product: {\n uid: string;\n sku: string;\n name: string;\n templateId?: string;\n templateName?: string;\n priceRange: {\n maximumPrice: {\n regularPrice: Currency;\n };\n };\n };\n image: ItemImage;\n links?: ItemLinks;\n discounted: boolean;\n discountedTotal: Currency;\n catalogDiscount: {\n amountOff: number;\n percentOff: number;\n };\n discounts: {\n label: string;\n value: string;\n amount: Currency;\n }[];\n discountPercentage?: number;\n insufficientQuantity?: boolean;\n outOfStock?: boolean;\n stockStatus: string;\n quantity: number;\n prices: {\n regularPrice: Currency;\n priceIncludingTax: Currency;\n originalItemPrice: Currency;\n originalRowTotal: Currency;\n rowTotal: Currency;\n rowTotalIncludingTax: Currency;\n };\n savingsAmount?: Currency;\n configurableOptions?: ConfigurableOption[];\n bundleOptions?: BundleOption[];\n customizableOptions?: CustomizableOption[];\n noteFromBuyer?: ItemNote[];\n noteFromSeller?: ItemNote[];\n}\n\ninterface ItemImage {\n src: string;\n alt: string;\n}\n\ninterface ItemLinks {\n count: number;\n result: string;\n}\n\nexport interface ItemNote {\n createdAt: string;\n creatorId: number;\n creatorType: number;\n negotiableQuoteItemUid: string;\n note: string;\n noteUid: string;\n}\n\nexport interface Currency {\n value: number;\n currency: string;\n}\n\nexport interface Tax {\n amount: Currency;\n label: string;\n}\n\nexport interface Discount {\n amount: Currency;\n label: string;\n coupon?: Coupon;\n}\n\nexport interface Coupon {\n code: string;\n}\n\nexport interface NegotiableQuoteListEntry {\n uid: string;\n name: string;\n createdAt: string;\n updatedAt: string;\n status: NegotiableQuoteStatus;\n buyer: {\n firstname: string;\n lastname: string;\n };\n templateName: string;\n prices: {\n grandTotal: Currency;\n };\n}\nexport interface NegotiableQuotesListModel {\n items: NegotiableQuoteListEntry[];\n pageInfo: {\n currentPage: number;\n pageSize: number;\n totalPages: number;\n };\n totalCount: number;\n paginationInfo?: PaginationInfo;\n sortFields?: {\n default: string;\n options: Array<{\n label: string;\n value: string;\n }>;\n };\n}\n\nexport interface NegotiableQuoteHistoryEntry {\n author: {\n firstname: string;\n lastname: string;\n };\n changeType: NegotiableQuoteHistoryEntryChangeType;\n changes: {\n commentAdded?: {\n comment: string;\n };\n customChanges?: {\n new_value: string;\n old_value: string;\n title: string;\n };\n expiration?: {\n newExpiration: string;\n oldExpiration: string;\n };\n productsRemoved?: {\n productsRemovedFromCatalog: string[];\n productsRemovedFromQuote?: {\n uid: string;\n name: string;\n sku: string;\n quantity: number;\n }[];\n };\n statuses?: {\n changes: {\n newStatus: string;\n oldStatus: string;\n }[];\n };\n total?: {\n newPrice: Currency;\n oldPrice: Currency;\n };\n };\n createdAt: string;\n uid: string;\n}\n\nexport enum NegotiableQuoteHistoryEntryChangeType {\n CREATED = 'CREATED',\n UPDATED = 'UPDATED',\n CLOSED = 'CLOSED',\n UPDATED_BY_SYSTEM = 'UPDATED_BY_SYSTEM',\n}\n\n// See: https://experienceleague.adobe.com/en/docs/commerce-admin/b2b/quotes/quotes#quote-status\nexport enum NegotiableQuoteStatus {\n NEW = 'NEW', // Currently not returned by the API, but is used to indicate a new quote\n SUBMITTED = 'SUBMITTED',\n PENDING = 'PENDING',\n UPDATED = 'UPDATED',\n OPEN = 'OPEN',\n ORDERED = 'ORDERED',\n CLOSED = 'CLOSED',\n DECLINED = 'DECLINED',\n EXPIRED = 'EXPIRED',\n DRAFT = 'DRAFT',\n}\n\nexport interface PaginationInfo {\n currentPage: number;\n totalCount: number;\n pageSize: number;\n startItem: number;\n endItem: number;\n totalPages: number;\n pageSizeOptions?: number[];\n}\n","import { FetchGraphQL } from '@adobe-commerce/fetch-graphql';\n\nexport const {\n setEndpoint,\n setFetchGraphQlHeader,\n removeFetchGraphQlHeader,\n setFetchGraphQlHeaders,\n fetchGraphQl,\n getConfig,\n} = new FetchGraphQL().getMethods();\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { NegotiableQuoteHistoryEntry, NegotiableQuoteHistoryEntryChangeType } from '../models/negotiable-quote-model';\n\n/**\n * Transforms a history entry from the API format to the model format\n * @param historyEntry - Raw history entry from API\n * @returns Transformed history entry\n */\nexport function transformHistoryEntry(\n historyEntry: any\n): NegotiableQuoteHistoryEntry {\n return {\n uid: historyEntry.uid,\n createdAt: historyEntry.created_at,\n author: {\n firstname: historyEntry.author.firstname,\n lastname: historyEntry.author.lastname,\n },\n changeType: historyEntry.change_type as NegotiableQuoteHistoryEntryChangeType,\n changes: {\n commentAdded: historyEntry.changes?.comment_added && {\n comment: historyEntry.changes.comment_added.comment,\n },\n customChanges: historyEntry.changes?.custom_changes && {\n new_value: historyEntry.changes.custom_changes.new_value,\n old_value: historyEntry.changes.custom_changes.old_value,\n title: historyEntry.changes.custom_changes.title,\n },\n expiration: historyEntry.changes?.expiration && {\n newExpiration: historyEntry.changes.expiration.new_expiration,\n oldExpiration: historyEntry.changes.expiration.old_expiration,\n },\n productsRemoved: historyEntry.changes?.products_removed && {\n productsRemovedFromCatalog:\n historyEntry.changes.products_removed.products_removed_from_catalog ||\n [],\n productsRemovedFromQuote:\n historyEntry.changes.products_removed.products_removed_from_quote ||\n [],\n },\n statuses: historyEntry.changes?.statuses && {\n changes:\n historyEntry.changes.statuses.changes?.map((change: any) => ({\n newStatus: change?.new_status,\n oldStatus: change?.old_status,\n })) || [],\n },\n total:\n historyEntry.changes?.total &&\n historyEntry.changes.total.new_price &&\n historyEntry.changes.total.old_price && {\n newPrice: {\n value: historyEntry.changes.total.new_price.value,\n currency: historyEntry.changes.total.new_price.currency,\n },\n oldPrice: {\n value: historyEntry.changes.total.old_price.value,\n currency: historyEntry.changes.total.old_price.currency,\n },\n },\n },\n };\n}\n\n/**\n * Transforms an array of history entries from the API format to the model format\n * @param historyEntries - Array of raw history entries from API\n * @returns Array of transformed history entries\n */\nexport function transformHistory(\n historyEntries: any[] | null | undefined\n): NegotiableQuoteHistoryEntry[] | undefined {\n if (!historyEntries) {\n return undefined;\n }\n\n return historyEntries.map(transformHistoryEntry);\n}\n\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { CartItemModel } from '../models/negotiable-quote-model';\nimport { state } from '@/quote-management/lib/state';\n\n/**\n * Finds the most applicable price tier for a given quantity\n * @param priceTiers - Array of price tier objects\n * @param quantity - Current item quantity\n * @returns The applicable tier or null if none found\n */\nfunction findApplicablePriceTier(priceTiers: any[], quantity: number) {\n if (!priceTiers?.length) return null;\n\n // Sort price tiers by quantity in descending order to find the highest applicable tier\n const sortedTiers = [...priceTiers].sort(\n (a: any, b: any) => b.quantity - a.quantity\n );\n\n // Find the highest tier where the current quantity meets or exceeds the tier's minimum quantity\n return sortedTiers.find((tier: any) => quantity >= tier.quantity) || null;\n}\n\n/**\n * Helper function to get the image for a cart item component\n * @param item - Cart item from API\n * @returns Image object with src and alt\n */\nfunction getImage(item: any) {\n const config = state.config;\n\n return {\n // Use parent thumbnail if configured, otherwise use own variant. Use the parent thumbnail as a fallback\n src: config?.useConfigurableParentThumbnail\n ? item.product.thumbnail.url\n : item.configured_variant?.thumbnail?.url || item.product.thumbnail.url,\n alt: config?.useConfigurableParentThumbnail\n ? item.product.thumbnail.label\n : item.configured_variant?.thumbnail?.label ||\n item.product.thumbnail.label,\n };\n}\n\n/**\n * Helper function to get downloadable links for a cart item component\n * @param item - Cart item from API\n * @returns Links object with count and result, or null if no links\n */\nfunction getLinks(item: any) {\n return item.links?.length > 0\n ? {\n count: item.links.length,\n result: item.links.map((link: any) => link.title).join(', '),\n }\n : null;\n}\n\n/**\n * Helper function to check if an item is discounted\n * @param item - Cart item from API\n * @returns True if the item has a discount\n */\nfunction getDiscounted(item: any) {\n const quantity = item.quantity;\n const isConfigurable = item.__typename === 'ConfigurableCartItem';\n\n // Get price tiers and price range based on item type\n const priceTiers = isConfigurable\n ? item.configured_variant?.price_tiers\n : item.product.price_tiers;\n const priceRange = isConfigurable\n ? item.configured_variant?.price_range\n : item.product.price_range;\n\n // Check price tiers first for discount eligibility\n const applicableTier = findApplicablePriceTier(priceTiers, quantity);\n if (applicableTier) {\n return applicableTier.discount.amount_off > 0;\n }\n\n // Fallback to regular price range discount\n return (priceRange?.maximum_price?.discount?.amount_off ?? 0) > 0;\n}\n\n/**\n * Helper function to get the discount percentage of an item\n * @param item - Cart item from API\n * @returns Discount percentage rounded to nearest integer, or undefined if no discount\n */\nfunction getDiscountPercentage(item: any) {\n const quantity = item.quantity;\n\n // Check price tiers first for discount percentage\n const applicableTier = findApplicablePriceTier(\n item.product.price_tiers,\n quantity\n );\n\n if (applicableTier) {\n return Math.round(applicableTier.discount.percent_off);\n }\n\n // Fallback to product-specific discount percentage\n let percent_off;\n\n if (item.__typename === 'ConfigurableCartItem') {\n percent_off =\n item?.configured_variant?.price_range?.maximum_price?.discount\n ?.percent_off;\n } else if (item.__typename === 'BundleCartItem') {\n return undefined;\n } else {\n percent_off =\n item?.product?.price_range?.maximum_price?.discount?.percent_off;\n }\n\n if (percent_off === 0) {\n return undefined;\n }\n\n return Math.round(percent_off);\n}\n\n/**\n * Helper function to get the regular price of an item\n * @param item - Cart item from API\n * @returns Regular price object with value and currency\n */\nfunction getRegularPrice(item: any) {\n if (item.__typename === 'ConfigurableCartItem') {\n return {\n value:\n item.configured_variant?.price_range?.maximum_price.regular_price.value,\n currency:\n item.configured_variant?.price_range?.maximum_price.regular_price\n .currency,\n };\n }\n return {\n value: item.prices.original_item_price.value,\n currency: item.prices.original_item_price.currency,\n };\n}\n\n/**\n * Helper function to get the savings amount of an item\n * @param item - Cart item from API\n * @returns Savings amount object with value and currency, or undefined if no savings\n */\nfunction getSavingsAmount(item: any) {\n let amount_off;\n let currency;\n\n amount_off =\n item?.prices?.original_row_total?.value - item?.prices?.row_total?.value;\n currency = item?.prices?.row_total?.currency;\n\n if (amount_off === 0) {\n return undefined;\n }\n return {\n value: amount_off,\n currency,\n };\n}\n\n/**\n * Transforms a single quote item from the API format to the model format\n * @param item - Raw quote item from API\n * @returns Transformed quote item\n */\nexport function transformQuoteItem(item: any): CartItemModel {\n return {\n itemType: item.__typename,\n uid: item.uid,\n product: {\n uid: item.product.uid,\n sku: item.product.sku,\n name: item.product.name,\n priceRange: {\n maximumPrice: {\n regularPrice: {\n value:\n item.product.price_range.maximum_price.regular_price.value,\n currency:\n item.product.price_range.maximum_price.regular_price.currency,\n },\n },\n },\n },\n image: getImage(item),\n links: getLinks(item),\n discounted: getDiscounted(item),\n discountedTotal: {\n value: item.prices.row_total.value,\n currency: item.prices.row_total.currency,\n },\n catalogDiscount: {\n amountOff: item.prices.catalog_discount.amount_off,\n percentOff: item.prices.catalog_discount.percent_off,\n },\n discounts:\n item.prices?.discounts?.map((discount: any) => ({\n label: discount.label,\n value: discount.value,\n amount: {\n value: discount.amount.value,\n currency: discount.amount.currency,\n },\n })) ?? [],\n discountPercentage: getDiscountPercentage(item),\n insufficientQuantity:\n (item.__typename === 'ConfigurableCartItem'\n ? item.configured_variant?.stock_status ?? item.product.stock_status\n : item.product.stock_status\n ) === 'IN_STOCK' && !item.is_available,\n outOfStock: item.product.stock_status === 'OUT_OF_STOCK',\n stockStatus: item.product.stock_status,\n quantity: item.quantity,\n prices: {\n regularPrice: getRegularPrice(item),\n priceIncludingTax: {\n value: item.prices.price_including_tax.value,\n currency: item.prices.price_including_tax.currency,\n },\n originalItemPrice: {\n value: item.prices.original_item_price.value,\n currency: item.prices.original_item_price.currency,\n },\n originalRowTotal: {\n value: item.prices.original_row_total.value,\n currency: item.prices.original_row_total.currency,\n },\n rowTotal: {\n value: item.prices.row_total.value,\n currency: item.prices.row_total.currency,\n },\n rowTotalIncludingTax: {\n value: item.prices.row_total_including_tax.value,\n currency: item.prices.row_total_including_tax.currency,\n },\n },\n savingsAmount: getSavingsAmount(item),\n noteFromBuyer: item.note_from_buyer?.map((note: any) => ({\n createdAt: note.created_at,\n creatorId: note.creator_id,\n creatorType: note.creator_type,\n negotiableQuoteItemUid: note.negotiable_quote_item_uid,\n note: note.note,\n noteUid: note.note_uid,\n })),\n noteFromSeller: item.note_from_seller?.map((note: any) => ({\n createdAt: note.created_at,\n creatorId: note.creator_id,\n creatorType: note.creator_type,\n negotiableQuoteItemUid: note.negotiable_quote_item_uid,\n note: note.note,\n noteUid: note.note_uid,\n })),\n configurableOptions: item.configurable_options?.map((option: any) => ({\n optionLabel: option.option_label,\n valueLabel: option.value_label,\n })),\n bundleOptions: item.bundle_options?.map((option: any) => ({\n label: option.label,\n values: option.values.map((value: any) => ({\n label: value.label,\n quantity: value.quantity,\n originalPrice: {\n value: value.original_price.value,\n currency: value.original_price.currency,\n },\n price: {\n value: value.priceV2.value,\n currency: value.priceV2.currency,\n },\n })),\n })),\n customizableOptions: item.customizable_options?.map((option: any) => ({\n type: option.type,\n label: option.label,\n values: option.values.map((value: any) => ({\n label: value.label,\n value: value.value,\n })),\n })),\n };\n}\n\n/**\n * Transforms an array of quote items from the API format to the model format\n * @param items - Array of raw quote items from API\n * @returns Array of transformed quote items\n */\nexport function transformQuoteItems(\n items: any[] | null | undefined\n): CartItemModel[] {\n if (!items) {\n return [];\n }\n\n return items.map(transformQuoteItem);\n}\n\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport {\n CartItemModel,\n NegotiableQuoteListEntry,\n NegotiableQuoteModel,\n NegotiableQuotesListModel,\n NegotiableQuoteStatus,\n PaginationInfo,\n ShippingAddress,\n} from '@/quote-management/data/models/negotiable-quote-model';\nimport { state } from '@/quote-management/lib/state';\nimport { transformHistory } from './transform-history';\nimport { transformQuoteItems } from './transform-quote-items';\n\n// Quote statuses that allow editing/sending for review\nconst EDITABLE_QUOTE_STATUSES = [\n 'DRAFT',\n 'UPDATED',\n 'DECLINED',\n 'EXPIRED',\n 'NEW',\n 'OPEN',\n] as const;\n\n// Helper function to get the total quantity of a quote (number of quote line items or total quantity)\nfunction getTotalQuantity(quote: any) {\n if (!quote.items) return 0;\n\n const config = state.config;\n\n if (config?.quoteSummaryDisplayTotal === 0) return quote.items.length;\n if (config?.quoteSummaryDisplayTotal === 1) return quote.total_quantity;\n // Default to items count if unexpected config value or error returned\n return quote.items.length;\n}\n\nfunction checkAllItemsHaveStock(items: CartItemModel[]): boolean {\n return items.every((item) => !item.outOfStock && !item.insufficientQuantity);\n}\n\n// Base helper that transforms a single quote object directly\nfunction transformSingleQuote(quote: any): NegotiableQuoteModel {\n const isQuoteNew = isNewQuote(quote);\n const isGeneratedFromTemplate = Boolean(quote.template_name?.trim());\n const quoteItems = transformQuoteItems(quote.items);\n return {\n uid: quote.uid,\n name: quote.name,\n createdAt: quote.created_at,\n updatedAt: quote.updated_at,\n expirationDate: quote.expiration_date,\n status: isQuoteNew ? NegotiableQuoteStatus.NEW : quote.status,\n isVirtual: Boolean(quote.is_virtual),\n salesRepName: quote.sales_rep_name,\n buyer: {\n firstname: quote.buyer.firstname,\n lastname: quote.buyer.lastname,\n },\n email: quote.email,\n templateName: quote.template_name,\n totalQuantity: getTotalQuantity(quote),\n comments: quote.comments?.map((comment: any) => {\n const baseComment: any = {\n uid: comment.uid,\n createdAt: comment.created_at,\n author: {\n firstname: comment.author.firstname,\n lastname: comment.author.lastname,\n },\n text: comment.text,\n };\n\n if (\n Array.isArray(comment.attachments) &&\n comment.attachments.length > 0\n ) {\n baseComment.attachments = comment.attachments.map((a: any) => ({\n name: a.name,\n url: a.url,\n }));\n }\n\n return baseComment;\n }),\n prices: quote.prices && {\n appliedDiscounts: quote.prices.discounts?.map((discount: any) => ({\n amount: {\n value: discount.amount.value,\n currency: discount.amount.currency,\n },\n label: discount.label,\n coupon: discount.coupon,\n })),\n appliedTaxes: quote.prices.applied_taxes?.map((tax: any) => ({\n amount: { value: tax.amount.value, currency: tax.amount.currency },\n label: tax.label,\n })),\n discount:\n quote.prices.discounts &&\n quote.prices.grand_total &&\n calculateTotal(\n quote.prices.discounts,\n quote.prices.grand_total.currency\n ),\n grandTotal: quote.prices.grand_total && {\n value: quote.prices.grand_total.value,\n currency: quote.prices.grand_total.currency,\n },\n grandTotalExcludingTax: quote.prices.grand_total_excluding_tax && {\n value: quote.prices.grand_total_excluding_tax.value,\n currency: quote.prices.grand_total_excluding_tax.currency,\n },\n subtotalExcludingTax: quote.prices.subtotal_excluding_tax && {\n value: quote.prices.subtotal_excluding_tax.value,\n currency: quote.prices.subtotal_excluding_tax.currency,\n },\n subtotalIncludingTax: quote.prices.subtotal_including_tax && {\n value: quote.prices.subtotal_including_tax.value,\n currency: quote.prices.subtotal_including_tax.currency,\n },\n subtotalWithDiscountExcludingTax: quote.prices\n .subtotal_with_discount_excluding_tax && {\n value: quote.prices.subtotal_with_discount_excluding_tax.value,\n currency: quote.prices.subtotal_with_discount_excluding_tax.currency,\n },\n ...transformShippingPrices(quote),\n totalTax:\n quote.prices.applied_taxes &&\n quote.prices.grand_total &&\n calculateTotal(\n quote.prices.applied_taxes,\n quote.prices.grand_total.currency\n ),\n },\n history: transformHistory(quote.history),\n items: quoteItems,\n shippingAddresses: quote.shipping_addresses?.map((address: any) => {\n const shippingAddress: ShippingAddress = {\n uid: address.uid,\n firstname: address.firstname,\n lastname: address.lastname,\n company: address.company,\n street: address.street,\n city: address.city,\n postcode: address.postcode,\n country: {\n code: address.country.code,\n label: address.country.label,\n },\n telephone: address.telephone,\n };\n\n if (address.region) {\n shippingAddress.region = {\n code: address.region.code,\n label: address.region.label,\n regionId: address.region.region_id,\n };\n }\n\n return shippingAddress;\n }),\n canCheckout:\n ['UPDATED', 'DECLINED'].includes(quote.status) &&\n state.permissions.checkoutQuote &&\n quote.shipping_addresses?.length > 0 &&\n checkAllItemsHaveStock(quoteItems),\n canSendForReview:\n !isGeneratedFromTemplate &&\n (isQuoteNew || EDITABLE_QUOTE_STATUSES.includes(quote.status)) &&\n state.permissions.editQuote,\n canUpdateQuote:\n !isGeneratedFromTemplate &&\n (isQuoteNew || EDITABLE_QUOTE_STATUSES.includes(quote.status)) &&\n state.permissions.editQuote,\n canDelete:\n !isGeneratedFromTemplate &&\n !['PENDING', 'SUBMITTED', 'ORDERED'].includes(quote.status) &&\n state.permissions.deleteQuote,\n canClose: quote.status\n ? !isGeneratedFromTemplate &&\n !['DRAFT', 'CLOSED', 'ORDERED', 'OPEN'].includes(quote.status)\n : false,\n readOnly:\n isGeneratedFromTemplate ||\n (!isQuoteNew &&\n ['ORDERED', 'SUBMITTED', 'CLOSED', 'PENDING'].includes(quote.status)) ||\n !state.permissions.editQuote,\n };\n}\n\nexport function transformQuote(quoteData: any): NegotiableQuoteModel | null {\n if (!quoteData) {\n return null;\n }\n\n return transformSingleQuote(quoteData);\n}\n\n// quote is new if it has a status of SUBMITTED and there is no history entry that\n// has a change_type of UPDATED with a non-empty array of status changes\nfunction isNewQuote(quote: any): boolean {\n return (\n quote.status === 'SUBMITTED' &&\n !(quote.history ?? []).some(\n (history: any) =>\n history.change_type === 'UPDATED' &&\n (history.changes?.statuses?.changes ?? []).length > 0\n )\n );\n}\n\nfunction transformNegotiableQuoteListEntry(\n quote: any\n): NegotiableQuoteListEntry {\n const isQuoteNew = isNewQuote(quote);\n return {\n uid: quote.uid,\n name: quote.name,\n createdAt: quote.created_at,\n updatedAt: quote.updated_at,\n status: isQuoteNew ? NegotiableQuoteStatus.NEW : quote.status,\n buyer: {\n firstname: quote.buyer.firstname,\n lastname: quote.buyer.lastname,\n },\n templateName: quote.template_name,\n prices: {\n grandTotal: {\n value: quote.prices.grand_total.value,\n currency: quote.prices.grand_total.currency,\n },\n },\n };\n}\n\nexport function transformNegotiableQuotesList(\n quotesData: any\n): NegotiableQuotesListModel | null {\n if (!quotesData) {\n return null;\n }\n\n const transformedModel = {\n items:\n quotesData.items\n ?.filter((quote: any) => quote?.uid)\n .map(transformNegotiableQuoteListEntry) || [],\n pageInfo: {\n currentPage: quotesData.page_info.current_page,\n pageSize: quotesData.page_info.page_size,\n totalPages: quotesData.page_info.total_pages,\n },\n totalCount: quotesData.total_count,\n sortFields: quotesData.sort_fields\n ? {\n default: quotesData.sort_fields.default,\n options: quotesData.sort_fields.options,\n }\n : undefined,\n };\n\n // Calculate pagination info\n const paginationInfo = transformPaginationInfo(transformedModel);\n\n return {\n ...transformedModel,\n paginationInfo: paginationInfo || undefined,\n };\n}\n\nexport function transformPaginationInfo(\n quotesData: NegotiableQuotesListModel | null\n): PaginationInfo | null {\n if (!quotesData?.pageInfo || !quotesData.totalCount) {\n return null;\n }\n\n const { currentPage, pageSize, totalPages } = quotesData.pageInfo;\n const { totalCount } = quotesData;\n\n const startItem = totalCount > 0 ? (currentPage - 1) * pageSize + 1 : 0;\n const endItem = Math.min(currentPage * pageSize, totalCount);\n\n const pageSizeOptions = [20, 30, 50, 100, 200]; // Default page size options\n\n return {\n currentPage,\n totalCount,\n pageSize,\n startItem,\n endItem,\n totalPages,\n pageSizeOptions,\n };\n}\n\n// TODO: Check if admin has this configuration\nexport const getDefaultPageSizeOptions = () => [20, 30, 50, 100, 200];\n\nexport function calculateTotal(data: any[], currency: string) {\n if (!data?.length)\n return {\n value: 0,\n currency,\n };\n\n return data.reduce(\n (acc: any, item: any) => {\n return {\n value: acc.value + item.amount.value,\n currency: item.amount.currency,\n };\n },\n { value: 0, currency }\n );\n}\n\nexport function transformShippingPrices(quote: any) {\n if (!quote || !quote.shipping_addresses?.length) {\n return {};\n }\n\n const shippingAddress = quote.shipping_addresses[0];\n const selectedShippingMethod = shippingAddress.selected_shipping_method;\n\n if (!selectedShippingMethod) {\n return {};\n }\n\n return {\n shippingIncludingTax: selectedShippingMethod.price_incl_tax && {\n value: selectedShippingMethod.price_incl_tax.value,\n currency: selectedShippingMethod.price_incl_tax.currency,\n },\n shippingExcludingTax: selectedShippingMethod.price_excl_tax && {\n value: selectedShippingMethod.price_excl_tax.value,\n currency: selectedShippingMethod.price_excl_tax.currency,\n },\n };\n}\n"],"names":["NegotiableQuoteStatus","setEndpoint","setFetchGraphQlHeader","removeFetchGraphQlHeader","setFetchGraphQlHeaders","fetchGraphQl","getConfig","FetchGraphQL","transformHistoryEntry","historyEntry","_a","_b","_c","_d","_e","_f","change","_g","transformHistory","historyEntries","findApplicablePriceTier","priceTiers","quantity","a","b","tier","getImage","item","config","state","getLinks","link","getDiscounted","isConfigurable","priceRange","applicableTier","getDiscountPercentage","percent_off","_h","getRegularPrice","getSavingsAmount","amount_off","currency","transformQuoteItem","discount","note","option","value","transformQuoteItems","items","EDITABLE_QUOTE_STATUSES","getTotalQuantity","quote","checkAllItemsHaveStock","transformSingleQuote","isQuoteNew","isNewQuote","isGeneratedFromTemplate","quoteItems","comment","baseComment","tax","calculateTotal","transformShippingPrices","address","shippingAddress","transformQuote","quoteData","history","transformNegotiableQuoteListEntry","transformNegotiableQuotesList","quotesData","transformedModel","paginationInfo","transformPaginationInfo","currentPage","pageSize","totalPages","totalCount","startItem","endItem","getDefaultPageSizeOptions","data","acc","selectedShippingMethod"],"mappings":"8FA0RO,IAAKA,GAAAA,IACVA,EAAA,IAAM,MACNA,EAAA,UAAY,YACZA,EAAA,QAAU,UACVA,EAAA,QAAU,UACVA,EAAA,KAAO,OACPA,EAAA,QAAU,UACVA,EAAA,OAAS,SACTA,EAAA,SAAW,WACXA,EAAA,QAAU,UACVA,EAAA,MAAQ,QAVEA,IAAAA,GAAA,CAAA,CAAA,ECxRL,KAAM,CACX,YAAAC,EACA,sBAAAC,EACA,yBAAAC,EACA,uBAAAC,EACA,aAAAC,EACA,UAAAC,CACF,EAAI,IAAIC,EAAA,EAAe,WAAA,ECOhB,SAASC,EACdC,EAC6B,mBAC7B,MAAO,CACL,IAAKA,EAAa,IAClB,UAAWA,EAAa,WACxB,OAAQ,CACN,UAAWA,EAAa,OAAO,UAC/B,SAAUA,EAAa,OAAO,QAAA,EAEhC,WAAYA,EAAa,YACzB,QAAS,CACP,eAAcC,EAAAD,EAAa,UAAb,YAAAC,EAAsB,gBAAiB,CACnD,QAASD,EAAa,QAAQ,cAAc,OAAA,EAE9C,gBAAeE,EAAAF,EAAa,UAAb,YAAAE,EAAsB,iBAAkB,CACrD,UAAWF,EAAa,QAAQ,eAAe,UAC/C,UAAWA,EAAa,QAAQ,eAAe,UAC/C,MAAOA,EAAa,QAAQ,eAAe,KAAA,E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c,GAAKC,EAAW,EAAI,EAChEI,EAAU,KAAK,IAAIL,EAAcC,EAAUE,CAAU,EAI3D,MAAO,CACL,YAAAH,EACA,WAAAG,EACA,SAAAF,EACA,UAAAG,EACA,QAAAC,EACA,WAAAH,EACA,gBATsB,CAAC,GAAI,GAAI,GAAI,IAAK,GAAG,CAS3C,CAEJ,CAGO,MAAMI,EAA4B,IAAM,CAAC,GAAI,GAAI,GAAI,IAAK,GAAG,EAE7D,SAASnB,EAAeoB,EAAaxC,EAAkB,CAC5D,OAAKwC,GAAA,MAAAA,EAAM,OAMJA,EAAK,OACV,CAACC,EAAUxD,KACF,CACL,MAAOwD,EAAI,MAAQxD,EAAK,OAAO,MAC/B,SAAUA,EAAK,OAAO,QAAA,GAG1B,CAAE,MAAO,EAAG,SAAAe,CAAA,CAAS,EAZd,CACL,MAAO,EACP,SAAAA,CAAA,CAYN,CAEO,SAASqB,EAAwBX,EAAY,OAClD,GAAI,CAACA,GAAS,GAAC1C,EAAA0C,EAAM,qBAAN,MAAA1C,EAA0B,QACvC,MAAO,CAAA,EAIT,MAAM0E,EADkBhC,EAAM,mBAAmB,CAAC,EACH,yBAE/C,OAAKgC,EAIE,CACL,qBAAsBA,EAAuB,gBAAkB,CAC7D,MAAOA,EAAuB,eAAe,MAC7C,SAAUA,EAAuB,eAAe,QAAA,EAElD,qBAAsBA,EAAuB,gBAAkB,CAC7D,MAAOA,EAAuB,eAAe,MAC7C,SAAUA,EAAuB,eAAe,QAAA,CAClD,EAXO,CAAA,CAaX"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/*! Copyright 2025 Adobe
|
|
2
|
+
All Rights Reserved. */
|
|
3
|
+
import{events as w}from"@dropins/tools/event-bus.js";import"./state.js";import{f as c}from"./transform-quote.js";const E=`
|
|
4
|
+
mutation INITIATE_UPLOAD_MUTATION($input: initiateUploadInput!) {
|
|
5
|
+
initiateUpload(input: $input) {
|
|
6
|
+
upload_url
|
|
7
|
+
key
|
|
8
|
+
expires_at
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
`,U=`
|
|
12
|
+
mutation FINISH_UPLOAD_MUTATION($input: finishUploadInput!) {
|
|
13
|
+
finishUpload(input: $input) {
|
|
14
|
+
success
|
|
15
|
+
key
|
|
16
|
+
message
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
`,A=async r=>{const s="NEGOTIABLE_QUOTE_ATTACHMENT";try{const t=r==null?void 0:r.name;if(!r||!t)throw new Error("Invalid file");const p=h=>h.map(I=>I.message).join("; "),{data:e,errors:o}=await c(E,{variables:{input:{key:t,media_resource_type:s}}});if(o&&o.length)throw new Error(p(o));const{upload_url:u,key:d}=(e==null?void 0:e.initiateUpload)||{};if(!u||!d)throw new Error("Failed to initiate upload");const a=await fetch(u,{method:"PUT",body:r});if(!a.ok)throw new Error(`Upload failed: ${a.status} ${a.statusText}`);const{data:i,errors:n}=await c(U,{variables:{input:{key:d,media_resource_type:s}}});if(n&&n.length)throw new Error(p(n));const{success:m,key:l,message:T}=(i==null?void 0:i.finishUpload)||{};if(!m||!l)throw new Error(T||"Failed to finish upload");return{key:l}}catch(t){throw w.emit("quote-management/file-upload-error",{error:(t==null?void 0:t.message)||"File upload failed",fileName:r==null?void 0:r.name}),t instanceof Error?t:new Error("File upload failed")}};export{A as u};
|
|
20
|
+
//# sourceMappingURL=uploadFile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uploadFile.js","sources":["/@dropins/storefront-quote-management/src/api/uploadFile/graphql/InitiateUploadMutation.ts","/@dropins/storefront-quote-management/src/api/uploadFile/graphql/FinishUploadMutation.ts","/@dropins/storefront-quote-management/src/api/uploadFile/uploadFile.ts"],"sourcesContent":["/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this \n * file in accordance with the terms of the Adobe license agreement \n * accompanying it. \n *******************************************************************/\n\nexport const INITIATE_UPLOAD_MUTATION = `\n mutation INITIATE_UPLOAD_MUTATION($input: initiateUploadInput!) {\n initiateUpload(input: $input) {\n upload_url\n key\n expires_at\n }\n }\n`;","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this \n * file in accordance with the terms of the Adobe license agreement \n * accompanying it. \n *******************************************************************/\n\nexport const FINISH_UPLOAD_MUTATION = `\n mutation FINISH_UPLOAD_MUTATION($input: finishUploadInput!) {\n finishUpload(input: $input) {\n success\n key\n message\n }\n }\n`;","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this \n * file in accordance with the terms of the Adobe license agreement \n * accompanying it. \n *******************************************************************/\n\nimport { fetchGraphQl } from '@/quote-management/api';\nimport { events } from '@adobe-commerce/event-bus';\nimport { INITIATE_UPLOAD_MUTATION } from '@/quote-management/api/uploadFile/graphql/InitiateUploadMutation';\nimport { FINISH_UPLOAD_MUTATION } from '@/quote-management/api/uploadFile/graphql/FinishUploadMutation';\n\ntype GraphQLError = { message: string };\ntype InitiateUploadData = {\n initiateUpload?: {\n upload_url: string;\n key: string;\n expires_at: string;\n };\n};\ntype FinishUploadData = {\n finishUpload?: {\n success: boolean;\n key: string;\n message?: string;\n };\n};\ntype GraphQLResponse<T> = {\n data?: T;\n errors?: GraphQLError[];\n};\n\nexport const uploadFile = async (file: File): Promise<{ key: string }> => {\n const mediaResourceType = 'NEGOTIABLE_QUOTE_ATTACHMENT';\n\n try {\n const filename = file?.name;\n if (!file || !filename) throw new Error('Invalid file');\n\n const formatGraphQLErrors = (errors: GraphQLError[]): string =>\n errors.map((e) => e.message).join('; ');\n\n const { data: initialData, errors: initialErrors } = (await fetchGraphQl(\n INITIATE_UPLOAD_MUTATION,\n { \n variables: { input: { key: filename, media_resource_type: mediaResourceType } } \n }\n )) as GraphQLResponse<InitiateUploadData>;\n if (initialErrors && initialErrors.length) throw new Error(formatGraphQLErrors(initialErrors));\n\n const { upload_url, key } = initialData?.initiateUpload || {};\n if (!upload_url || !key) throw new Error('Failed to initiate upload');\n\n const put = await fetch(upload_url, { method: 'PUT', body: file });\n if (!put.ok) throw new Error(`Upload failed: ${put.status} ${put.statusText}`);\n\n const { data: finishData, errors: finishErrors } = (await fetchGraphQl(\n FINISH_UPLOAD_MUTATION,\n { \n variables: { input: { key, media_resource_type: mediaResourceType } } \n }\n )) as GraphQLResponse<FinishUploadData>;\n if (finishErrors && finishErrors.length) throw new Error(formatGraphQLErrors(finishErrors));\n\n const { success, key: finalizedKey, message } = finishData?.finishUpload || {};\n if (!success || !finalizedKey) throw new Error(message || 'Failed to finish upload');\n\n return { key: finalizedKey };\n \n } catch (err: any) {\n events.emit('quote-management/file-upload-error', {\n error: err?.message || 'File upload failed',\n fileName: file?.name,\n });\n throw err instanceof Error ? err : new Error('File upload failed');\n }\n};\n"],"names":["INITIATE_UPLOAD_MUTATION","FINISH_UPLOAD_MUTATION","uploadFile","file","mediaResourceType","filename","formatGraphQLErrors","errors","e","initialData","initialErrors","fetchGraphQl","upload_url","key","put","finishData","finishErrors","success","finalizedKey","message","err","events"],"mappings":"iHASO,MAAMA,EAA2B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,ECA3BC,EAAyB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,ECyBzBC,EAAa,MAAOC,GAAyC,CACxE,MAAMC,EAAoB,8BAE1B,GAAI,CACF,MAAMC,EAAWF,GAAA,YAAAA,EAAM,KACvB,GAAI,CAACA,GAAQ,CAACE,EAAU,MAAM,IAAI,MAAM,cAAc,EAEtD,MAAMC,EAAuBC,GAC3BA,EAAO,IAAKC,GAAMA,EAAE,OAAO,EAAE,KAAK,IAAI,EAElC,CAAE,KAAMC,EAAa,OAAQC,CAAA,EAAmB,MAAMC,EAC1DX,EACA,CACE,UAAW,CAAE,MAAO,CAAE,IAAKK,EAAU,oBAAqBD,EAAkB,CAAE,CAChF,EAEF,GAAIM,GAAiBA,EAAc,OAAQ,MAAM,IAAI,MAAMJ,EAAoBI,CAAa,CAAC,EAE7F,KAAM,CAAE,WAAAE,EAAY,IAAAC,CAAA,GAAQJ,GAAA,YAAAA,EAAa,iBAAkB,CAAA,EAC3D,GAAI,CAACG,GAAc,CAACC,EAAK,MAAM,IAAI,MAAM,2BAA2B,EAEpE,MAAMC,EAAM,MAAM,MAAMF,EAAY,CAAE,OAAQ,MAAO,KAAMT,EAAM,EACjE,GAAI,CAACW,EAAI,GAAI,MAAM,IAAI,MAAM,kBAAkBA,EAAI,MAAM,IAAIA,EAAI,UAAU,EAAE,EAE7E,KAAM,CAAE,KAAMC,EAAY,OAAQC,CAAA,EAAkB,MAAML,EACxDV,EACA,CACE,UAAW,CAAE,MAAO,CAAE,IAAAY,EAAK,oBAAqBT,EAAkB,CAAE,CACtE,EAEF,GAAIY,GAAgBA,EAAa,OAAQ,MAAM,IAAI,MAAMV,EAAoBU,CAAY,CAAC,EAE1F,KAAM,CAAE,QAAAC,EAAS,IAAKC,EAAc,QAAAC,IAAYJ,GAAA,YAAAA,EAAY,eAAgB,CAAA,EAC5E,GAAI,CAACE,GAAW,CAACC,QAAoB,IAAI,MAAMC,GAAW,yBAAyB,EAEnF,MAAO,CAAE,IAAKD,CAAA,CAEhB,OAASE,EAAU,CACjB,MAAAC,EAAO,KAAK,qCAAsC,CAChD,OAAOD,GAAA,YAAAA,EAAK,UAAW,qBACvB,SAAUjB,GAAA,YAAAA,EAAM,IAAA,CACjB,EACKiB,aAAe,MAAQA,EAAM,IAAI,MAAM,oBAAoB,CACnE,CACF"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { FunctionComponent, VNode } from 'preact';
|
|
2
|
+
import { HTMLAttributes } from 'preact/compat';
|
|
3
|
+
|
|
4
|
+
export interface ActionsBarProps extends HTMLAttributes<HTMLDivElement> {
|
|
5
|
+
dropdownPlaceholder?: string;
|
|
6
|
+
dropdownOptions?: {
|
|
7
|
+
label: string;
|
|
8
|
+
value: string;
|
|
9
|
+
}[];
|
|
10
|
+
dropdownValue?: string;
|
|
11
|
+
handleDropdownChange?: (event: Event) => void;
|
|
12
|
+
buttons?: VNode[];
|
|
13
|
+
}
|
|
14
|
+
export declare const ActionsBar: FunctionComponent<ActionsBarProps>;
|
|
15
|
+
//# sourceMappingURL=ActionsBar.d.ts.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/********************************************************************
|
|
2
|
+
* Copyright 2025 Adobe
|
|
3
|
+
* All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* NOTICE: Adobe permits you to use, modify, and distribute this
|
|
6
|
+
* file in accordance with the terms of the Adobe license agreement
|
|
7
|
+
* accompanying it.
|
|
8
|
+
*******************************************************************/
|
|
9
|
+
export * from './ActionsBar';
|
|
10
|
+
export { ActionsBar as default } from './ActionsBar';
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { FunctionComponent } from 'preact';
|
|
2
|
+
|
|
3
|
+
export interface AttachedFile {
|
|
4
|
+
key: string;
|
|
5
|
+
name: string;
|
|
6
|
+
size: number;
|
|
7
|
+
status: 'uploading' | 'success' | 'error';
|
|
8
|
+
error?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface AttachedFilesListProps {
|
|
11
|
+
files: AttachedFile[];
|
|
12
|
+
onRemove: (key: string) => void;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export declare const AttachedFilesList: FunctionComponent<AttachedFilesListProps>;
|
|
16
|
+
//# sourceMappingURL=AttachedFilesList.d.ts.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/********************************************************************
|
|
2
|
+
* Copyright 2025 Adobe
|
|
3
|
+
* All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* NOTICE: Adobe permits you to use, modify, and distribute this
|
|
6
|
+
* file in accordance with the terms of the Adobe license agreement
|
|
7
|
+
* accompanying it.
|
|
8
|
+
*******************************************************************/
|
|
9
|
+
export { AttachedFilesList } from './AttachedFilesList';
|
|
10
|
+
export type { AttachedFile, AttachedFilesListProps } from './AttachedFilesList';
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { FunctionComponent, VNode } from 'preact';
|
|
2
|
+
import { HTMLAttributes } from 'preact/compat';
|
|
3
|
+
|
|
4
|
+
export interface ConfirmationModalProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
5
|
+
open?: boolean;
|
|
6
|
+
title?: VNode | string;
|
|
7
|
+
message?: VNode | string;
|
|
8
|
+
cancelLabel?: VNode | string;
|
|
9
|
+
confirmLabel?: VNode | string;
|
|
10
|
+
onCancel?: () => void;
|
|
11
|
+
onConfirm?: () => void;
|
|
12
|
+
onClose?: () => void;
|
|
13
|
+
showCloseButton?: boolean;
|
|
14
|
+
confirmationBanner?: VNode | null;
|
|
15
|
+
}
|
|
16
|
+
export declare const ConfirmationModal: FunctionComponent<ConfirmationModalProps>;
|
|
17
|
+
//# sourceMappingURL=ConfirmationModal.d.ts.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/********************************************************************
|
|
2
|
+
* Copyright 2025 Adobe
|
|
3
|
+
* All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* NOTICE: Adobe permits you to use, modify, and distribute this
|
|
6
|
+
* file in accordance with the terms of the Adobe license agreement
|
|
7
|
+
* accompanying it.
|
|
8
|
+
*******************************************************************/
|
|
9
|
+
export * from './ConfirmationModal';
|
|
10
|
+
export { ConfirmationModal as default } from './ConfirmationModal';
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { FunctionComponent, VNode } from 'preact';
|
|
2
|
+
import { HTMLAttributes } from 'preact/compat';
|
|
3
|
+
|
|
4
|
+
export interface ItemsQuotedProps extends Omit<HTMLAttributes<HTMLDivElement>, 'loading'> {
|
|
5
|
+
loading?: boolean;
|
|
6
|
+
table?: VNode;
|
|
7
|
+
pricesSummary?: VNode;
|
|
8
|
+
}
|
|
9
|
+
export declare const ItemsQuoted: FunctionComponent<ItemsQuotedProps>;
|
|
10
|
+
export declare const ItemsQuotedSkeleton: FunctionComponent;
|
|
11
|
+
//# sourceMappingURL=ItemsQuoted.d.ts.map
|