@dropins/storefront-company-management 1.0.0-beta6 → 1.0.0-beta8
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/allowCompanyRegistration/allowCompanyRegistration.d.ts +18 -0
- package/api/allowCompanyRegistration/graphql/allowCompanyRegistration.graphql.d.ts +18 -0
- package/api/allowCompanyRegistration/index.d.ts +18 -0
- package/api/checkCompanyCreditEnabled/checkCompanyCreditEnabled.d.ts +4 -0
- package/api/checkCompanyCreditEnabled/graphql/checkCompanyCreditEnabled.graphql.d.ts +18 -0
- package/api/checkCompanyCreditEnabled/index.d.ts +18 -0
- package/api/companyEnabled/companyEnabled.d.ts +18 -0
- package/api/companyEnabled/graphql/companyEnabled.graphql.d.ts +18 -0
- package/api/{checkIsCompanyEnabled → companyEnabled}/index.d.ts +1 -1
- package/api/createCompany/createCompany.d.ts +39 -0
- package/api/createCompany/graphql/createCompany.graphql.d.ts +18 -0
- package/api/createCompany/index.d.ts +18 -0
- package/api/getCompanyCredit/getCompanyCredit.d.ts +4 -0
- package/api/getCompanyCredit/graphql/getCompanyCredit.graphql.d.ts +18 -0
- package/api/getCompanyCredit/index.d.ts +18 -0
- package/api/getCompanyCreditHistory/getCompanyCreditHistory.d.ts +5 -0
- package/api/getCompanyCreditHistory/graphql/getCompanyCreditHistory.graphql.d.ts +18 -0
- package/api/getCompanyCreditHistory/index.d.ts +19 -0
- package/api/getStoreConfig/getStoreConfig.d.ts +6 -0
- package/api/getStoreConfig/graphql/getStoreConfig.graphql.d.ts +18 -0
- package/api/getStoreConfig/index.d.ts +18 -0
- package/api/index.d.ts +9 -1
- package/api/isCompanyAdmin/graphql/isCompanyAdmin.graphql.d.ts +18 -0
- package/api/isCompanyAdmin/index.d.ts +18 -0
- package/api/isCompanyAdmin/isCompanyAdmin.d.ts +22 -0
- package/api/isCompanyUser/graphql/isCompanyUser.graphql.d.ts +18 -0
- package/api/isCompanyUser/index.d.ts +18 -0
- package/api/isCompanyUser/isCompanyUser.d.ts +22 -0
- package/api.js +22 -1
- package/api.js.map +1 -1
- package/chunks/CompanyLoaders.js +4 -0
- package/chunks/CompanyLoaders.js.map +1 -0
- package/chunks/createCompany.js +44 -0
- package/chunks/createCompany.js.map +1 -0
- package/chunks/fetch-error.js +4 -0
- package/chunks/fetch-error.js.map +1 -0
- package/chunks/fetch-graphql.js +4 -0
- package/chunks/fetch-graphql.js.map +1 -0
- package/chunks/getCompanyCreditHistory.js +68 -0
- package/chunks/getCompanyCreditHistory.js.map +1 -0
- package/chunks/getCustomerCompany.js +8 -2
- package/chunks/getCustomerCompany.js.map +1 -1
- package/chunks/isCompanyUser.js +21 -0
- package/chunks/isCompanyUser.js.map +1 -0
- package/chunks/network-error.js +4 -0
- package/chunks/network-error.js.map +1 -0
- package/chunks/updateCompany.js +92 -0
- package/chunks/updateCompany.js.map +1 -0
- package/chunks/validateCompanyEmail.js +21 -2
- package/chunks/validateCompanyEmail.js.map +1 -1
- package/components/CompanyCreditDisplay/CompanyCreditDisplay.d.ts +7 -0
- package/components/CompanyCreditDisplay/index.d.ts +19 -0
- package/components/CompanyCreditHistoryDisplay/CompanyCreditHistoryDisplay.d.ts +15 -0
- package/components/CompanyCreditHistoryDisplay/index.d.ts +19 -0
- package/components/CompanyLoaders/CompanyLoaders.d.ts +10 -0
- package/components/CompanyRegistrationForm/CompanyRegistrationForm.d.ts +13 -0
- package/components/CompanyRegistrationForm/Form/Form.d.ts +5 -0
- package/components/CompanyRegistrationForm/Form/FormInputs/FormInputs.d.ts +5 -0
- package/components/CompanyRegistrationForm/Form/FormInputs/index.d.ts +18 -0
- package/components/CompanyRegistrationForm/Form/fieldHandlers.d.ts +26 -0
- package/components/CompanyRegistrationForm/Form/fieldValidationRules.d.ts +63 -0
- package/components/CompanyRegistrationForm/Form/formValidation.d.ts +17 -0
- package/components/CompanyRegistrationForm/Form/getCompanyFieldsConfig.d.ts +13 -0
- package/components/CompanyRegistrationForm/Form/index.d.ts +18 -0
- package/components/CompanyRegistrationForm/index.d.ts +20 -0
- package/components/CompanyRegistrationSuccess/CompanyRegistrationSuccess.d.ts +8 -0
- package/components/CompanyRegistrationSuccess/index.d.ts +18 -0
- package/components/CompanyStructureEmpty/CompanyStructureEmpty.d.ts +9 -0
- package/components/CompanyStructureEmpty/index.d.ts +19 -0
- package/components/index.d.ts +5 -0
- package/containers/CompanyCredit/CompanyCredit.d.ts +16 -0
- package/containers/CompanyCredit/index.d.ts +19 -0
- package/containers/CompanyCredit.d.ts +3 -0
- package/containers/CompanyCredit.js +4 -0
- package/containers/CompanyCredit.js.map +1 -0
- package/containers/CompanyProfile.js +1 -1
- package/containers/CompanyProfile.js.map +1 -1
- package/containers/CompanyRegistration/CompanyRegistration.d.ts +15 -0
- package/containers/CompanyRegistration/index.d.ts +19 -0
- package/containers/CompanyRegistration.d.ts +3 -0
- package/containers/CompanyRegistration.js +4 -0
- package/containers/CompanyRegistration.js.map +1 -0
- package/containers/CompanyStructure/CompanyStructure.d.ts +10 -0
- package/containers/CompanyStructure/index.d.ts +19 -0
- package/containers/CompanyStructure.d.ts +3 -0
- package/containers/CompanyStructure.js +4 -0
- package/containers/CompanyStructure.js.map +1 -0
- package/containers/CustomerCompanyInfo.js +1 -1
- package/containers/CustomerCompanyInfo.js.map +1 -1
- package/containers/index.d.ts +3 -0
- package/data/models/company-credit-history.d.ts +54 -0
- package/data/models/company-credit-info.d.ts +33 -0
- package/data/models/company.d.ts +52 -0
- package/data/models/index.d.ts +2 -0
- package/data/transforms/company.d.ts +5 -0
- package/data/transforms/index.d.ts +3 -0
- package/data/transforms/transform-company-credit-history.d.ts +5 -0
- package/data/transforms/transform-company-credit.d.ts +5 -0
- package/data/transforms/transform-company.d.ts +5 -1
- package/data/transforms/transform-store-config.d.ts +4 -0
- package/hooks/containers/index.d.ts +1 -0
- package/hooks/containers/useCompanyCreditHistory.d.ts +32 -0
- package/hooks/index.d.ts +1 -0
- package/hooks/useCompanyContextListener.d.ts +62 -0
- package/hooks/useCompanyRegistrationForm.d.ts +37 -0
- package/hooks/useCountryAndRegionFields.d.ts +20 -0
- package/i18n/en_US.json.d.ts +81 -3
- package/package.json +1 -1
- package/render.js +7 -3
- package/render.js.map +1 -1
- package/types/api/{checkIsCompanyEnabled.types.d.ts → checkCompanyCreditEnabled.types.d.ts} +3 -3
- package/types/api/getCompanyCredit.types.d.ts +40 -0
- package/types/api/getCompanyCreditHistory.types.d.ts +61 -0
- package/types/api/getCompanyCreditHistoryParams.types.d.ts +53 -0
- package/types/api/getStoreConfig.types.d.ts +33 -0
- package/types/form.types.d.ts +93 -0
- package/types/index.d.ts +2 -1
- package/api/checkIsCompanyEnabled/checkIsCompanyEnabled.d.ts +0 -4
- package/chunks/getCountries.js +0 -111
- package/chunks/getCountries.js.map +0 -1
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/********************************************************************
|
|
2
|
+
* ADOBE CONFIDENTIAL
|
|
3
|
+
* __________________
|
|
4
|
+
*
|
|
5
|
+
* Copyright 2025 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 allowCompanyRegistration: () => Promise<boolean>;
|
|
18
|
+
//# sourceMappingURL=allowCompanyRegistration.d.ts.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/********************************************************************
|
|
2
|
+
* ADOBE CONFIDENTIAL
|
|
3
|
+
* __________________
|
|
4
|
+
*
|
|
5
|
+
* Copyright 2025 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 GET_ALLOW_COMPANY_REGISTRATION = "\n query GET_ALLOW_COMPANY_REGISTRATION {\n storeConfig {\n allow_company_registration\n }\n }\n";
|
|
18
|
+
//# sourceMappingURL=allowCompanyRegistration.graphql.d.ts.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/********************************************************************
|
|
2
|
+
* ADOBE CONFIDENTIAL
|
|
3
|
+
* __________________
|
|
4
|
+
*
|
|
5
|
+
* Copyright 2025 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 * from './allowCompanyRegistration';
|
|
18
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/********************************************************************
|
|
2
|
+
* ADOBE CONFIDENTIAL
|
|
3
|
+
* __________________
|
|
4
|
+
*
|
|
5
|
+
* Copyright 2025 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 CHECK_COMPANY_CREDIT_ENABLED = "\n query CHECK_COMPANY_CREDIT_ENABLED {\n storeConfig{\n company_credit_enabled\n }\n }\n";
|
|
18
|
+
//# sourceMappingURL=checkCompanyCreditEnabled.graphql.d.ts.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/********************************************************************
|
|
2
|
+
* ADOBE CONFIDENTIAL
|
|
3
|
+
* __________________
|
|
4
|
+
*
|
|
5
|
+
* Copyright 2025 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 * from './checkCompanyCreditEnabled';
|
|
18
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/********************************************************************
|
|
2
|
+
* ADOBE CONFIDENTIAL
|
|
3
|
+
* __________________
|
|
4
|
+
*
|
|
5
|
+
* Copyright 2025 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 companyEnabled: () => Promise<boolean>;
|
|
18
|
+
//# sourceMappingURL=companyEnabled.d.ts.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/********************************************************************
|
|
2
|
+
* ADOBE CONFIDENTIAL
|
|
3
|
+
* __________________
|
|
4
|
+
*
|
|
5
|
+
* Copyright 2025 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 GET_COMPANY_ENABLED = "\n query GET_COMPANY_ENABLED {\n storeConfig {\n company_enabled\n }\n }\n";
|
|
18
|
+
//# sourceMappingURL=companyEnabled.graphql.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 * from './
|
|
17
|
+
export * from './companyEnabled';
|
|
18
18
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { CompanyRegistrationModel } from '../../data/models/company';
|
|
2
|
+
|
|
3
|
+
export interface CompanyCreateInput {
|
|
4
|
+
company_name: string;
|
|
5
|
+
company_email: string;
|
|
6
|
+
legal_name?: string;
|
|
7
|
+
vat_tax_id?: string;
|
|
8
|
+
reseller_id?: string;
|
|
9
|
+
legal_address: {
|
|
10
|
+
street: string[];
|
|
11
|
+
city: string;
|
|
12
|
+
region: {
|
|
13
|
+
region_code: string;
|
|
14
|
+
region?: string;
|
|
15
|
+
region_id?: number;
|
|
16
|
+
};
|
|
17
|
+
postcode: string;
|
|
18
|
+
country_id: string;
|
|
19
|
+
telephone?: string;
|
|
20
|
+
};
|
|
21
|
+
company_admin: {
|
|
22
|
+
email: string;
|
|
23
|
+
firstname: string;
|
|
24
|
+
lastname: string;
|
|
25
|
+
job_title?: string;
|
|
26
|
+
telephone?: string;
|
|
27
|
+
gender?: number;
|
|
28
|
+
custom_attributes?: Array<{
|
|
29
|
+
attribute_code: string;
|
|
30
|
+
value: string;
|
|
31
|
+
}>;
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
export declare const createCompany: (formData: any) => Promise<{
|
|
35
|
+
success: boolean;
|
|
36
|
+
company?: CompanyRegistrationModel;
|
|
37
|
+
errors?: string[];
|
|
38
|
+
}>;
|
|
39
|
+
//# sourceMappingURL=createCompany.d.ts.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/********************************************************************
|
|
2
|
+
* ADOBE CONFIDENTIAL
|
|
3
|
+
* __________________
|
|
4
|
+
*
|
|
5
|
+
* Copyright 2025 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 CREATE_COMPANY_MUTATION = "\n mutation CreateCompany($input: CompanyCreateInput!) {\n createCompany(input: $input) {\n company {\n id\n name\n email\n legal_name\n vat_tax_id\n reseller_id\n legal_address {\n street\n city\n region {\n region_code\n region\n region_id\n }\n postcode\n country_code\n telephone\n }\n company_admin {\n id\n firstname\n lastname\n email\n job_title\n telephone\n }\n }\n }\n }\n";
|
|
18
|
+
//# sourceMappingURL=createCompany.graphql.d.ts.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/********************************************************************
|
|
2
|
+
* ADOBE CONFIDENTIAL
|
|
3
|
+
* __________________
|
|
4
|
+
*
|
|
5
|
+
* Copyright 2025 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 * from './createCompany';
|
|
18
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/********************************************************************
|
|
2
|
+
* ADOBE CONFIDENTIAL
|
|
3
|
+
* __________________
|
|
4
|
+
*
|
|
5
|
+
* Copyright 2025 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 GET_COMPANY_CREDIT = "\n query GET_COMPANY_CREDIT \n {\n company {\n credit {\n available_credit {\n currency\n value\n }\n credit_limit {\n currency\n value\n }\n outstanding_balance {\n currency\n value\n }\n }\n }\n }\n";
|
|
18
|
+
//# sourceMappingURL=getCompanyCredit.graphql.d.ts.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/********************************************************************
|
|
2
|
+
* ADOBE CONFIDENTIAL
|
|
3
|
+
* __________________
|
|
4
|
+
*
|
|
5
|
+
* Copyright 2025 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 * from './getCompanyCredit';
|
|
18
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { GetCompanyCreditHistoryParams } from '../../types/api/getCompanyCreditHistoryParams.types';
|
|
2
|
+
import { CompanyCreditHistory } from '../../data/models';
|
|
3
|
+
|
|
4
|
+
export declare const getCompanyCreditHistory: (params?: GetCompanyCreditHistoryParams) => Promise<CompanyCreditHistory | null>;
|
|
5
|
+
//# sourceMappingURL=getCompanyCreditHistory.d.ts.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/********************************************************************
|
|
2
|
+
* ADOBE CONFIDENTIAL
|
|
3
|
+
* __________________
|
|
4
|
+
*
|
|
5
|
+
* Copyright 2025 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 GET_COMPANY_CREDIT_HISTORY = "\n query GET_COMPANY_CREDIT_HISTORY($filter: CompanyCreditHistoryFilterInput, $pageSize: Int, $currentPage: Int) {\n company {\n credit_history(\n filter: $filter\n pageSize: $pageSize\n currentPage: $currentPage\n ) {\n items {\n amount {\n currency\n value\n }\n balance {\n available_credit {\n currency\n value\n }\n credit_limit {\n currency\n value\n }\n outstanding_balance {\n currency\n value\n }\n }\n custom_reference_number\n date\n type\n updated_by {\n name\n type\n }\n }\n page_info {\n current_page\n page_size\n total_pages\n }\n total_count\n }\n }\n }\n";
|
|
18
|
+
//# sourceMappingURL=getCompanyCreditHistory.graphql.d.ts.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/********************************************************************
|
|
2
|
+
* ADOBE CONFIDENTIAL
|
|
3
|
+
* __________________
|
|
4
|
+
*
|
|
5
|
+
* Copyright 2025 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 * from './getCompanyCreditHistory';
|
|
18
|
+
export * from '../../types/api/getCompanyCreditHistoryParams.types';
|
|
19
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { StoreConfigModel } from '../../types';
|
|
2
|
+
|
|
3
|
+
export declare const DEFAULT_COUNTRY = "US";
|
|
4
|
+
export declare const STORE_CONFIG_DEFAULTS: StoreConfigModel;
|
|
5
|
+
export declare const getStoreConfig: () => Promise<StoreConfigModel>;
|
|
6
|
+
//# sourceMappingURL=getStoreConfig.d.ts.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/********************************************************************
|
|
2
|
+
* ADOBE CONFIDENTIAL
|
|
3
|
+
* __________________
|
|
4
|
+
*
|
|
5
|
+
* Copyright 2025 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 GET_STORE_CONFIG_QUERY = "\n query getStoreConfig {\n storeConfig {\n default_country\n store_code\n }\n }\n";
|
|
18
|
+
//# sourceMappingURL=getStoreConfig.graphql.d.ts.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/********************************************************************
|
|
2
|
+
* ADOBE CONFIDENTIAL
|
|
3
|
+
* __________________
|
|
4
|
+
*
|
|
5
|
+
* Copyright 2025 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 { getStoreConfig, STORE_CONFIG_DEFAULTS, DEFAULT_COUNTRY } from './getStoreConfig';
|
|
18
|
+
//# sourceMappingURL=index.d.ts.map
|
package/api/index.d.ts
CHANGED
|
@@ -17,10 +17,18 @@
|
|
|
17
17
|
export * from './initialize';
|
|
18
18
|
export * from './fetch-graphql';
|
|
19
19
|
export * from './fetchUserPermissions';
|
|
20
|
-
export * from './checkIsCompanyEnabled';
|
|
21
20
|
export * from './getCompany';
|
|
22
21
|
export * from './updateCompany';
|
|
23
22
|
export * from './getCountries';
|
|
23
|
+
export * from './getStoreConfig';
|
|
24
24
|
export * from './validateCompanyEmail';
|
|
25
25
|
export * from './getCustomerCompany';
|
|
26
|
+
export * from './companyEnabled';
|
|
27
|
+
export * from './allowCompanyRegistration';
|
|
28
|
+
export * from './createCompany';
|
|
29
|
+
export * from './isCompanyUser';
|
|
30
|
+
export * from './isCompanyAdmin';
|
|
31
|
+
export * from './getCompanyCredit';
|
|
32
|
+
export * from './getCompanyCreditHistory';
|
|
33
|
+
export * from './checkCompanyCreditEnabled';
|
|
26
34
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/********************************************************************
|
|
2
|
+
* ADOBE CONFIDENTIAL
|
|
3
|
+
* __________________
|
|
4
|
+
*
|
|
5
|
+
* Copyright 2025 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 GET_CUSTOMER_COMPANIES_WITH_ROLES = "\n query GET_CUSTOMER_COMPANIES_WITH_ROLES {\n customer {\n companies(input: {}) {\n items {\n id\n name\n }\n }\n role {\n id\n name\n }\n }\n }\n";
|
|
18
|
+
//# sourceMappingURL=isCompanyAdmin.graphql.d.ts.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/********************************************************************
|
|
2
|
+
* ADOBE CONFIDENTIAL
|
|
3
|
+
* __________________
|
|
4
|
+
*
|
|
5
|
+
* Copyright 2025 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 * from './isCompanyAdmin';
|
|
18
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/********************************************************************
|
|
2
|
+
* ADOBE CONFIDENTIAL
|
|
3
|
+
* __________________
|
|
4
|
+
*
|
|
5
|
+
* Copyright 2025 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
|
+
/**
|
|
18
|
+
* Check if the current authenticated customer is a company administrator in any company
|
|
19
|
+
* @returns Promise<boolean> - true if customer is a company admin in at least one company, false otherwise
|
|
20
|
+
*/
|
|
21
|
+
export declare const isCompanyAdmin: () => Promise<boolean>;
|
|
22
|
+
//# sourceMappingURL=isCompanyAdmin.d.ts.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/********************************************************************
|
|
2
|
+
* ADOBE CONFIDENTIAL
|
|
3
|
+
* __________________
|
|
4
|
+
*
|
|
5
|
+
* Copyright 2025 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 GET_CUSTOMER_COMPANIES = "\n query GET_CUSTOMER_COMPANIES {\n customer {\n companies(input: {}) {\n items {\n id\n name\n }\n }\n }\n }\n";
|
|
18
|
+
//# sourceMappingURL=isCompanyUser.graphql.d.ts.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/********************************************************************
|
|
2
|
+
* ADOBE CONFIDENTIAL
|
|
3
|
+
* __________________
|
|
4
|
+
*
|
|
5
|
+
* Copyright 2025 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 * from './isCompanyUser';
|
|
18
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/********************************************************************
|
|
2
|
+
* ADOBE CONFIDENTIAL
|
|
3
|
+
* __________________
|
|
4
|
+
*
|
|
5
|
+
* Copyright 2025 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
|
+
/**
|
|
18
|
+
* Check if the current authenticated customer belongs to any company
|
|
19
|
+
* @returns Promise<boolean> - true if customer belongs to one or more companies, false otherwise
|
|
20
|
+
*/
|
|
21
|
+
export declare const isCompanyUser: () => Promise<boolean>;
|
|
22
|
+
//# sourceMappingURL=isCompanyUser.d.ts.map
|
package/api.js
CHANGED
|
@@ -1,4 +1,25 @@
|
|
|
1
1
|
/*! Copyright 2025 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
|
-
import{f as
|
|
3
|
+
import{f as i}from"./chunks/fetch-graphql.js";import{g as A,r as T,s as R,a as b,b as S}from"./chunks/fetch-graphql.js";import{f as O,g as N,u as I}from"./chunks/updateCompany.js";import{g as L,v as M}from"./chunks/validateCompanyEmail.js";import{D,S as x,c as G,g as F}from"./chunks/createCompany.js";import{c as B,g as Q}from"./chunks/getCustomerCompany.js";import{a as w,i as Y}from"./chunks/isCompanyUser.js";import{g as K,a as W}from"./chunks/getCompanyCreditHistory.js";import"@dropins/tools/fetch-graphql.js";import"./chunks/network-error.js";import"@dropins/tools/event-bus.js";import"./chunks/fetch-error.js";const u=async(e={})=>({success:!0,config:e}),c=`
|
|
4
|
+
query GET_CUSTOMER_COMPANIES_WITH_ROLES {
|
|
5
|
+
customer {
|
|
6
|
+
companies(input: {}) {
|
|
7
|
+
items {
|
|
8
|
+
id
|
|
9
|
+
name
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
role {
|
|
13
|
+
id
|
|
14
|
+
name
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
`,y=async()=>{var e,t,a;try{const r=await i(c,{method:"POST"});if((e=r.errors)!=null&&e.length)return!1;const n=(t=r.data)==null?void 0:t.customer;if(!n)return!1;const s=((a=n.companies)==null?void 0:a.items)??[];if(!Array.isArray(s)||s.length===0)return!1;const o=n.role;return o?o.id==="0"||typeof o.id=="number"&&o.id===0||o.name==="Company Administrator":!1}catch(r){return console.error("Error checking if customer is company admin:",r),!1}};var m=(e=>(e.ALLOCATION="ALLOCATION",e.UPDATE="UPDATE",e.PURCHASE="PURCHASE",e.REIMBURSEMENT="REIMBURSEMENT",e))(m||{});const E=`
|
|
19
|
+
query CHECK_COMPANY_CREDIT_ENABLED {
|
|
20
|
+
storeConfig{
|
|
21
|
+
company_credit_enabled
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
`,g=async()=>{var e,t,a;try{const r=await i(E,{method:"GET",cache:"no-cache"});return(e=r.errors)!=null&&e.length?{creditEnabled:!1,error:"Unable to check company credit configuration"}:((a=(t=r.data)==null?void 0:t.storeConfig)==null?void 0:a.company_credit_enabled)===!0?{creditEnabled:!0}:{creditEnabled:!1,error:"Company credit is not enabled in store configuration"}}catch{return{creditEnabled:!1,error:"Company credit functionality not available"}}};export{m as CompanyCreditOperationType,D as DEFAULT_COUNTRY,x as STORE_CONFIG_DEFAULTS,w as allowCompanyRegistration,g as checkCompanyCreditEnabled,B as companyEnabled,G as createCompany,i as fetchGraphQl,O as fetchUserPermissions,N as getCompany,K as getCompanyCredit,W as getCompanyCreditHistory,A as getConfig,L as getCountries,Q as getCustomerCompany,F as getStoreConfig,u as initialize,y as isCompanyAdmin,Y as isCompanyUser,T as removeFetchGraphQlHeader,R as setEndpoint,b as setFetchGraphQlHeader,S as setFetchGraphQlHeaders,I as updateCompany,M as validateCompanyEmail};
|
|
4
25
|
//# sourceMappingURL=api.js.map
|
package/api.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.js","sources":["/@dropins/storefront-company-management/src/api/initialize/initialize.ts"],"sourcesContent":["/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 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\n// import { events } from '@adobe-commerce/event-bus';\n\n\nexport interface CompanyDropinConfig {\n langDefinitions?: Record<string, Record<string, string>>;\n models?: Record<string, any>;\n}\n\nexport const initialize = async (config: CompanyDropinConfig = {}) => {\n return {\n success: true,\n config,\n };\n};\n"],"names":["initialize","config"],"mappings":"kSAyBO,MAAMA,EAAa,MAAOC,EAA8B,MACtD,CACL,QAAS,GACT,OAAAA,CACF"}
|
|
1
|
+
{"version":3,"file":"api.js","sources":["/@dropins/storefront-company-management/src/api/initialize/initialize.ts","/@dropins/storefront-company-management/src/api/isCompanyAdmin/graphql/isCompanyAdmin.graphql.ts","/@dropins/storefront-company-management/src/api/isCompanyAdmin/isCompanyAdmin.ts","/@dropins/storefront-company-management/src/types/api/getCompanyCreditHistoryParams.types.ts","/@dropins/storefront-company-management/src/api/checkCompanyCreditEnabled/graphql/checkCompanyCreditEnabled.graphql.ts","/@dropins/storefront-company-management/src/api/checkCompanyCreditEnabled/checkCompanyCreditEnabled.ts"],"sourcesContent":["/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 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\n// import { events } from '@adobe-commerce/event-bus';\n\n\nexport interface CompanyDropinConfig {\n langDefinitions?: Record<string, Record<string, string>>;\n models?: Record<string, any>;\n}\n\nexport const initialize = async (config: CompanyDropinConfig = {}) => {\n return {\n success: true,\n config,\n };\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 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 GET_CUSTOMER_COMPANIES_WITH_ROLES = /* GraphQL */ `\n query GET_CUSTOMER_COMPANIES_WITH_ROLES {\n customer {\n companies(input: {}) {\n items {\n id\n name\n }\n }\n role {\n id\n name\n }\n }\n }\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 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 { fetchGraphQl } from '../fetch-graphql';\nimport { GET_CUSTOMER_COMPANIES_WITH_ROLES } from './graphql/isCompanyAdmin.graphql';\n\ninterface CompanyRole {\n id: string;\n name: string;\n}\n\ninterface CompanyBasicInfo {\n id: string;\n name: string;\n}\n\ninterface CustomerCompaniesWithRolesResponse {\n customer: {\n companies: {\n items: CompanyBasicInfo[];\n };\n role: CompanyRole | null;\n } | null;\n}\n\n/**\n * Check if the current authenticated customer is a company administrator in any company\n * @returns Promise<boolean> - true if customer is a company admin in at least one company, false otherwise\n */\nexport const isCompanyAdmin = async (): Promise<boolean> => {\n try {\n const response = await fetchGraphQl<CustomerCompaniesWithRolesResponse>(GET_CUSTOMER_COMPANIES_WITH_ROLES, {\n method: 'POST',\n });\n\n if (response.errors?.length) {\n return false;\n }\n\n const customer = response.data?.customer;\n if (!customer) {\n return false;\n }\n\n // Check if user is part of at least one company\n const companies = customer.companies?.items ?? [];\n if (!Array.isArray(companies) || companies.length === 0) {\n return false;\n }\n\n // Check if user has admin role\n const customerRole = customer.role;\n if (!customerRole) {\n return false;\n }\n\n // Check if user is company administrator by role ID or name\n return customerRole.id === '0' || \n (typeof customerRole.id === 'number' && customerRole.id === 0) ||\n customerRole.name === 'Company Administrator';\n } catch (error) {\n console.error('Error checking if customer is company admin:', error);\n return false;\n }\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 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 enum CompanyCreditOperationType {\n ALLOCATION = 'ALLOCATION',\n UPDATE = 'UPDATE',\n PURCHASE = 'PURCHASE',\n REIMBURSEMENT = 'REIMBURSEMENT'\n}\n\nexport interface CompanyCreditHistoryFilterInput {\n /**\n * The purchase order number associated with the company credit operation.\n */\n customReferenceNumber?: string;\n\n /**\n * The type of the company credit operation.\n */\n operationType?: CompanyCreditOperationType;\n\n /**\n * The name of the person submitting the company credit operation.\n */\n updatedBy?: string;\n}\n\nexport interface GetCompanyCreditHistoryParams {\n /**\n * Filter criteria for narrowing the results of a credit history search.\n */\n filter?: CompanyCreditHistoryFilterInput;\n\n /**\n * Number of items to return per page.\n * @default 20\n */\n pageSize?: number;\n\n /**\n * Current page number.\n * @default 1\n */\n currentPage?: number;\n}\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 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 CHECK_COMPANY_CREDIT_ENABLED = /* GraphQL */ `\n query CHECK_COMPANY_CREDIT_ENABLED {\n storeConfig{\n company_credit_enabled\n }\n }\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 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 { CHECK_COMPANY_CREDIT_ENABLED } from \"./graphql/checkCompanyCreditEnabled.graphql\";\nimport { CheckCompanyCreditEnabledResponse } from '../../types/api/checkCompanyCreditEnabled.types';\nimport { fetchGraphQl } from '../fetch-graphql';\n\nexport const checkCompanyCreditEnabled = async (): Promise<CheckCompanyCreditEnabledResponse> => {\n try {\n const response = await fetchGraphQl(CHECK_COMPANY_CREDIT_ENABLED, {\n method: 'GET',\n cache: 'no-cache',\n });\n\n // If there are errors, return false with error message\n if (response.errors?.length) {\n return {\n creditEnabled: false,\n error: 'Unable to check company credit configuration'\n };\n }\n\n // Check if company credit is enabled in store config\n const companyCreditEnabled = response.data?.storeConfig?.company_credit_enabled;\n \n if (companyCreditEnabled === true) {\n return {\n creditEnabled: true\n };\n }\n\n // If company credit is disabled or not configured\n return {\n creditEnabled: false,\n error: 'Company credit is not enabled in store configuration'\n };\n\n } catch (error) {\n return {\n creditEnabled: false,\n error: 'Company credit functionality not available'\n };\n }\n};\n"],"names":["initialize","config","GET_CUSTOMER_COMPANIES_WITH_ROLES","isCompanyAdmin","response","fetchGraphQl","_a","customer","_b","companies","_c","customerRole","error","CompanyCreditOperationType","CHECK_COMPANY_CREDIT_ENABLED","checkCompanyCreditEnabled"],"mappings":"0mBAyBO,MAAMA,EAAa,MAAOC,EAA8B,MACtD,CACL,QAAS,GACT,OAAAA,CACF,GCZWC,EAAkD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EC0BlDC,EAAiB,SAA8B,WACtD,GAAA,CACI,MAAAC,EAAW,MAAMC,EAAiDH,EAAmC,CACzG,OAAQ,MAAA,CACT,EAEG,IAAAI,EAAAF,EAAS,SAAT,MAAAE,EAAiB,OACZ,MAAA,GAGH,MAAAC,GAAWC,EAAAJ,EAAS,OAAT,YAAAI,EAAe,SAChC,GAAI,CAACD,EACI,MAAA,GAIT,MAAME,IAAYC,EAAAH,EAAS,YAAT,YAAAG,EAAoB,QAAS,CAAC,EAChD,GAAI,CAAC,MAAM,QAAQD,CAAS,GAAKA,EAAU,SAAW,EAC7C,MAAA,GAIT,MAAME,EAAeJ,EAAS,KAC9B,OAAKI,EAKEA,EAAa,KAAO,KACnB,OAAOA,EAAa,IAAO,UAAYA,EAAa,KAAO,GAC5DA,EAAa,OAAS,wBANpB,SAOFC,EAAO,CACN,eAAA,MAAM,+CAAgDA,CAAK,EAC5D,EAAA,CAEX,EC7DY,IAAAC,GAAAA,IACVA,EAAA,WAAa,aACbA,EAAA,OAAS,SACTA,EAAA,SAAW,WACXA,EAAA,cAAgB,gBAJNA,IAAAA,GAAA,CAAA,CAAA,ECAC,MAAAC,EAA6C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,ECI7CC,EAA4B,SAAwD,WAC3F,GAAA,CACI,MAAAX,EAAW,MAAMC,EAAaS,EAA8B,CAChE,OAAQ,MACR,MAAO,UAAA,CACR,EAGG,OAAAR,EAAAF,EAAS,SAAT,MAAAE,EAAiB,OACZ,CACL,cAAe,GACf,MAAO,8CACT,IAI2BI,GAAAF,EAAAJ,EAAS,OAAT,YAAAI,EAAe,cAAf,YAAAE,EAA4B,0BAE5B,GACpB,CACL,cAAe,EACjB,EAIK,CACL,cAAe,GACf,MAAO,sDACT,OAEc,CACP,MAAA,CACL,cAAe,GACf,MAAO,4CACT,CAAA,CAEJ"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/*! Copyright 2025 Adobe
|
|
2
|
+
All Rights Reserved. */
|
|
3
|
+
import{jsxs as t,jsx as e}from"@dropins/tools/preact-jsx-runtime.js";import{Card as o,Skeleton as i,SkeletonRow as a}from"@dropins/tools/components.js";import{classes as s}from"@dropins/tools/lib.js";const h=({testId:r,withCard:l=!0})=>{const n=t(i,{"data-testid":r||"companySkeletonLoader",children:[e(a,{variant:"heading",size:"xlarge",fullWidth:!1,lines:1}),e(a,{variant:"heading",size:"xlarge",fullWidth:!0,lines:1}),e(a,{variant:"heading",size:"xlarge",fullWidth:!0,lines:1})]});return l?n:e(o,{variant:"secondary",className:s(["company-company-loaders","company-company-loaders--card-loader"]),children:n})},p=({testId:r})=>t("div",{className:"company-credit-skeleton-loader","data-testid":r||"companyCreditSkeletonLoader",children:[e(i,{children:e(a,{variant:"row",size:"small",lines:2})}),e(i,{children:e(a,{variant:"row",size:"small",lines:2})}),e(i,{children:e(a,{variant:"row",size:"small",lines:2})})]}),y=({testId:r})=>e("div",{className:"company-credit-history-skeleton-loader","data-testid":r||"companyCreditHistorySkeletonLoader",children:e(i,{children:e(a,{variant:"row",size:"small",fullWidth:!0,lines:3})})});export{h as C,p as a,y as b};
|
|
4
|
+
//# sourceMappingURL=CompanyLoaders.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CompanyLoaders.js","sources":["/@dropins/storefront-company-management/src/components/CompanyLoaders/CompanyLoaders.tsx"],"sourcesContent":["/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 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 { Skeleton, SkeletonRow, Card } from '@adobe-commerce/elsie/components';\nimport './CompanyLoaders.css';\nimport { classes } from '@adobe-commerce/elsie/lib';\n\nexport const CompanyCardLoader = ({\n testId,\n withCard = true,\n}: {\n testId?: string;\n withCard?: boolean;\n}) => {\n const defaultSkeleton = (\n <Skeleton data-testid={testId || 'companySkeletonLoader'}>\n <SkeletonRow\n variant=\"heading\"\n size=\"xlarge\"\n fullWidth={false}\n lines={1}\n />\n <SkeletonRow variant=\"heading\" size=\"xlarge\" fullWidth={true} lines={1} />\n <SkeletonRow variant=\"heading\" size=\"xlarge\" fullWidth={true} lines={1} />\n </Skeleton>\n );\n\n if (withCard) {\n return defaultSkeleton;\n }\n\n return (\n <Card\n variant=\"secondary\"\n className={classes([\n 'company-company-loaders',\n 'company-company-loaders--card-loader',\n ])}\n >\n {defaultSkeleton}\n </Card>\n );\n};\n\nexport const CompanyUsersTableLoader = ({ testId }: { testId?: string }) => {\n return (\n <div className=\"company-users-skeleton-loader\" data-testid={testId || 'companyUsersSkeletonLoader'}>\n <Skeleton>\n <SkeletonRow variant=\"row\" size=\"small\" fullWidth={true} lines={3} />\n </Skeleton>\n </div>\n );\n};\n\nexport const CompanyCreditLoader = ({ testId }: { testId?: string }) => {\n return (\n <div className=\"company-credit-skeleton-loader\" data-testid={testId || 'companyCreditSkeletonLoader'}>\n <Skeleton>\n <SkeletonRow variant=\"row\" size=\"small\" lines={2} />\n </Skeleton>\n <Skeleton>\n <SkeletonRow variant=\"row\" size=\"small\" lines={2} />\n </Skeleton>\n <Skeleton>\n <SkeletonRow variant=\"row\" size=\"small\" lines={2} />\n </Skeleton>\n </div>\n );\n};\nexport const CompanyCreditHistoryLoader = ({ testId }: { testId?: string }) => {\n return (\n <div className=\"company-credit-history-skeleton-loader\" data-testid={testId || 'companyCreditHistorySkeletonLoader'}>\n <Skeleton>\n <SkeletonRow variant=\"row\" size=\"small\" fullWidth={true} lines={3} />\n </Skeleton>\n </div>\n );\n};\n\nexport const CompanyUserFormLoader = () => {\n return (\n <div className=\"company-user-form-skeleton-loader\" data-testid=\"companyUserFormLoader\">\n <Skeleton>\n <SkeletonRow variant=\"row\" size=\"medium\" fullWidth={true} lines={7} />\n </Skeleton>\n </div>\n );\n};\n"],"names":["CompanyCardLoader","testId","withCard","defaultSkeleton","jsxs","Skeleton","jsx","SkeletonRow","Card","classes","CompanyCreditLoader","CompanyCreditHistoryLoader"],"mappings":"wMAoBO,MAAMA,EAAoB,CAAC,CAChC,OAAAC,EACA,SAAAC,EAAW,EACb,IAGM,CACJ,MAAMC,EACJC,EAACC,EAAS,CAAA,cAAaJ,GAAU,wBAC/B,SAAA,CAAAK,EAACC,EAAA,CACC,QAAQ,UACR,KAAK,SACL,UAAW,GACX,MAAO,CAAA,CACT,EACAD,EAACC,GAAY,QAAQ,UAAU,KAAK,SAAS,UAAW,GAAM,MAAO,CAAG,CAAA,EACxED,EAACC,GAAY,QAAQ,UAAU,KAAK,SAAS,UAAW,GAAM,MAAO,CAAG,CAAA,CAAA,EAC1E,EAGF,OAAIL,EACKC,EAIPG,EAACE,EAAA,CACC,QAAQ,YACR,UAAWC,EAAQ,CACjB,0BACA,sCAAA,CACD,EAEA,SAAAN,CAAA,CACH,CAEJ,EAYaO,EAAsB,CAAC,CAAE,OAAAT,OAEjC,MAAI,CAAA,UAAU,iCAAiC,cAAaA,GAAU,8BACrE,SAAA,CAACK,EAAAD,EAAA,CACC,WAACE,EAAY,CAAA,QAAQ,MAAM,KAAK,QAAQ,MAAO,CAAA,CAAG,CACpD,CAAA,EACAD,EAACD,EACC,CAAA,SAAAC,EAACC,EAAY,CAAA,QAAQ,MAAM,KAAK,QAAQ,MAAO,CAAA,CAAG,CACpD,CAAA,EACAD,EAACD,EACC,CAAA,SAAAC,EAACC,EAAY,CAAA,QAAQ,MAAM,KAAK,QAAQ,MAAO,CAAG,CAAA,CACpD,CAAA,CAAA,EACF,EAGSI,EAA6B,CAAC,CAAE,OAAAV,KAEzCK,EAAC,OAAI,UAAU,yCAAyC,cAAaL,GAAU,qCAC3E,WAACI,EACC,CAAA,SAAAC,EAACC,GAAY,QAAQ,MAAM,KAAK,QAAQ,UAAW,GAAM,MAAO,EAAG,EACrE,CACJ,CAAA"}
|