@dropins/storefront-quote-management 0.0.1-alpha13 → 0.0.1-alpha15

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.
Files changed (63) hide show
  1. package/api/graphql/NegotiableQuoteFragment.d.ts +1 -1
  2. package/api/index.d.ts +1 -0
  3. package/api/requestNegotiableQuote/requestNegotiableQuote.d.ts +3 -0
  4. package/api/setShippingAddress/setShippingAddress.d.ts +88 -0
  5. package/api/uploadFile/graphql/FinishUploadMutation.d.ts +10 -0
  6. package/api/uploadFile/graphql/InitiateUploadMutation.d.ts +10 -0
  7. package/api/uploadFile/index.d.ts +10 -0
  8. package/api/uploadFile/uploadFile.d.ts +12 -0
  9. package/api.js +8 -8
  10. package/api.js.map +1 -1
  11. package/chunks/ItemsQuoted.js +4 -0
  12. package/chunks/ItemsQuoted.js.map +1 -0
  13. package/chunks/NegotiableQuoteFragment.js +68 -21
  14. package/chunks/NegotiableQuoteFragment.js.map +1 -1
  15. package/chunks/QuoteCommentsList.js +4 -0
  16. package/chunks/QuoteCommentsList.js.map +1 -0
  17. package/chunks/QuoteHistoryLog.js +4 -0
  18. package/chunks/QuoteHistoryLog.js.map +1 -0
  19. package/chunks/ShippingAddressDisplay.js +4 -0
  20. package/chunks/ShippingAddressDisplay.js.map +1 -0
  21. package/chunks/transform-quote.js +1 -1
  22. package/chunks/transform-quote.js.map +1 -1
  23. package/chunks/uploadFile.js +41 -0
  24. package/chunks/uploadFile.js.map +1 -0
  25. package/components/QuoteCommentsList/QuoteCommentsList.d.ts +13 -0
  26. package/components/QuoteCommentsList/index.d.ts +11 -0
  27. package/components/QuoteHistoryLog/QuoteHistoryLog.d.ts +9 -0
  28. package/components/QuoteHistoryLog/index.d.ts +11 -0
  29. package/components/index.d.ts +2 -0
  30. package/containers/ItemsQuoted.js +1 -1
  31. package/containers/ItemsQuoted.js.map +1 -1
  32. package/containers/ManageNegotiableQuote/ManageNegotiableQuote.d.ts +11 -0
  33. package/containers/ManageNegotiableQuote.js +1 -1
  34. package/containers/ManageNegotiableQuote.js.map +1 -1
  35. package/containers/QuoteCommentsList/QuoteCommentsList.d.ts +9 -0
  36. package/containers/QuoteCommentsList/index.d.ts +11 -0
  37. package/containers/QuoteCommentsList.d.ts +3 -0
  38. package/containers/QuoteCommentsList.js +4 -0
  39. package/containers/QuoteCommentsList.js.map +1 -0
  40. package/containers/QuoteHistoryLog/QuoteHistoryLog.d.ts +9 -0
  41. package/containers/QuoteHistoryLog/index.d.ts +11 -0
  42. package/containers/QuoteHistoryLog.d.ts +3 -0
  43. package/containers/QuoteHistoryLog.js +4 -0
  44. package/containers/QuoteHistoryLog.js.map +1 -0
  45. package/containers/QuotesListTable.js +1 -1
  46. package/containers/QuotesListTable.js.map +1 -1
  47. package/containers/RequestNegotiableQuoteForm.js +1 -1
  48. package/containers/RequestNegotiableQuoteForm.js.map +1 -1
  49. package/containers/ShippingAddressDisplay/ShippingAddressDisplay.d.ts +10 -0
  50. package/containers/ShippingAddressDisplay/index.d.ts +11 -0
  51. package/containers/ShippingAddressDisplay.d.ts +1 -0
  52. package/containers/ShippingAddressDisplay.js +4 -0
  53. package/containers/ShippingAddressDisplay.js.map +1 -0
  54. package/containers/index.d.ts +3 -0
  55. package/data/models/negotiable-quote-model.d.ts +68 -0
  56. package/data/transforms/__fixtures__/negotiableQuoteData.d.ts +85 -0
  57. package/i18n/en_US.json.d.ts +41 -1
  58. package/package.json +1 -1
  59. package/render.js +7 -5
  60. package/render.js.map +1 -1
  61. package/utils/dateUtils.d.ts +15 -0
  62. package/chunks/requestNegotiableQuote.js +0 -25
  63. package/chunks/requestNegotiableQuote.js.map +0 -1
