@reactionary/hcl 0.9.12 → 0.9.14
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/capabilities/analytics.capability.js +98 -0
- package/capabilities/company.capability.js +307 -0
- package/capabilities/personalization-profile.capability.js +85 -0
- package/capabilities/product-associations.capability.js +117 -0
- package/capabilities/product-list.capability.js +665 -0
- package/capabilities/product-recommendations.capability.js +143 -0
- package/capabilities/store.capability.js +72 -0
- package/core/initialize.js +148 -2
- package/factories/company/company.factory.js +77 -0
- package/factories/index.js +6 -0
- package/factories/personalization-profile/personalization-profile.factory.js +16 -0
- package/factories/product-associations/product-associations.factory.js +16 -0
- package/factories/product-list/product-list.factory.js +158 -0
- package/factories/product-recommendations/product-recommendations.factory.js +17 -0
- package/factories/store/store.factory.js +18 -0
- package/index.js +7 -0
- package/package.json +2 -2
- package/schema/capabilities.schema.js +16 -2
- package/schema/configuration.schema.js +37 -1
- package/src/capabilities/analytics.capability.d.ts +17 -0
- package/src/capabilities/company.capability.d.ts +26 -0
- package/src/capabilities/personalization-profile.capability.d.ts +19 -0
- package/src/capabilities/product-associations.capability.d.ts +22 -0
- package/src/capabilities/product-list.capability.d.ts +42 -0
- package/src/capabilities/product-recommendations.capability.d.ts +29 -0
- package/src/capabilities/store.capability.d.ts +13 -0
- package/src/core/initialize.types.d.ts +7 -1
- package/src/factories/company/company.factory.d.ts +11 -0
- package/src/factories/index.d.ts +6 -0
- package/src/factories/personalization-profile/personalization-profile.factory.d.ts +11 -0
- package/src/factories/product-associations/product-associations.factory.d.ts +8 -0
- package/src/factories/product-list/product-list.factory.d.ts +40 -0
- package/src/factories/product-recommendations/product-recommendations.factory.d.ts +12 -0
- package/src/factories/store/store.factory.d.ts +8 -0
- package/src/index.d.ts +7 -0
- package/src/schema/capabilities.schema.d.ts +45 -1
- package/src/schema/configuration.schema.d.ts +24 -0
- package/src/schema/hcl.schema.d.ts +277 -1
- package/src/test/test-utils.d.ts +4 -1
|
@@ -234,7 +234,7 @@ export interface HclProductResponse extends HclProductSearchItem {
|
|
|
234
234
|
components?: HclProductResponse[];
|
|
235
235
|
/** Quantity — only present on components array elements */
|
|
236
236
|
quantity?: string;
|
|
237
|
-
merchandisingAssociations?:
|
|
237
|
+
merchandisingAssociations?: HclAssociation[];
|
|
238
238
|
attachments?: HclAttachment[];
|
|
239
239
|
images?: HclImage[];
|
|
240
240
|
/**
|
|
@@ -694,3 +694,279 @@ export interface HclWcsOrderHistoryResponse {
|
|
|
694
694
|
recordSetStartNumber?: string;
|
|
695
695
|
recordSetComplete?: string;
|
|
696
696
|
}
|
|
697
|
+
/**
|
|
698
|
+
* A product item returned within a `merchandisingAssociations` array on a
|
|
699
|
+
* HCL detail-profile product response. Extends the search item shape with
|
|
700
|
+
* an `associationCodeType` that identifies the semantic relationship.
|
|
701
|
+
*
|
|
702
|
+
* Known values: 'ACCESSORY', 'SPAREPART', 'REPLACEMENT', 'CROSSSELL', 'UPSELL', 'UPGRADE'
|
|
703
|
+
*/
|
|
704
|
+
export interface HclAssociation extends HclProductSearchItem {
|
|
705
|
+
/** The association type code. e.g. 'ACCESSORY', 'SPAREPART', 'REPLACEMENT'. */
|
|
706
|
+
associationCodeType?: string;
|
|
707
|
+
/** Display sequence for ordering associations within a type. */
|
|
708
|
+
associationSequence?: string;
|
|
709
|
+
}
|
|
710
|
+
/**
|
|
711
|
+
* A single activity data entry within a marketing spot response.
|
|
712
|
+
* When `baseMarketingSpotDataType` is 'CatalogEntry' or 'CatalogEntryId',
|
|
713
|
+
* the entry represents a product recommendation from the spot.
|
|
714
|
+
*/
|
|
715
|
+
export interface HclEspotActivityData {
|
|
716
|
+
/** 'CatalogEntry' | 'CatalogEntryId' | 'CatalogGroupId' | 'MarketingContent' */
|
|
717
|
+
baseMarketingSpotDataType?: string;
|
|
718
|
+
/** Internal HCL product uniqueID (numeric string). Present for CatalogEntry/CatalogEntryId types. */
|
|
719
|
+
contentId?: string;
|
|
720
|
+
/** Part number of the product, if returned inline by the spot configuration. */
|
|
721
|
+
partNumber?: string;
|
|
722
|
+
/** Display name of the product or content entry. */
|
|
723
|
+
contentName?: string;
|
|
724
|
+
}
|
|
725
|
+
/** A single marketing spot entry in a WCS espot response. */
|
|
726
|
+
export interface HclEspotMarketingSpot {
|
|
727
|
+
eSpotName?: string;
|
|
728
|
+
baseMarketingSpotActivityData?: HclEspotActivityData[];
|
|
729
|
+
}
|
|
730
|
+
/** Top-level response from GET /wcs/resources/store/{storeId}/espot/{name}. */
|
|
731
|
+
export interface HclEspotResponse {
|
|
732
|
+
MarketingSpotData?: HclEspotMarketingSpot[];
|
|
733
|
+
}
|
|
734
|
+
/** A single customer segment (member group) entry in a WCS segment response. */
|
|
735
|
+
export interface HclSegmentMemberGroup {
|
|
736
|
+
id: string;
|
|
737
|
+
displayName?: {
|
|
738
|
+
language: number;
|
|
739
|
+
value: string;
|
|
740
|
+
};
|
|
741
|
+
description?: {
|
|
742
|
+
language: number;
|
|
743
|
+
value: string;
|
|
744
|
+
};
|
|
745
|
+
usage?: string[];
|
|
746
|
+
}
|
|
747
|
+
/** Top-level response from GET /wcs/resources/store/{storeId}/segment. */
|
|
748
|
+
export interface HclSegmentResponse {
|
|
749
|
+
MemberGroup?: HclSegmentMemberGroup[];
|
|
750
|
+
recordSetTotal?: number;
|
|
751
|
+
recordSetCount?: number;
|
|
752
|
+
recordSetStartNumber?: number;
|
|
753
|
+
recordSetComplete?: boolean;
|
|
754
|
+
}
|
|
755
|
+
/**
|
|
756
|
+
* A WCS person contact embedded within an organization's contactInfo or addressBook.
|
|
757
|
+
* Shares the same shape as HclWcsPersonContact but is returned under different keys
|
|
758
|
+
* in the organization API response.
|
|
759
|
+
*/
|
|
760
|
+
export interface HclWcsOrgContact {
|
|
761
|
+
nickName?: string;
|
|
762
|
+
firstName?: string;
|
|
763
|
+
lastName?: string;
|
|
764
|
+
/** Street address lines. Index 0 = street, index 1 = second line. */
|
|
765
|
+
addressLine?: string[];
|
|
766
|
+
city?: string;
|
|
767
|
+
stateOrProvinceName?: string;
|
|
768
|
+
zipCode?: string;
|
|
769
|
+
country?: string;
|
|
770
|
+
phone1?: string;
|
|
771
|
+
email1?: string;
|
|
772
|
+
/** '1' marks this as the default / primary shipping address. */
|
|
773
|
+
primary?: string;
|
|
774
|
+
addressType?: string;
|
|
775
|
+
addressId?: string;
|
|
776
|
+
}
|
|
777
|
+
/**
|
|
778
|
+
* An organization entry as returned by GET /wcs/resources/store/{storeId}/organization/{id}.
|
|
779
|
+
* Fields present depend on the profileName used (IBM_Org_Entity_Details vs IBM_Organization_Details).
|
|
780
|
+
*/
|
|
781
|
+
export interface HclOrganizationItem {
|
|
782
|
+
/** Internal WCS organization/member ID (numeric string). */
|
|
783
|
+
organizationId?: string;
|
|
784
|
+
orgEntityId?: string;
|
|
785
|
+
organizationName?: string;
|
|
786
|
+
displayName?: string;
|
|
787
|
+
/** Approval status code: '0' = pending, '1' = approved, '2' = rejected. */
|
|
788
|
+
status?: string;
|
|
789
|
+
/** '0' = locked/blocked, '1' = active. */
|
|
790
|
+
state?: string;
|
|
791
|
+
/** Tax payer ID (maps to taxIdentifier on the domain model). */
|
|
792
|
+
taxPayerId?: string;
|
|
793
|
+
/** Legal entity identifier. */
|
|
794
|
+
legalId?: string;
|
|
795
|
+
/** Business category. */
|
|
796
|
+
businessCategory?: string;
|
|
797
|
+
description?: string;
|
|
798
|
+
/** Primary billing / contact address. */
|
|
799
|
+
contactInfo?: HclWcsOrgContact;
|
|
800
|
+
/** Additional shipping addresses. */
|
|
801
|
+
addressBook?: HclWcsOrgContact[];
|
|
802
|
+
/** Context attributes set by IBM_Org_Entity_Details profile (key-value map). */
|
|
803
|
+
contextAttribute?: Record<string, unknown>;
|
|
804
|
+
/** Parent organization member ID. */
|
|
805
|
+
parentMemberId?: string;
|
|
806
|
+
}
|
|
807
|
+
/**
|
|
808
|
+
* Top-level response from GET /wcs/resources/store/{storeId}/organization
|
|
809
|
+
* with profileName=IBM_Organization_List_Summary.
|
|
810
|
+
*/
|
|
811
|
+
export interface HclOrganizationListResponse {
|
|
812
|
+
organizationDataBeans?: HclOrganizationItem[];
|
|
813
|
+
recordSetTotal?: string;
|
|
814
|
+
recordSetCount?: string;
|
|
815
|
+
recordSetStartNumber?: string;
|
|
816
|
+
recordSetComplete?: string;
|
|
817
|
+
}
|
|
818
|
+
/**
|
|
819
|
+
* Response from POST /wcs/resources/store/{storeId}/organization/buyer.
|
|
820
|
+
* Returns the newly created org entity ID and the buyer admin user ID.
|
|
821
|
+
*/
|
|
822
|
+
export interface HclBuyerRegistrationResponse {
|
|
823
|
+
orgEntityId: string;
|
|
824
|
+
userId: string;
|
|
825
|
+
resourceName?: string;
|
|
826
|
+
}
|
|
827
|
+
/** A single store attribute as returned in the storelocator response. */
|
|
828
|
+
export interface HclStoreAttribute {
|
|
829
|
+
name: string;
|
|
830
|
+
value: string;
|
|
831
|
+
displayName?: string;
|
|
832
|
+
displayValue?: string;
|
|
833
|
+
}
|
|
834
|
+
/** A description block for a physical store. */
|
|
835
|
+
export interface HclStoreDescription {
|
|
836
|
+
displayStoreName?: string;
|
|
837
|
+
}
|
|
838
|
+
/**
|
|
839
|
+
* A single physical store entry as returned by the WCS storelocator endpoints.
|
|
840
|
+
* Reference: location_based_services.yaml — storelocator-storelocator_item
|
|
841
|
+
*/
|
|
842
|
+
export interface HclPhysicalStore {
|
|
843
|
+
uniqueID: string;
|
|
844
|
+
/** Store name as configured in WCS (fallback when Description[].displayStoreName is absent). */
|
|
845
|
+
storeName?: string;
|
|
846
|
+
/** Array of description blocks; index 0 typically contains displayStoreName. */
|
|
847
|
+
Description?: HclStoreDescription[];
|
|
848
|
+
/** Street address lines. Index 0 = primary line, index 1 = second line. */
|
|
849
|
+
addressLine?: string[];
|
|
850
|
+
city?: string;
|
|
851
|
+
stateOrProvinceName?: string;
|
|
852
|
+
postalCode?: string;
|
|
853
|
+
country?: string;
|
|
854
|
+
telephone1?: string;
|
|
855
|
+
email?: string;
|
|
856
|
+
/** Geographic latitude (as a string — coerce with Number()). */
|
|
857
|
+
latitude?: string;
|
|
858
|
+
/** Geographic longitude (as a string — coerce with Number()). */
|
|
859
|
+
longitude?: string;
|
|
860
|
+
/** Distance from the query point (as a string — coerce with Number()). */
|
|
861
|
+
distance?: string;
|
|
862
|
+
Attribute?: HclStoreAttribute[];
|
|
863
|
+
userDataField?: {
|
|
864
|
+
value?: string;
|
|
865
|
+
key: string;
|
|
866
|
+
}[];
|
|
867
|
+
}
|
|
868
|
+
/**
|
|
869
|
+
* Top-level response from GET /wcs/resources/store/{storeId}/storelocator/latitude/{lat}/longitude/{lon}.
|
|
870
|
+
*/
|
|
871
|
+
export interface HclStoreLocatorResponse {
|
|
872
|
+
PhysicalStore?: HclPhysicalStore[];
|
|
873
|
+
recordSetTotal?: string;
|
|
874
|
+
recordSetCount?: string;
|
|
875
|
+
recordSetStartNumber?: string;
|
|
876
|
+
recordSetComplete?: string;
|
|
877
|
+
}
|
|
878
|
+
/**
|
|
879
|
+
* A single item entry within a wishlist — from GET /wishlist/{id}/item.
|
|
880
|
+
*/
|
|
881
|
+
export interface HclWishlistItem {
|
|
882
|
+
/** Unique identifier for the wishlist item entry. */
|
|
883
|
+
giftListItemID?: string;
|
|
884
|
+
/** Internal WCS catalog entry ID (numeric string). Corresponds to a SKU. */
|
|
885
|
+
productId?: string;
|
|
886
|
+
/** SKU part number — use this as the variant identifier when present. */
|
|
887
|
+
partNumber?: string;
|
|
888
|
+
/** Requested quantity as a string — coerce with Number(). */
|
|
889
|
+
quantityRequested?: string;
|
|
890
|
+
/** Purchased quantity as a string. */
|
|
891
|
+
quantityBought?: string;
|
|
892
|
+
location?: string;
|
|
893
|
+
}
|
|
894
|
+
/**
|
|
895
|
+
* A single wishlist (GiftList) entry as returned by GET /wishlist/@self.
|
|
896
|
+
*/
|
|
897
|
+
export interface HclWishlist {
|
|
898
|
+
/** Internal WCS list ID. */
|
|
899
|
+
uniqueID?: string;
|
|
900
|
+
/** Customer-assigned external identifier. Alias for uniqueID on some responses. */
|
|
901
|
+
externalIdentifier?: string;
|
|
902
|
+
/** The list's display name. */
|
|
903
|
+
descriptionName?: string;
|
|
904
|
+
/** The list's optional description text. */
|
|
905
|
+
description?: string;
|
|
906
|
+
lastUpdate?: string;
|
|
907
|
+
guestAccessKey?: string;
|
|
908
|
+
/** Items embedded in the list (present when fetching a specific list with items). */
|
|
909
|
+
item?: HclWishlistItem[];
|
|
910
|
+
}
|
|
911
|
+
/** Top-level response from GET /wcs/resources/store/{storeId}/wishlist/@self. */
|
|
912
|
+
export interface HclWishlistListResponse {
|
|
913
|
+
GiftList?: HclWishlist[];
|
|
914
|
+
recordSetTotal?: string;
|
|
915
|
+
recordSetCount?: string;
|
|
916
|
+
recordSetStartNumber?: string;
|
|
917
|
+
recordSetComplete?: string;
|
|
918
|
+
}
|
|
919
|
+
/** Top-level response from GET /wcs/resources/store/{storeId}/wishlist/{id}/item. */
|
|
920
|
+
export interface HclWishlistItemResponse {
|
|
921
|
+
GiftList?: HclWishlist[];
|
|
922
|
+
recordSetTotal?: string;
|
|
923
|
+
recordSetCount?: string;
|
|
924
|
+
recordSetStartNumber?: string;
|
|
925
|
+
}
|
|
926
|
+
/** Response from POST /wishlist (create) and PUT /wishlist/{id} (update). */
|
|
927
|
+
export interface HclWishlistMutationResponse {
|
|
928
|
+
uniqueID?: string;
|
|
929
|
+
externalIdentifier?: string;
|
|
930
|
+
resourceName?: string;
|
|
931
|
+
}
|
|
932
|
+
/** A single item in a WCS requisition list. */
|
|
933
|
+
export interface HclRequisitionListItem {
|
|
934
|
+
/** Unique identifier of the item within the list. */
|
|
935
|
+
requisitionListItemId?: string;
|
|
936
|
+
/** Numeric product identifier (same semantics as GiftList item.productId). */
|
|
937
|
+
productId?: string;
|
|
938
|
+
/** Partner number / SKU. */
|
|
939
|
+
partNumber?: string;
|
|
940
|
+
/** Requested quantity as a string. */
|
|
941
|
+
quantity?: string;
|
|
942
|
+
/** Location (e.g. "online"). */
|
|
943
|
+
location?: string;
|
|
944
|
+
}
|
|
945
|
+
/** A single WCS requisition list (from GET /requisitionList/@self or by ID). */
|
|
946
|
+
export interface HclRequisitionList {
|
|
947
|
+
/** Unique identifier of the list. */
|
|
948
|
+
requisitionListId?: string;
|
|
949
|
+
/** Display name of the list. */
|
|
950
|
+
name?: string;
|
|
951
|
+
/** Description of the list. */
|
|
952
|
+
description?: string;
|
|
953
|
+
/** Items in the list (only present on detail endpoints). */
|
|
954
|
+
item?: HclRequisitionListItem[];
|
|
955
|
+
}
|
|
956
|
+
/** Response from GET /requisitionList/@self — array of lists. */
|
|
957
|
+
export interface HclRequisitionListResponse {
|
|
958
|
+
resultList?: HclRequisitionList[];
|
|
959
|
+
recordSetTotal?: string;
|
|
960
|
+
recordSetCount?: string;
|
|
961
|
+
recordSetStartNumber?: string;
|
|
962
|
+
}
|
|
963
|
+
/** Response from GET /requisitionList/{id}/item. */
|
|
964
|
+
export interface HclRequisitionListDetailResponse {
|
|
965
|
+
resultList?: HclRequisitionList[];
|
|
966
|
+
recordSetTotal?: string;
|
|
967
|
+
}
|
|
968
|
+
/** Response from POST /requisitionList (create) and PUT /requisitionList/{id}. */
|
|
969
|
+
export interface HclRequisitionListMutationResponse {
|
|
970
|
+
requisitionListId?: string;
|
|
971
|
+
resourceName?: string;
|
|
972
|
+
}
|
package/src/test/test-utils.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export declare function getHclTestConfiguration(): HclConfiguration;
|
|
|
4
4
|
export declare function createHclClient(contextOverrides?: Partial<RequestContext>): Omit<import("@reactionary/core").Client, "product" | "productSearch" | "category"> & Omit<import("@reactionary/core").ClientFromCapabilities<{
|
|
5
5
|
product?: true | undefined;
|
|
6
6
|
productSearch?: true | undefined;
|
|
7
|
+
company?: false | undefined;
|
|
7
8
|
price?: false | undefined;
|
|
8
9
|
order?: false | undefined;
|
|
9
10
|
cart?: false | undefined;
|
|
@@ -12,8 +13,10 @@ export declare function createHclClient(contextOverrides?: Partial<RequestContex
|
|
|
12
13
|
profile?: false | undefined;
|
|
13
14
|
inventory?: false | undefined;
|
|
14
15
|
category?: true | undefined;
|
|
16
|
+
store?: false | undefined;
|
|
17
|
+
productList?: false | undefined;
|
|
15
18
|
orderSearch?: false | undefined;
|
|
16
|
-
}>, "product" | "productSearch" | "price" | "order" | "cart" | "checkout" | "identity" | "profile" | "inventory" | "category" | "orderSearch"> & {
|
|
19
|
+
}>, "product" | "productSearch" | "company" | "price" | "order" | "cart" | "checkout" | "identity" | "profile" | "inventory" | "category" | "store" | "productList" | "orderSearch"> & {
|
|
17
20
|
product: import("../index.js").HclProductCapability<import("../index.js").HclProductFactory<import("zod").ZodObject<{
|
|
18
21
|
identifier: import("zod").ZodObject<{
|
|
19
22
|
key: import("zod").ZodString;
|