@dropins/storefront-quote-management 0.0.1-alpha12 → 0.0.1-alpha14
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/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/graphql/NegotiableQuoteFragment.d.ts +1 -1
- package/api/graphql/NegotiableQuoteListFragment.d.ts +1 -1
- package/api/index.d.ts +3 -0
- package/api/initialize/initialize.d.ts +1 -0
- package/api/requestNegotiableQuote/requestNegotiableQuote.d.ts +0 -6
- package/api/sendForReview/graphql/SendNegotiableQuoteForReviewMutation.d.ts +18 -0
- package/api/sendForReview/index.d.ts +10 -0
- package/api/sendForReview/sendForReview.d.ts +8 -0
- package/api/setShippingAddress/graphql/SetNegotiableQuoteShippingAddressMutation.d.ts +18 -0
- package/api/setShippingAddress/index.d.ts +2 -0
- package/api/setShippingAddress/setShippingAddress.d.ts +110 -0
- package/api.js +37 -4
- package/api.js.map +1 -1
- package/chunks/NegotiableQuoteFragment.js +167 -0
- package/chunks/NegotiableQuoteFragment.js.map +1 -0
- package/chunks/WarningFilled.js +4 -0
- package/chunks/WarningFilled.js.map +1 -0
- package/chunks/negotiableQuotes.js +12 -1
- package/chunks/negotiableQuotes.js.map +1 -1
- package/chunks/requestNegotiableQuote.js +3 -83
- package/chunks/requestNegotiableQuote.js.map +1 -1
- package/chunks/sendForReview.js +21 -0
- package/chunks/sendForReview.js.map +1 -0
- package/chunks/transform-quote.js +1 -1
- package/chunks/transform-quote.js.map +1 -1
- package/components/ActionsBar/ActionsBar.d.ts +14 -0
- package/components/ActionsBar/index.d.ts +11 -0
- package/components/ItemsQuoted/ItemsQuoted.d.ts +11 -0
- package/components/ItemsQuoted/index.d.ts +11 -0
- package/components/ManageNegotiableQuote/ManageNegotiableQuote.d.ts +20 -0
- package/components/ManageNegotiableQuote/__fixtures__/ManageNegotiableQuoteProps.d.ts +4 -0
- package/components/ManageNegotiableQuote/index.d.ts +11 -0
- package/components/OrderSummary/OrderSummary.d.ts +67 -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 +13 -0
- package/components/ProductListTable/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/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 +19 -1
- package/containers/ItemsQuoted/ItemsQuoted.d.ts +25 -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/ManageNegotiableQuote/ManageNegotiableQuote.d.ts +56 -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/QuotesListTable/QuotesListTable.d.ts +9 -9
- package/containers/QuotesListTable.js +1 -1
- package/containers/QuotesListTable.js.map +1 -1
- package/containers/RequestNegotiableQuoteForm.js +1 -1
- package/containers/RequestNegotiableQuoteForm.js.map +1 -1
- package/containers/index.d.ts +2 -0
- package/data/models/__fixtures__/negotiableQuoteModel.d.ts +7 -0
- package/data/models/customer-model.d.ts +1 -0
- package/data/models/negotiable-quote-model.d.ts +100 -34
- package/data/transforms/__fixtures__/negotiableQuoteData.d.ts +248 -2
- package/i18n/en_US.json.d.ts +94 -0
- package/lib/state.d.ts +1 -0
- package/package.json +1 -1
- package/render.js +5 -3
- package/render.js.map +1 -1
- package/types/state.types.d.ts +1 -0
|
@@ -0,0 +1,10 @@
|
|
|
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 declare const getQuoteData: (quoteId: string) => Promise<import('../../data/models/negotiable-quote-model').NegotiableQuoteModel>;
|
|
10
|
+
//# sourceMappingURL=getQuoteData.d.ts.map
|
|
@@ -0,0 +1,10 @@
|
|
|
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 './getQuoteData';
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -14,5 +14,5 @@
|
|
|
14
14
|
* is strictly forbidden unless prior written permission is obtained
|
|
15
15
|
* from Adobe.
|
|
16
16
|
*******************************************************************/
|
|
17
|
-
export declare const NEGOTIABLE_QUOTE_FRAGMENT = "\n fragment NegotiableQuoteFragment on NegotiableQuote {\n uid\n name\n created_at\n
|
|
17
|
+
export declare const NEGOTIABLE_QUOTE_FRAGMENT = "\n fragment NegotiableQuoteFragment on NegotiableQuote {\n uid\n name\n created_at\n status\n sales_rep_name\n expiration_date\n updated_at\n buyer {\n firstname\n lastname\n }\n comments {\n uid\n created_at\n author {\n firstname\n lastname\n }\n text\n }\n template_id\n template_name\n items {\n product {\n name\n sku\n uid\n stock_status\n quantity\n price_range {\n maximum_price {\n regular_price {\n value\n }\n }\n }\n }\n prices {\n price {\n currency\n value\n }\n original_item_price {\n currency\n value\n }\n original_row_total {\n currency\n value\n }\n row_total {\n currency\n value\n }\n catalog_discount {\n amount_off\n percent_off\n }\n discounts {\n label\n value\n amount {\n currency\n value\n }\n }\n }\n quantity\n ... on ConfigurableCartItem {\n\t\t\t\tconfigurable_options {\n\t\t\t\t\toption_label\n\t\t\t\t\tvalue_label\n\t\t\t\t}\n\t\t\t}\n\t\t\t... on BundleCartItem {\n\t\t\t\tbundle_options {\n\t\t\t\t\tlabel\n\t\t\t\t\tvalues {\n\t\t\t\t\t\tlabel\n\t\t\t\t\t\tquantity\n original_price {\n\t\t\t\t\t\t\tcurrency\n\t\t\t\t\t\t\tvalue\n\t\t\t\t\t\t}\n\t\t\t\t\t\tpriceV2 {\n\t\t\t\t\t\t\tcurrency\n\t\t\t\t\t\t\tvalue\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n }\n history {\n uid\n created_at\n author {\n firstname\n lastname\n }\n change_type\n changes {\n comment_added {\n comment\n }\n statuses {\n changes {\n new_status\n old_status\n }\n }\n expiration {\n new_expiration\n old_expiration\n }\n }\n }\n prices {\n subtotal_excluding_tax {\n currency\n value\n }\n subtotal_including_tax {\n currency\n value\n }\n subtotal_with_discount_excluding_tax {\n currency\n value\n }\n applied_taxes {\n amount {\n currency\n value\n }\n label\n }\n grand_total {\n currency\n value\n }\n }\n shipping_addresses {\n uid\n firstname\n lastname\n company\n street\n city\n region {\n code\n label\n region_id\n }\n postcode\n country {\n code\n label\n }\n telephone\n }\n }\n";
|
|
18
18
|
//# sourceMappingURL=NegotiableQuoteFragment.d.ts.map
|
|
@@ -6,5 +6,5 @@
|
|
|
6
6
|
* file in accordance with the terms of the Adobe license agreement
|
|
7
7
|
* accompanying it.
|
|
8
8
|
*******************************************************************/
|
|
9
|
-
export declare const NEGOTIABLE_QUOTE_LIST_FRAGMENT = "\n fragment NegotiableQuoteListFragment on NegotiableQuote {\n uid\n name\n created_at\n updated_at\n status\n buyer {\n firstname\n lastname\n }\n template_name\n prices {\n grand_total {\n value\n currency\n }\n }\n }\n";
|
|
9
|
+
export declare const NEGOTIABLE_QUOTE_LIST_FRAGMENT = "\n fragment NegotiableQuoteListFragment on NegotiableQuote {\n uid\n name\n created_at\n updated_at\n status\n buyer {\n firstname\n lastname\n }\n template_name\n prices {\n grand_total {\n value\n currency\n }\n }\n history {\n change_type\n changes {\n statuses {\n changes {\n new_status\n old_status\n }\n }\n }\n }\n }\n";
|
|
10
10
|
//# sourceMappingURL=NegotiableQuoteListFragment.d.ts.map
|
package/api/index.d.ts
CHANGED
|
@@ -2,5 +2,8 @@ export * from './initialize';
|
|
|
2
2
|
export * from './fetch-graphql';
|
|
3
3
|
export * from './getCustomerData';
|
|
4
4
|
export * from './requestNegotiableQuote';
|
|
5
|
+
export * from './getQuoteData';
|
|
5
6
|
export * from './negotiableQuotes';
|
|
7
|
+
export * from './setShippingAddress';
|
|
8
|
+
export * from './sendForReview';
|
|
6
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -3,6 +3,7 @@ import { Lang } from '@dropins/tools/types/elsie/src/i18n';
|
|
|
3
3
|
|
|
4
4
|
type ConfigProps = {
|
|
5
5
|
langDefinitions?: Lang;
|
|
6
|
+
quoteId?: string;
|
|
6
7
|
};
|
|
7
8
|
export declare const initialize: Initializer<ConfigProps>;
|
|
8
9
|
export declare const config: import('@dropins/tools/types/elsie/src/lib').Config<ConfigProps>;
|
|
@@ -5,12 +5,6 @@ export interface RequestNegotiableQuoteInput {
|
|
|
5
5
|
quoteName: string;
|
|
6
6
|
comment: string;
|
|
7
7
|
isDraft?: boolean;
|
|
8
|
-
attachments?: {
|
|
9
|
-
key: string;
|
|
10
|
-
}[];
|
|
11
8
|
}
|
|
12
9
|
export declare const requestNegotiableQuote: (input: RequestNegotiableQuoteInput) => Promise<NegotiableQuoteModel | null>;
|
|
13
|
-
export declare const uploadFile: (file: File) => Promise<{
|
|
14
|
-
key: string;
|
|
15
|
-
}>;
|
|
16
10
|
//# sourceMappingURL=requestNegotiableQuote.d.ts.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/********************************************************************
|
|
2
|
+
* ADOBE CONFIDENTIAL
|
|
3
|
+
* __________________
|
|
4
|
+
*
|
|
5
|
+
* Copyright 2024 Adobe
|
|
6
|
+
* All Rights Reserved.
|
|
7
|
+
*
|
|
8
|
+
* NOTICE: All information contained herein is, and remains
|
|
9
|
+
* the property of Adobe and its suppliers, if any. The intellectual
|
|
10
|
+
* and technical concepts contained herein are proprietary to Adobe
|
|
11
|
+
* and its suppliers and are protected by all applicable intellectual
|
|
12
|
+
* property laws, including trade secret and copyright laws.
|
|
13
|
+
* Dissemination of this information or reproduction of this material
|
|
14
|
+
* is strictly forbidden unless prior written permission is obtained
|
|
15
|
+
* from Adobe.
|
|
16
|
+
*******************************************************************/
|
|
17
|
+
export declare const SEND_NEGOTIABLE_QUOTE_FOR_REVIEW_MUTATION: string;
|
|
18
|
+
//# sourceMappingURL=SendNegotiableQuoteForReviewMutation.d.ts.map
|
|
@@ -0,0 +1,10 @@
|
|
|
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 { sendForReview, type SendForReviewInput } from './sendForReview';
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { NegotiableQuoteModel } from '../../data/models/negotiable-quote-model';
|
|
2
|
+
|
|
3
|
+
export interface SendForReviewInput {
|
|
4
|
+
quoteUid: string;
|
|
5
|
+
comment?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const sendForReview: (input: SendForReviewInput) => Promise<NegotiableQuoteModel | null>;
|
|
8
|
+
//# sourceMappingURL=sendForReview.d.ts.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/********************************************************************
|
|
2
|
+
* ADOBE CONFIDENTIAL
|
|
3
|
+
* __________________
|
|
4
|
+
*
|
|
5
|
+
* Copyright 2024 Adobe
|
|
6
|
+
* All Rights Reserved.
|
|
7
|
+
*
|
|
8
|
+
* NOTICE: All information contained herein is, and remains
|
|
9
|
+
* the property of Adobe and its suppliers, if any. The intellectual
|
|
10
|
+
* and technical concepts contained herein are proprietary to Adobe
|
|
11
|
+
* and its suppliers and are protected by all applicable intellectual
|
|
12
|
+
* property laws, including trade secret and copyright laws.
|
|
13
|
+
* Dissemination of this information or reproduction of this material
|
|
14
|
+
* is strictly forbidden unless prior written permission is obtained
|
|
15
|
+
* from Adobe.
|
|
16
|
+
*******************************************************************/
|
|
17
|
+
export declare const SET_NEGOTIABLE_QUOTE_SHIPPING_ADDRESS_MUTATION: string;
|
|
18
|
+
//# sourceMappingURL=SetNegotiableQuoteShippingAddressMutation.d.ts.map
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { NegotiableQuoteModel } from '../../data/models/negotiable-quote-model';
|
|
2
|
+
|
|
3
|
+
export interface AddressInput {
|
|
4
|
+
/** City name */
|
|
5
|
+
city: string;
|
|
6
|
+
/** Optional company name */
|
|
7
|
+
company?: string;
|
|
8
|
+
/** Two-letter country code (e.g., 'US') */
|
|
9
|
+
countryCode: string;
|
|
10
|
+
/** First name */
|
|
11
|
+
firstname: string;
|
|
12
|
+
/** Last name */
|
|
13
|
+
lastname: string;
|
|
14
|
+
/** Postal/ZIP code */
|
|
15
|
+
postcode: string;
|
|
16
|
+
/** Optional state/province name */
|
|
17
|
+
region?: string;
|
|
18
|
+
/** Optional state/province ID */
|
|
19
|
+
regionId?: number;
|
|
20
|
+
/** Whether to save this address to the customer's address book */
|
|
21
|
+
saveInAddressBook?: boolean;
|
|
22
|
+
/** Street address lines (array) */
|
|
23
|
+
street: string[];
|
|
24
|
+
/** Phone number */
|
|
25
|
+
telephone: string;
|
|
26
|
+
/**
|
|
27
|
+
* Additional input (optional custom fields for the address).
|
|
28
|
+
* These fields will be merged into the address data sent to GraphQL.
|
|
29
|
+
* Standard fields take precedence over additional fields to prevent
|
|
30
|
+
* accidental override of required address attributes.
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```ts
|
|
34
|
+
* additionalInput: {
|
|
35
|
+
* vat_id: 'GB123456789',
|
|
36
|
+
* custom_attribute: 'value',
|
|
37
|
+
* delivery_instructions: 'Leave at door'
|
|
38
|
+
* }
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
additionalInput?: Record<string, any>;
|
|
42
|
+
}
|
|
43
|
+
export interface SetShippingAddressInput {
|
|
44
|
+
/** The unique ID of the negotiable quote */
|
|
45
|
+
quoteUid: string;
|
|
46
|
+
/** The ID of a saved customer address (use this OR addressData, not both) */
|
|
47
|
+
addressId?: number;
|
|
48
|
+
/** New address data (use this OR addressId, not both) */
|
|
49
|
+
addressData?: AddressInput;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Sets or updates the shipping address for a negotiable quote.
|
|
53
|
+
*
|
|
54
|
+
* @param input - The input parameters for setting the shipping address
|
|
55
|
+
* @param input.quoteUid - The unique ID of the negotiable quote
|
|
56
|
+
* @param input.addressId - Optional ID of a saved customer address (use this OR addressData)
|
|
57
|
+
* @param input.addressData - Optional new address data (use this OR addressId)
|
|
58
|
+
* @param input.addressData.additionalInput - Optional additional address fields to pass through to GraphQL
|
|
59
|
+
* @returns Promise that resolves to the updated quote model with shipping addresses including uid field
|
|
60
|
+
* @throws Error if validation fails or GraphQL operation fails
|
|
61
|
+
*
|
|
62
|
+
* @example
|
|
63
|
+
* ```ts
|
|
64
|
+
* // Using a saved address
|
|
65
|
+
* const quote = await setShippingAddress({
|
|
66
|
+
* quoteUid: 'quote-123',
|
|
67
|
+
* addressId: 5
|
|
68
|
+
* });
|
|
69
|
+
*
|
|
70
|
+
* // Using new address data
|
|
71
|
+
* const quote = await setShippingAddress({
|
|
72
|
+
* quoteUid: 'quote-123',
|
|
73
|
+
* addressData: {
|
|
74
|
+
* firstname: 'John',
|
|
75
|
+
* lastname: 'Doe',
|
|
76
|
+
* street: ['123 Main St'],
|
|
77
|
+
* city: 'San Francisco',
|
|
78
|
+
* countryCode: 'US',
|
|
79
|
+
* postcode: '94103',
|
|
80
|
+
* telephone: '555-1234'
|
|
81
|
+
* }
|
|
82
|
+
* });
|
|
83
|
+
*
|
|
84
|
+
* // Using address data with additional custom fields
|
|
85
|
+
* const quote = await setShippingAddress({
|
|
86
|
+
* quoteUid: 'quote-123',
|
|
87
|
+
* addressData: {
|
|
88
|
+
* firstname: 'John',
|
|
89
|
+
* lastname: 'Doe',
|
|
90
|
+
* street: ['123 Main St'],
|
|
91
|
+
* city: 'San Francisco',
|
|
92
|
+
* countryCode: 'US',
|
|
93
|
+
* postcode: '94103',
|
|
94
|
+
* telephone: '555-1234',
|
|
95
|
+
* additionalInput: {
|
|
96
|
+
* vat_id: 'GB123456789',
|
|
97
|
+
* custom_attribute_1: 'value1',
|
|
98
|
+
* delivery_instructions: 'Leave at door'
|
|
99
|
+
* }
|
|
100
|
+
* }
|
|
101
|
+
* });
|
|
102
|
+
*
|
|
103
|
+
* // Access address identifier
|
|
104
|
+
* if (quote?.shippingAddresses?.[0]) {
|
|
105
|
+
* console.log('Address UID:', quote.shippingAddresses[0].uid);
|
|
106
|
+
* }
|
|
107
|
+
* ```
|
|
108
|
+
*/
|
|
109
|
+
export declare const setShippingAddress: (input: SetShippingAddressInput) => Promise<NegotiableQuoteModel | null>;
|
|
110
|
+
//# sourceMappingURL=setShippingAddress.d.ts.map
|
package/api.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*! Copyright 2025 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
|
-
import{D as
|
|
3
|
+
import{D as i,s as n,t as h}from"./chunks/transform-quote.js";import{FetchGraphQL as _,fetchGraphQl as q}from"@dropins/tools/fetch-graphql.js";import{events as s}from"@dropins/tools/event-bus.js";import{r as K}from"./chunks/requestNegotiableQuote.js";import{N as p}from"./chunks/NegotiableQuoteFragment.js";import{F as W,N as X,S as Z,n as ee}from"./chunks/negotiableQuotes.js";import{s as oe}from"./chunks/sendForReview.js";import{Initializer as I}from"@dropins/tools/lib.js";const T=`
|
|
4
4
|
fragment CUSTOMER_FRAGMENT on Customer {
|
|
5
5
|
role {
|
|
6
6
|
permissions {
|
|
@@ -17,13 +17,46 @@ import{D as s,s as o}from"./chunks/transform-quote.js";import{FetchGraphQL as m}
|
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
|
-
`,
|
|
20
|
+
`,S=`
|
|
21
21
|
query CUSTOMER_QUERY {
|
|
22
22
|
customer {
|
|
23
23
|
...CUSTOMER_FRAGMENT
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
${
|
|
28
|
-
`,
|
|
27
|
+
${T}
|
|
28
|
+
`,A="All/Quotes/View/Request, Edit, Delete",N="All/Quotes/View/Request, Edit, Delete",U="All/Quotes/View/Request, Edit, Delete",R="All/Quotes/View/Checkout with quote",w=o=>{const e=[],t=(r,u=[])=>{for(const a of r){const d=[...u,a.text];a.children&&a.children.length>0?t(a.children,d):e.push(d.join("/"))}};return t(o),e};function D(o){const{role:e}=o;if(!e)return{permissions:{canRequestQuote:i.requestQuote,canEditQuote:i.editQuote,canDeleteQuote:i.deleteQuote,canCheckoutQuote:i.checkoutQuote}};const{permissions:t}=e,r=w(t);return{permissions:{canRequestQuote:r.includes(A),canEditQuote:r.includes(N),canDeleteQuote:r.includes(U),canCheckoutQuote:r.includes(R)}}}const C=async()=>{var o;if(!n.authenticated)return Promise.reject(new Error("Unauthorized"));try{const e=await Q(S);if(!((o=e==null?void 0:e.data)!=null&&o.customer))throw new Error("No customer data received");return D(e.data.customer)}catch(e){return Promise.reject(e)}},O=`
|
|
29
|
+
query QUOTE_DATA_QUERY(
|
|
30
|
+
$quoteId: ID!
|
|
31
|
+
) {
|
|
32
|
+
negotiableQuote(
|
|
33
|
+
uid: $quoteId
|
|
34
|
+
) {
|
|
35
|
+
...NegotiableQuoteFragment
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
${p}
|
|
40
|
+
`,F=async o=>{var e;if(!n.authenticated)return Promise.reject(new Error("Unauthorized"));if(!n.permissions.editQuote)return Promise.reject(new Error("Unauthorized"));try{const t=await Q(O,{variables:{quoteId:o}}),r=h((e=t==null?void 0:t.data)==null?void 0:e.negotiableQuote);if(!r)throw new Error("Failed to transform quote data");return s.emit("quote-management/quote-data",{quote:r,permissions:n.permissions}),r}catch(t){return Promise.reject(t)}},m=new I({init:async o=>{const e={};m.config.setConfig({...e,...o})},listeners:()=>[s.on("authenticated",async o=>{n.authenticated=!!o,o?C().then(e=>{n.permissions={requestQuote:e.permissions.canRequestQuote,editQuote:e.permissions.canEditQuote,deleteQuote:e.permissions.canDeleteQuote,checkoutQuote:e.permissions.canCheckoutQuote},s.emit("quote-management/permissions",n.permissions)}).catch(e=>{console.error(e),n.permissions=i,s.emit("quote-management/permissions",i)}):(n.permissions=i,s.emit("quote-management/permissions",i))},{eager:!0}),s.on("quote-management/permissions",async o=>{const e=m.config.getConfig().quoteId;e&&o.editQuote&&F(e).then(t=>{s.emit("quote-management/quote-data/initialized",{quote:t,permissions:o},{})}).catch(t=>{s.emit("quote-management/quote-data/error",{error:t})})},{eager:!0})]}),k=m.config,{setEndpoint:x,setFetchGraphQlHeader:j,removeFetchGraphQlHeader:z,setFetchGraphQlHeaders:H,fetchGraphQl:Q,getConfig:L}=new _().getMethods(),M=`
|
|
41
|
+
mutation SET_NEGOTIABLE_QUOTE_SHIPPING_ADDRESS_MUTATION(
|
|
42
|
+
$quoteUid: ID!
|
|
43
|
+
$addressId: ID
|
|
44
|
+
$addressData: NegotiableQuoteAddressInput
|
|
45
|
+
) {
|
|
46
|
+
setNegotiableQuoteShippingAddress(
|
|
47
|
+
input: {
|
|
48
|
+
quote_uid: $quoteUid
|
|
49
|
+
shipping_addresses: {
|
|
50
|
+
customer_address_uid: $addressId
|
|
51
|
+
address: $addressData
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
) {
|
|
55
|
+
quote {
|
|
56
|
+
...NegotiableQuoteFragment
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
${p}
|
|
61
|
+
`;function y(o){const{additionalInput:e,...t}=o,r={city:t.city,company:t.company,country_code:t.countryCode,firstname:t.firstname,lastname:t.lastname,postcode:t.postcode,region:t.region,region_id:t.regionId,save_in_address_book:t.saveInAddressBook,street:t.street,telephone:t.telephone};return{...e||{},...r}}const B=async o=>{const{quoteUid:e,addressId:t,addressData:r}=o;if(!e)throw new Error("Quote UID is required");if(!t&&!r)throw new Error("Either addressId or addressData must be provided");if(t&&r)throw new Error("Cannot provide both addressId and addressData");const u=r?y(r):null;return q(M,{variables:{quoteUid:e,addressId:t||null,addressData:u}}).then(a=>{var l,E;const{errors:d}=a;if(d){const f=d.map(g=>g.message).join("; ");throw new Error(`Failed to set shipping address: ${f}`)}const c=h((E=(l=a.data)==null?void 0:l.setNegotiableQuoteShippingAddress)==null?void 0:E.quote);if(!c)throw new Error("Failed to transform quote data: Invalid response structure");return s.emit("quote-management/shipping-address-set",{quote:c,input:{quoteUid:e,addressId:t,addressData:r}}),c})};export{W as FilterMatchTypeEnum,X as NegotiableQuoteSortableField,Z as SortEnum,k as config,Q as fetchGraphQl,L as getConfig,C as getCustomerData,F as getQuoteData,m as initialize,ee as negotiableQuotes,z as removeFetchGraphQlHeader,K as requestNegotiableQuote,oe as sendForReview,x as setEndpoint,j as setFetchGraphQlHeader,H as setFetchGraphQlHeaders,B as setShippingAddress};
|
|
29
62
|
//# sourceMappingURL=api.js.map
|
package/api.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.js","sources":["/@dropins/storefront-quote-management/src/api/graphql/CustomerFragment.ts","/@dropins/storefront-quote-management/src/api/getCustomerData/graphql/CustomerQuery.ts","/@dropins/storefront-quote-management/src/data/transforms/transform-customer.ts","/@dropins/storefront-quote-management/src/api/getCustomerData/getCustomerData.ts","/@dropins/storefront-quote-management/src/api/initialize/initialize.ts","/@dropins/storefront-quote-management/src/api/fetch-graphql/fetch-graphql.ts"],"sourcesContent":["export const CUSTOMER_FRAGMENT = /* GraphQL */ `\n fragment CUSTOMER_FRAGMENT on Customer {\n role {\n permissions {\n text\n children {\n text\n children {\n text\n children {\n text\n }\n }\n }\n }\n }\n }\n`","import { CUSTOMER_FRAGMENT } from '@/quote-management/api/graphql/CustomerFragment';\n\nexport const CUSTOMER_QUERY = `\n query CUSTOMER_QUERY {\n customer {\n ...CUSTOMER_FRAGMENT\n }\n }\n\n ${CUSTOMER_FRAGMENT}\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 { DEFAULT_PERMISSIONS } from \"@/quote-management/lib/state\";\nimport { CustomerModel } from \"../models\";\n\ntype PermissionsSchema = {\n text: string;\n children: PermissionsSchema[];\n}\n\nconst CAN_REQUEST_QUOTE_PERMISSION = 'All/Quotes/View/Request, Edit, Delete';\nconst CAN_EDIT_QUOTE_PERMISSION = 'All/Quotes/View/Request, Edit, Delete';\nconst CAN_DELETE_QUOTE_PERMISSION = 'All/Quotes/View/Request, Edit, Delete';\n\n/**\n * Flatten the permissions into a list of strings\n * @param permissions - The permissions to flatten\n * @returns A list of strings representing the flattened permissions\n */\nexport const flattenPermissions = (permissions: PermissionsSchema[]): string[] => {\n const result: string[] = [];\n \n // Recursively traverse the permissions and build the path\n const traverse = (nodes: PermissionsSchema[], path: string[] = []) => {\n for (const node of nodes) {\n const currentPath = [...path, node.text];\n \n if (node.children && node.children.length > 0) {\n traverse(node.children, currentPath);\n } else {\n result.push(currentPath.join('/'));\n }\n }\n };\n \n traverse(permissions);\n return result;\n}\n\nexport function transformCustomer(customerData: any): CustomerModel {\n const { role } = customerData;\n\n if (!role) {\n return {\n permissions: {\n canRequestQuote: DEFAULT_PERMISSIONS.requestQuote,\n canEditQuote: DEFAULT_PERMISSIONS.editQuote,\n canDeleteQuote: DEFAULT_PERMISSIONS.deleteQuote,\n },\n };\n }\n\n const { permissions } = role;\n\n const flattenedPermissions = flattenPermissions(permissions);\n return {\n permissions: {\n canRequestQuote: flattenedPermissions.includes(CAN_REQUEST_QUOTE_PERMISSION),\n canEditQuote: flattenedPermissions.includes(CAN_EDIT_QUOTE_PERMISSION),\n canDeleteQuote: flattenedPermissions.includes(CAN_DELETE_QUOTE_PERMISSION),\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 { CUSTOMER_QUERY } from './graphql/CustomerQuery';\nimport { transformCustomer } from '@/quote-management/data/transforms';\nimport { state } from '@/quote-management/lib/state';\n\nexport const getCustomerData = async () => { \n if (!state.authenticated) {\n return Promise.reject(new Error('Unauthorized'));\n }\n\n try {\n const results: any = await fetchGraphQl(CUSTOMER_QUERY);\n \n if (!results?.data?.customer) {\n throw new Error('No customer data received');\n }\n \n return transformCustomer(results.data.customer);\n } catch (error) {\n return Promise.reject(error);\n }\n}\n","import { Initializer } from '@adobe-commerce/elsie/lib';\nimport { Lang } from '@adobe-commerce/elsie/i18n';\nimport { events } from '@adobe-commerce/event-bus';\nimport { state, DEFAULT_PERMISSIONS } from '@/quote-management/lib/state';\nimport { getCustomerData } from '@/quote-management/api/getCustomerData';\n\ntype ConfigProps = {\n langDefinitions?: Lang;\n};\n\nexport const initialize = new Initializer<ConfigProps>({\n init: async (config) => {\n const defaultConfig = {};\n\n initialize.config.setConfig({ ...defaultConfig, ...config });\n },\n\n listeners: () => [\n events.on('authenticated', async (authenticated) => {\n state.authenticated = !!authenticated;\n\n if (authenticated) {\n getCustomerData().then((customerData) => {\n state.permissions = {\n requestQuote: customerData.permissions.canRequestQuote,\n editQuote: customerData.permissions.canEditQuote,\n deleteQuote: customerData.permissions.canDeleteQuote,\n };\n events.emit('quote-management/permissions', state.permissions);\n })\n .catch((error) => {\n console.error(error);\n state.permissions = DEFAULT_PERMISSIONS;\n events.emit('quote-management/permissions', DEFAULT_PERMISSIONS);\n });\n } else {\n state.permissions = DEFAULT_PERMISSIONS;\n events.emit('quote-management/permissions', DEFAULT_PERMISSIONS);\n }\n }, {\n eager: true,\n }),\n ],\n});\n\nexport const config = initialize.config;\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"],"names":["CUSTOMER_FRAGMENT","CUSTOMER_QUERY","CAN_REQUEST_QUOTE_PERMISSION","CAN_EDIT_QUOTE_PERMISSION","CAN_DELETE_QUOTE_PERMISSION","flattenPermissions","permissions","result","traverse","nodes","path","node","currentPath","transformCustomer","customerData","role","DEFAULT_PERMISSIONS","flattenedPermissions","getCustomerData","state","results","fetchGraphQl","_a","error","initialize","Initializer","config","defaultConfig","events","authenticated","setEndpoint","setFetchGraphQlHeader","removeFetchGraphQlHeader","setFetchGraphQlHeaders","getConfig","FetchGraphQL"],"mappings":"mWAAO,MAAMA,EAAkC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,ECElCC,EAAiB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA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AMC,EAAgB,CAAA,EAEtBH,EAAW,OAAO,UAAU,CAAE,GAAGG,EAAe,GAAGD,EAAQ,CAC7D,EAEA,UAAW,IAAM,CACfE,EAAO,GAAG,gBAAiB,MAAOC,GAAkB,CAClDV,EAAM,cAAgB,CAAC,CAACU,EAEpBA,EACFX,EAAA,EAAkB,KAAMJ,GAAiB,CACvCK,EAAM,YAAc,CAClB,aAAcL,EAAa,YAAY,gBACvC,UAAWA,EAAa,YAAY,aACpC,YAAaA,EAAa,YAAY,cAAA,EAExCc,EAAO,KAAK,+BAAgCT,EAAM,WAAW,CAC/D,CAAC,EACE,MAAOI,GAAU,CAChB,QAAQ,MAAMA,CAAK,EACnBJ,EAAM,YAAcH,EACpBY,EAAO,KAAK,+BAAgCZ,CAAmB,CACjE,CAAC,GAEHG,EAAM,YAAcH,EACpBY,EAAO,KAAK,+BAAgCZ,CAAmB,EAEnE,EAAG,CACD,MAAO,EAAA,CACR,CAAA,CAEL,CAAC,EAEYU,EAASF,EAAW,OC3CpB,CACX,YAAAM,EACA,sBAAAC,EACA,yBAAAC,EACA,uBAAAC,EACA,aAAAZ,EACA,UAAAa,CACF,EAAI,IAAIC,EAAA,EAAe,WAAA"}
|
|
1
|
+
{"version":3,"file":"api.js","sources":["/@dropins/storefront-quote-management/src/api/graphql/CustomerFragment.ts","/@dropins/storefront-quote-management/src/api/getCustomerData/graphql/CustomerQuery.ts","/@dropins/storefront-quote-management/src/data/transforms/transform-customer.ts","/@dropins/storefront-quote-management/src/api/getCustomerData/getCustomerData.ts","/@dropins/storefront-quote-management/src/api/getQuoteData/graphql/QuoteDataQuery.ts","/@dropins/storefront-quote-management/src/api/getQuoteData/getQuoteData.ts","/@dropins/storefront-quote-management/src/api/initialize/initialize.ts","/@dropins/storefront-quote-management/src/api/fetch-graphql/fetch-graphql.ts","/@dropins/storefront-quote-management/src/api/setShippingAddress/graphql/SetNegotiableQuoteShippingAddressMutation.ts","/@dropins/storefront-quote-management/src/api/setShippingAddress/setShippingAddress.ts"],"sourcesContent":["export const CUSTOMER_FRAGMENT = /* GraphQL */ `\n fragment CUSTOMER_FRAGMENT on Customer {\n role {\n permissions {\n text\n children {\n text\n children {\n text\n children {\n text\n }\n }\n }\n }\n }\n }\n`","import { CUSTOMER_FRAGMENT } from '@/quote-management/api/graphql/CustomerFragment';\n\nexport const CUSTOMER_QUERY = `\n query CUSTOMER_QUERY {\n customer {\n ...CUSTOMER_FRAGMENT\n }\n }\n\n ${CUSTOMER_FRAGMENT}\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 { DEFAULT_PERMISSIONS } from \"@/quote-management/lib/state\";\nimport { CustomerModel } from \"../models\";\n\ntype PermissionsSchema = {\n text: string;\n children: PermissionsSchema[];\n}\n\nconst CAN_REQUEST_QUOTE_PERMISSION = 'All/Quotes/View/Request, Edit, Delete';\nconst CAN_EDIT_QUOTE_PERMISSION = 'All/Quotes/View/Request, Edit, Delete';\nconst CAN_DELETE_QUOTE_PERMISSION = 'All/Quotes/View/Request, Edit, Delete';\nconst CAN_CHECKOUT_QUOTE_PERMISSION = 'All/Quotes/View/Checkout with quote';\n\n/**\n * Flatten the permissions into a list of strings\n * @param permissions - The permissions to flatten\n * @returns A list of strings representing the flattened permissions\n */\nexport const flattenPermissions = (permissions: PermissionsSchema[]): string[] => {\n const result: string[] = [];\n \n // Recursively traverse the permissions and build the path\n const traverse = (nodes: PermissionsSchema[], path: string[] = []) => {\n for (const node of nodes) {\n const currentPath = [...path, node.text];\n \n if (node.children && node.children.length > 0) {\n traverse(node.children, currentPath);\n } else {\n result.push(currentPath.join('/'));\n }\n }\n };\n \n traverse(permissions);\n return result;\n}\n\nexport function transformCustomer(customerData: any): CustomerModel {\n const { role } = customerData;\n\n if (!role) {\n return {\n permissions: {\n canRequestQuote: DEFAULT_PERMISSIONS.requestQuote,\n canEditQuote: DEFAULT_PERMISSIONS.editQuote,\n canDeleteQuote: DEFAULT_PERMISSIONS.deleteQuote,\n canCheckoutQuote: DEFAULT_PERMISSIONS.checkoutQuote,\n },\n };\n }\n\n const { permissions } = role;\n\n const flattenedPermissions = flattenPermissions(permissions);\n return {\n permissions: {\n canRequestQuote: flattenedPermissions.includes(CAN_REQUEST_QUOTE_PERMISSION),\n canEditQuote: flattenedPermissions.includes(CAN_EDIT_QUOTE_PERMISSION),\n canDeleteQuote: flattenedPermissions.includes(CAN_DELETE_QUOTE_PERMISSION),\n canCheckoutQuote: flattenedPermissions.includes(CAN_CHECKOUT_QUOTE_PERMISSION),\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 { CUSTOMER_QUERY } from './graphql/CustomerQuery';\nimport { transformCustomer } from '@/quote-management/data/transforms';\nimport { state } from '@/quote-management/lib/state';\n\nexport const getCustomerData = async () => { \n if (!state.authenticated) {\n return Promise.reject(new Error('Unauthorized'));\n }\n\n try {\n const results: any = await fetchGraphQl(CUSTOMER_QUERY);\n \n if (!results?.data?.customer) {\n throw new Error('No customer data received');\n }\n \n return transformCustomer(results.data.customer);\n } catch (error) {\n return Promise.reject(error);\n }\n}\n","import { NEGOTIABLE_QUOTE_FRAGMENT } from '@/quote-management/api/graphql/NegotiableQuoteFragment';\n\nexport const QUOTE_DATA_QUERY = `\n query QUOTE_DATA_QUERY(\n $quoteId: ID!\n ) {\n negotiableQuote(\n uid: $quoteId\n ) {\n ...NegotiableQuoteFragment\n }\n }\n\n ${NEGOTIABLE_QUOTE_FRAGMENT}\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 { QUOTE_DATA_QUERY } from './graphql/QuoteDataQuery';\nimport { transformQuote } from '@/quote-management/data/transforms';\nimport { state } from '@/quote-management/lib/state';\nimport { events } from '@adobe-commerce/event-bus';\n\nexport const getQuoteData = async (quoteId: string) => { \n if (!state.authenticated) {\n return Promise.reject(new Error('Unauthorized'));\n }\n\n if (!state.permissions.editQuote) {\n return Promise.reject(new Error('Unauthorized'));\n }\n\n try {\n const results: any = await fetchGraphQl(QUOTE_DATA_QUERY, {\n variables: {\n quoteId\n }\n });\n\n const transformedQuote = transformQuote(results?.data?.negotiableQuote);\n\n if (!transformedQuote) {\n throw new Error('Failed to transform quote data');\n }\n\n events.emit('quote-management/quote-data', {\n quote: transformedQuote,\n permissions: state.permissions,\n });\n \n return transformedQuote;\n } catch (error) {\n return Promise.reject(error);\n }\n}\n","import { Initializer } from '@adobe-commerce/elsie/lib';\nimport { Lang } from '@adobe-commerce/elsie/i18n';\nimport { events } from '@adobe-commerce/event-bus';\nimport { state, DEFAULT_PERMISSIONS } from '@/quote-management/lib/state';\nimport { getCustomerData } from '@/quote-management/api/getCustomerData';\nimport { getQuoteData } from '@/quote-management/api/getQuoteData';\n\ntype ConfigProps = {\n langDefinitions?: Lang;\n quoteId?: string;\n};\n\nexport const initialize = new Initializer<ConfigProps>({\n init: async (config) => {\n const defaultConfig = {};\n\n initialize.config.setConfig({ ...defaultConfig, ...config });\n },\n\n listeners: () => [\n events.on('authenticated', async (authenticated) => {\n state.authenticated = !!authenticated;\n\n if (authenticated) {\n getCustomerData().then((customerData) => {\n state.permissions = {\n requestQuote: customerData.permissions.canRequestQuote,\n editQuote: customerData.permissions.canEditQuote,\n deleteQuote: customerData.permissions.canDeleteQuote,\n checkoutQuote: customerData.permissions.canCheckoutQuote,\n };\n events.emit('quote-management/permissions', state.permissions);\n })\n .catch((error) => {\n console.error(error);\n state.permissions = DEFAULT_PERMISSIONS;\n events.emit('quote-management/permissions', DEFAULT_PERMISSIONS);\n });\n } else {\n state.permissions = DEFAULT_PERMISSIONS;\n events.emit('quote-management/permissions', DEFAULT_PERMISSIONS);\n }\n }, {\n eager: true,\n }),\n events.on('quote-management/permissions', async (permissions) => {\n const quoteId = initialize.config.getConfig().quoteId;\n if (!quoteId) {\n return;\n }\n\n if (permissions.editQuote) {\n getQuoteData(quoteId).then((quoteData) => {\n events.emit('quote-management/quote-data/initialized', {\n quote: quoteData,\n permissions,\n }, {});\n }).catch((error) => {\n events.emit('quote-management/quote-data/error', {\n error,\n });\n });\n }\n }, {\n eager: true,\n }),\n ],\n});\n\nexport const config = initialize.config;\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 * 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 SET_NEGOTIABLE_QUOTE_SHIPPING_ADDRESS_MUTATION = `\n mutation SET_NEGOTIABLE_QUOTE_SHIPPING_ADDRESS_MUTATION(\n $quoteUid: ID!\n $addressId: ID\n $addressData: NegotiableQuoteAddressInput\n ) {\n setNegotiableQuoteShippingAddress(\n input: {\n quote_uid: $quoteUid\n shipping_addresses: {\n customer_address_uid: $addressId\n address: $addressData\n }\n }\n ) {\n quote {\n ...NegotiableQuoteFragment\n }\n }\n }\n ${NEGOTIABLE_QUOTE_FRAGMENT}\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 '@adobe-commerce/fetch-graphql';\nimport { events } from '@adobe-commerce/event-bus';\nimport { SET_NEGOTIABLE_QUOTE_SHIPPING_ADDRESS_MUTATION } from './graphql/SetNegotiableQuoteShippingAddressMutation';\nimport { NegotiableQuoteModel } from '@/quote-management/data/models/negotiable-quote-model';\nimport { transformQuote } from '@/quote-management/data/transforms';\n\nexport interface AddressInput {\n /** City name */\n city: string;\n /** Optional company name */\n company?: string;\n /** Two-letter country code (e.g., 'US') */\n countryCode: string;\n /** First name */\n firstname: string;\n /** Last name */\n lastname: string;\n /** Postal/ZIP code */\n postcode: string;\n /** Optional state/province name */\n region?: string;\n /** Optional state/province ID */\n regionId?: number;\n /** Whether to save this address to the customer's address book */\n saveInAddressBook?: boolean;\n /** Street address lines (array) */\n street: string[];\n /** Phone number */\n telephone: string;\n /** \n * Additional input (optional custom fields for the address).\n * These fields will be merged into the address data sent to GraphQL.\n * Standard fields take precedence over additional fields to prevent\n * accidental override of required address attributes.\n * \n * @example\n * ```ts\n * additionalInput: {\n * vat_id: 'GB123456789',\n * custom_attribute: 'value',\n * delivery_instructions: 'Leave at door'\n * }\n * ```\n */\n additionalInput?: Record<string, any>;\n}\n\nexport interface SetShippingAddressInput {\n /** The unique ID of the negotiable quote */\n quoteUid: string;\n /** The ID of a saved customer address (use this OR addressData, not both) */\n addressId?: number;\n /** New address data (use this OR addressId, not both) */\n addressData?: AddressInput;\n}\n\n/**\n * Transform camelCase address data to snake_case for GraphQL mutation.\n * Additional fields from additionalInput are spread into the result, with\n * standard fields taking precedence (defensive flexibility approach).\n */\nfunction transformAddressToSnakeCase(address: AddressInput) {\n const { additionalInput, ...standardFields } = address;\n \n // Build the standard transformed fields\n const transformedStandardFields = {\n city: standardFields.city,\n company: standardFields.company,\n country_code: standardFields.countryCode,\n firstname: standardFields.firstname,\n lastname: standardFields.lastname,\n postcode: standardFields.postcode,\n region: standardFields.region,\n region_id: standardFields.regionId,\n save_in_address_book: standardFields.saveInAddressBook,\n street: standardFields.street,\n telephone: standardFields.telephone,\n };\n \n // Spread additional input first, then standard fields take precedence\n // This provides defensive flexibility: allows custom fields while protecting core fields\n return {\n ...(additionalInput || {}),\n ...transformedStandardFields,\n };\n}\n\n/**\n * Sets or updates the shipping address for a negotiable quote.\n * \n * @param input - The input parameters for setting the shipping address\n * @param input.quoteUid - The unique ID of the negotiable quote\n * @param input.addressId - Optional ID of a saved customer address (use this OR addressData)\n * @param input.addressData - Optional new address data (use this OR addressId)\n * @param input.addressData.additionalInput - Optional additional address fields to pass through to GraphQL\n * @returns Promise that resolves to the updated quote model with shipping addresses including uid field\n * @throws Error if validation fails or GraphQL operation fails\n * \n * @example\n * ```ts\n * // Using a saved address\n * const quote = await setShippingAddress({\n * quoteUid: 'quote-123',\n * addressId: 5\n * });\n * \n * // Using new address data\n * const quote = await setShippingAddress({\n * quoteUid: 'quote-123',\n * addressData: {\n * firstname: 'John',\n * lastname: 'Doe',\n * street: ['123 Main St'],\n * city: 'San Francisco',\n * countryCode: 'US',\n * postcode: '94103',\n * telephone: '555-1234'\n * }\n * });\n * \n * // Using address data with additional custom fields\n * const quote = await setShippingAddress({\n * quoteUid: 'quote-123',\n * addressData: {\n * firstname: 'John',\n * lastname: 'Doe',\n * street: ['123 Main St'],\n * city: 'San Francisco',\n * countryCode: 'US',\n * postcode: '94103',\n * telephone: '555-1234',\n * additionalInput: {\n * vat_id: 'GB123456789',\n * custom_attribute_1: 'value1',\n * delivery_instructions: 'Leave at door'\n * }\n * }\n * });\n * \n * // Access address identifier\n * if (quote?.shippingAddresses?.[0]) {\n * console.log('Address UID:', quote.shippingAddresses[0].uid);\n * }\n * ```\n */\nexport const setShippingAddress = async (\n input: SetShippingAddressInput\n): Promise<NegotiableQuoteModel | null> => {\n const { quoteUid, addressId, addressData } = input;\n\n if (!quoteUid) {\n throw new Error('Quote UID is required');\n }\n\n // Validate that exactly one of addressId or addressData is provided\n if (!addressId && !addressData) {\n throw new Error('Either addressId or addressData must be provided');\n }\n\n if (addressId && addressData) {\n throw new Error('Cannot provide both addressId and addressData');\n }\n\n // Transform addressData to snake_case if provided\n const transformedAddressData = addressData\n ? transformAddressToSnakeCase(addressData)\n : null;\n\n return fetchGraphQl(SET_NEGOTIABLE_QUOTE_SHIPPING_ADDRESS_MUTATION, {\n variables: {\n quoteUid,\n addressId: addressId || null,\n addressData: transformedAddressData,\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 shipping address: ${errorMessages}`);\n }\n\n // Transform the quote data\n const quoteData = transformQuote(\n response.data?.setNegotiableQuoteShippingAddress?.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/shipping-address-set', {\n quote: quoteData,\n input: { quoteUid, addressId, addressData },\n });\n\n return quoteData;\n });\n};\n\n"],"names":["CUSTOMER_FRAGMENT","CUSTOMER_QUERY","CAN_REQUEST_QUOTE_PERMISSION","CAN_EDIT_QUOTE_PERMISSION","CAN_DELETE_QUOTE_PERMISSION","CAN_CHECKOUT_QUOTE_PERMISSION","flattenPermissions","permissions","result","traverse","nodes","path","node","currentPath","transformCustomer","customerData","role","DEFAULT_PERMISSIONS","flattenedPermissions","getCustomerData","state","results","fetchGraphQl","_a","error","QUOTE_DATA_QUERY","NEGOTIABLE_QUOTE_FRAGMENT","getQuoteData","quoteId","transformedQuote","transformQuote","events","initialize","Initializer","config","defaultConfig","authenticated","quoteData","setEndpoint","setFetchGraphQlHeader","removeFetchGraphQlHeader","setFetchGraphQlHeaders","getConfig","FetchGraphQL","SET_NEGOTIABLE_QUOTE_SHIPPING_ADDRESS_MUTATION","transformAddressToSnakeCase","address","additionalInput","standardFields","transformedStandardFields","setShippingAddress","input","quoteUid","addressId","addressData","transformedAddressData","response","errors","errorMessages","_b"],"mappings":"6dAAO,MAAMA,EAAkC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,ECElCC,EAAiB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAOxBD,CAAiB;AAAA,ECQjBE,EAA+B,wCAC/BC,EAA4B,wCAC5BC,EAA8B,wCAC9BC,EAAgC,sCAOzBC,EAAsBC,GAA+C,CAC9E,MAAMC,EAAmB,CAAA,EAGnBC,EAAW,CAACC,EAA4BC,EAAiB,CAAA,IAAO,CAClE,UAAWC,KAAQF,EAAO,CACtB,MAAMG,EAAc,CAAC,GAAGF,EAAMC,EAAK,IAAI,EAEnCA,EAAK,UAAYA,EAAK,SAAS,OAAS,EACxCH,EAASG,EAAK,SAAUC,CAAW,EAEnCL,EAAO,KAAKK,EAAY,KAAK,GAAG,CAAC,CAEzC,CACJ,EAEA,OAAAJ,EAASF,CAAW,EACbC,CACX,EAEO,SAASM,EAAkBC,EAAkC,CAChE,KAAM,CAAE,KAAAC,GAASD,EAEjB,GAAI,CAACC,EACD,MAAO,CACH,YAAa,CACT,gBAAiBC,EAAoB,aACrC,aAAcA,EAAoB,UAClC,eAAgBA,EAAoB,YACpC,iBAAkBA,EAAoB,aAAA,CAC1C,EAIR,KAAM,CAAE,YAAAV,GAAgBS,EAElBE,EAAuBZ,EAAmBC,CAAW,EAC3D,MAAO,CACH,YAAa,CACT,gBAAiBW,EAAqB,SAAShB,CAA4B,EAC3E,aAAcgB,EAAqB,SAASf,CAAyB,EACrE,eAAgBe,EAAqB,SAASd,CAA2B,EACzE,iBAAkBc,EAAqB,SAASb,CAA6B,CAAA,CACjF,CAER,CC1DO,MAAMc,EAAkB,SAAY,OACvC,GAAI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ights Reserved. */
|
|
3
|
+
const e=`
|
|
4
|
+
fragment NegotiableQuoteFragment on NegotiableQuote {
|
|
5
|
+
uid
|
|
6
|
+
name
|
|
7
|
+
created_at
|
|
8
|
+
status
|
|
9
|
+
sales_rep_name
|
|
10
|
+
expiration_date
|
|
11
|
+
updated_at
|
|
12
|
+
buyer {
|
|
13
|
+
firstname
|
|
14
|
+
lastname
|
|
15
|
+
}
|
|
16
|
+
comments {
|
|
17
|
+
uid
|
|
18
|
+
created_at
|
|
19
|
+
author {
|
|
20
|
+
firstname
|
|
21
|
+
lastname
|
|
22
|
+
}
|
|
23
|
+
text
|
|
24
|
+
}
|
|
25
|
+
template_id
|
|
26
|
+
template_name
|
|
27
|
+
items {
|
|
28
|
+
product {
|
|
29
|
+
name
|
|
30
|
+
sku
|
|
31
|
+
uid
|
|
32
|
+
stock_status
|
|
33
|
+
quantity
|
|
34
|
+
price_range {
|
|
35
|
+
maximum_price {
|
|
36
|
+
regular_price {
|
|
37
|
+
value
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
prices {
|
|
43
|
+
price {
|
|
44
|
+
currency
|
|
45
|
+
value
|
|
46
|
+
}
|
|
47
|
+
original_item_price {
|
|
48
|
+
currency
|
|
49
|
+
value
|
|
50
|
+
}
|
|
51
|
+
original_row_total {
|
|
52
|
+
currency
|
|
53
|
+
value
|
|
54
|
+
}
|
|
55
|
+
row_total {
|
|
56
|
+
currency
|
|
57
|
+
value
|
|
58
|
+
}
|
|
59
|
+
catalog_discount {
|
|
60
|
+
amount_off
|
|
61
|
+
percent_off
|
|
62
|
+
}
|
|
63
|
+
discounts {
|
|
64
|
+
label
|
|
65
|
+
value
|
|
66
|
+
amount {
|
|
67
|
+
currency
|
|
68
|
+
value
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
quantity
|
|
73
|
+
... on ConfigurableCartItem {
|
|
74
|
+
configurable_options {
|
|
75
|
+
option_label
|
|
76
|
+
value_label
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
... on BundleCartItem {
|
|
80
|
+
bundle_options {
|
|
81
|
+
label
|
|
82
|
+
values {
|
|
83
|
+
label
|
|
84
|
+
quantity
|
|
85
|
+
original_price {
|
|
86
|
+
currency
|
|
87
|
+
value
|
|
88
|
+
}
|
|
89
|
+
priceV2 {
|
|
90
|
+
currency
|
|
91
|
+
value
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
history {
|
|
98
|
+
uid
|
|
99
|
+
created_at
|
|
100
|
+
author {
|
|
101
|
+
firstname
|
|
102
|
+
lastname
|
|
103
|
+
}
|
|
104
|
+
change_type
|
|
105
|
+
changes {
|
|
106
|
+
comment_added {
|
|
107
|
+
comment
|
|
108
|
+
}
|
|
109
|
+
statuses {
|
|
110
|
+
changes {
|
|
111
|
+
new_status
|
|
112
|
+
old_status
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
expiration {
|
|
116
|
+
new_expiration
|
|
117
|
+
old_expiration
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
prices {
|
|
122
|
+
subtotal_excluding_tax {
|
|
123
|
+
currency
|
|
124
|
+
value
|
|
125
|
+
}
|
|
126
|
+
subtotal_including_tax {
|
|
127
|
+
currency
|
|
128
|
+
value
|
|
129
|
+
}
|
|
130
|
+
subtotal_with_discount_excluding_tax {
|
|
131
|
+
currency
|
|
132
|
+
value
|
|
133
|
+
}
|
|
134
|
+
applied_taxes {
|
|
135
|
+
amount {
|
|
136
|
+
currency
|
|
137
|
+
value
|
|
138
|
+
}
|
|
139
|
+
label
|
|
140
|
+
}
|
|
141
|
+
grand_total {
|
|
142
|
+
currency
|
|
143
|
+
value
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
shipping_addresses {
|
|
147
|
+
uid
|
|
148
|
+
firstname
|
|
149
|
+
lastname
|
|
150
|
+
company
|
|
151
|
+
street
|
|
152
|
+
city
|
|
153
|
+
region {
|
|
154
|
+
code
|
|
155
|
+
label
|
|
156
|
+
region_id
|
|
157
|
+
}
|
|
158
|
+
postcode
|
|
159
|
+
country {
|
|
160
|
+
code
|
|
161
|
+
label
|
|
162
|
+
}
|
|
163
|
+
telephone
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
`;export{e as N};
|
|
167
|
+
//# sourceMappingURL=NegotiableQuoteFragment.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NegotiableQuoteFragment.js","sources":["/@dropins/storefront-quote-management/src/api/graphql/NegotiableQuoteFragment.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\nexport const NEGOTIABLE_QUOTE_FRAGMENT = /* GraphQL */ `\n fragment NegotiableQuoteFragment on NegotiableQuote {\n uid\n name\n created_at\n status\n sales_rep_name\n expiration_date\n updated_at\n buyer {\n firstname\n lastname\n }\n comments {\n uid\n created_at\n author {\n firstname\n lastname\n }\n text\n }\n template_id\n template_name\n items {\n product {\n name\n sku\n uid\n stock_status\n quantity\n price_range {\n maximum_price {\n regular_price {\n value\n }\n }\n }\n }\n prices {\n price {\n currency\n value\n }\n original_item_price {\n currency\n value\n }\n original_row_total {\n currency\n value\n }\n row_total {\n currency\n value\n }\n catalog_discount {\n amount_off\n percent_off\n }\n discounts {\n label\n value\n amount {\n currency\n value\n }\n }\n }\n quantity\n ... on ConfigurableCartItem {\n\t\t\t\tconfigurable_options {\n\t\t\t\t\toption_label\n\t\t\t\t\tvalue_label\n\t\t\t\t}\n\t\t\t}\n\t\t\t... on BundleCartItem {\n\t\t\t\tbundle_options {\n\t\t\t\t\tlabel\n\t\t\t\t\tvalues {\n\t\t\t\t\t\tlabel\n\t\t\t\t\t\tquantity\n original_price {\n\t\t\t\t\t\t\tcurrency\n\t\t\t\t\t\t\tvalue\n\t\t\t\t\t\t}\n\t\t\t\t\t\tpriceV2 {\n\t\t\t\t\t\t\tcurrency\n\t\t\t\t\t\t\tvalue\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n }\n history {\n uid\n created_at\n author {\n firstname\n lastname\n }\n change_type\n changes {\n comment_added {\n comment\n }\n statuses {\n changes {\n new_status\n old_status\n }\n }\n expiration {\n new_expiration\n old_expiration\n }\n }\n }\n prices {\n subtotal_excluding_tax {\n currency\n value\n }\n subtotal_including_tax {\n currency\n value\n }\n subtotal_with_discount_excluding_tax {\n currency\n value\n }\n applied_taxes {\n amount {\n currency\n value\n }\n label\n }\n grand_total {\n currency\n value\n }\n }\n shipping_addresses {\n uid\n firstname\n lastname\n company\n street\n city\n region {\n code\n label\n region_id\n }\n postcode\n country {\n code\n label\n }\n telephone\n }\n }\n`;\n"],"names":["NEGOTIABLE_QUOTE_FRAGMENT"],"mappings":"AAiBO,MAAMA,EAA0C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/*! Copyright 2025 Adobe
|
|
2
|
+
All Rights Reserved. */
|
|
3
|
+
import*as e from"@dropins/tools/preact-compat.js";const l=t=>e.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},e.createElement("path",{vectorEffect:"non-scaling-stroke",fillRule:"evenodd",clipRule:"evenodd",d:"M1 20.8953L12.1922 1.5L23.395 20.8953H1ZM13.0278 13.9638L13.25 10.0377V9H11.25V10.0377L11.4722 13.9638H13.0278ZM11.2994 16V17.7509H13.2253V16H11.2994Z",fill:"currentColor"}));export{l as S};
|
|
4
|
+
//# sourceMappingURL=WarningFilled.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WarningFilled.js","sources":["../../node_modules/@adobe-commerce/elsie/src/icons/WarningFilled.svg"],"sourcesContent":["import * as React from \"react\";\nconst SvgWarningFilled = (props) => /* @__PURE__ */ React.createElement(\"svg\", { width: 24, height: 24, viewBox: \"0 0 24 24\", fill: \"none\", xmlns: \"http://www.w3.org/2000/svg\", ...props }, /* @__PURE__ */ React.createElement(\"path\", { vectorEffect: \"non-scaling-stroke\", fillRule: \"evenodd\", clipRule: \"evenodd\", d: \"M1 20.8953L12.1922 1.5L23.395 20.8953H1ZM13.0278 13.9638L13.25 10.0377V9H11.25V10.0377L11.4722 13.9638H13.0278ZM11.2994 16V17.7509H13.2253V16H11.2994Z\", fill: \"currentColor\" }));\nexport default SvgWarningFilled;\n"],"names":["SvgWarningFilled","props","React"],"mappings":"kDACK,MAACA,EAAoBC,GAA0BC,EAAM,cAAc,MAAO,CAAE,MAAO,GAAI,OAAQ,GAAI,QAAS,YAAa,KAAM,OAAQ,MAAO,6BAA8B,GAAGD,CAAK,EAAoBC,EAAM,cAAc,OAAQ,CAAE,aAAc,qBAAsB,SAAU,UAAW,SAAU,UAAW,EAAG,yJAA0J,KAAM,eAAgB,CAAC","x_google_ignoreList":[0]}
|
|
@@ -18,6 +18,17 @@ import{fetchGraphQl as n}from"@dropins/tools/fetch-graphql.js";import{s,a as i}f
|
|
|
18
18
|
currency
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
|
+
history {
|
|
22
|
+
change_type
|
|
23
|
+
changes {
|
|
24
|
+
statuses {
|
|
25
|
+
changes {
|
|
26
|
+
new_status
|
|
27
|
+
old_status
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
21
32
|
}
|
|
22
33
|
`,g=`
|
|
23
34
|
fragment SearchResultPageInfoFragment on SearchResultPageInfo {
|
|
@@ -62,5 +73,5 @@ import{fetchGraphQl as n}from"@dropins/tools/fetch-graphql.js";import{s,a as i}f
|
|
|
62
73
|
${u}
|
|
63
74
|
${g}
|
|
64
75
|
${l}
|
|
65
|
-
`;var
|
|
76
|
+
`;var _=(e=>(e.FULL="FULL",e.PARTIAL="PARTIAL",e))(_||{}),E=(e=>(e.ASC="ASC",e.DESC="DESC",e))(E||{}),f=(e=>(e.QUOTE_NAME="QUOTE_NAME",e.CREATED_AT="CREATED_AT",e.UPDATED_AT="UPDATED_AT",e))(f||{});const S=async(e={})=>{var r;if(!s.authenticated)return Promise.reject(new Error("Unauthorized"));const o={filter:e.filter||null,pageSize:e.pageSize||20,currentPage:e.currentPage||1,sort:e.sort||null};try{const t=await n(c,{variables:o});if(!((r=t==null?void 0:t.data)!=null&&r.negotiableQuotes))throw new Error("No quotes data received");const a=i(t.data.negotiableQuotes);if(!a)throw new Error("Failed to transform quotes data");return a}catch(t){return Promise.reject(t)}};export{_ as F,f as N,E as S,S as n};
|
|
66
77
|
//# sourceMappingURL=negotiableQuotes.js.map
|