@@ -1,25 +0,0 @@
1
- /*! Copyright 2025 Adobe
2
- All Rights Reserved. */
3
- import{fetchGraphQl as c}from"@dropins/tools/fetch-graphql.js";import{events as f}from"@dropins/tools/event-bus.js";import{N}from"./NegotiableQuoteFragment.js";import{t as d}from"./transform-quote.js";const l=`
4
- mutation REQUEST_NEGOTIABLE_QUOTE_MUTATION(
5
- $cartId: ID!
6
- $quoteName: String!
7
- $comment: NegotiableQuoteCommentInput!
8
- $isDraft: Boolean
9
- ) {
10
- requestNegotiableQuote(
11
- input: {
12
- cart_id: $cartId
13
- quote_name: $quoteName
14
- comment: $comment
15
- is_draft: $isDraft
16
- }
17
- ) {
18
- quote {
19
- ...NegotiableQuoteFragment
20
- }
21
- }
22
- }
23
- ${N}
24
- `,_=async s=>{const{cartId:e,quoteName:t,comment:r,isDraft:a}=s;if(!e)throw new Error("Cart ID is required");if(!t)throw new Error("Quote name is required");if(!r)throw new Error("Comment is required");return c(l,{variables:{cartId:e,quoteName:t,comment:{comment:r},isDraft:a}}).then(n=>{var m,u;const{errors:i}=n;if(i){const q=i.map(E=>E.message).join("; ");throw new Error(`Failed to request negotiable quote: ${q}`)}const o=d((u=(m=n.data)==null?void 0:m.requestNegotiableQuote)==null?void 0:u.quote);if(!o)throw new Error("Failed to transform quote data: Invalid response structure");return f.emit("quote-management/negotiable-quote-requested",{quote:o,input:{cartId:e,quoteName:t,comment:r,isDraft:a}}),o})};export{_ as r};
25
- //# sourceMappingURL=requestNegotiableQuote.js.map
@@ -1 +0,0 @@
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 * 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 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 '@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}\n\nexport const requestNegotiableQuote = async (\n input: RequestNegotiableQuoteInput\n): Promise<NegotiableQuoteModel | null> => {\n const { cartId, quoteName, comment, 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: {\n comment\n },\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, isDraft },\n });\n\n return quoteData;\n });\n};\n"],"names":["REQUEST_NEGOTIABLE_QUOTE_MUTATION","NEGOTIABLE_QUOTE_FRAGMENT","requestNegotiableQuote","input","cartId","quoteName","comment","isDraft","fetchGraphQl","response","errors","errorMessages","error","quoteData","transformQuote","_b","_a","events"],"mappings":"yMAmBO,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,ECjBhBC,EAAyB,MACpCC,GACyC,CACzC,KAAM,CAAE,OAAAC,EAAQ,UAAAC,EAAW,QAAAC,EAAS,QAAAC,GAAYJ,EAEhD,GAAI,CAACC,EACH,MAAM,IAAI,MAAM,qBAAqB,EAGvC,GAAI,CAACC,EACH,MAAM,IAAI,MAAM,wBAAwB,EAG1C,GAAI,CAACC,EACH,MAAM,IAAI,MAAM,qBAAqB,EAGvC,OAAOE,EAAaR,EAAmC,CACrD,UAAW,CACT,OAAAI,EACA,UAAAC,EACA,QAAS,CACP,QAAAC,CAAA,EAEF,QAAAC,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,OAAAT,EAAQ,UAAAC,EAAW,QAAAC,EAAS,QAAAC,CAAA,CAAQ,CAC9C,EAEMM,CACT,CAAC,CACH"}