@spiffcommerce/core 14.13.2 → 15.0.0
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/dist/main.js +67 -54
- package/dist/module.js +66 -53
- package/dist/types.d.ts +76 -2
- package/package.json +2 -2
package/dist/types.d.ts
CHANGED
|
@@ -733,15 +733,33 @@ export interface Transaction {
|
|
|
733
733
|
*/
|
|
734
734
|
stakeholders?: Stakeholder[];
|
|
735
735
|
}
|
|
736
|
+
/**
|
|
737
|
+
* An integration product represents the connection of a product in SpiffCommerce with
|
|
738
|
+
* a product on a third party platform.
|
|
739
|
+
*/
|
|
736
740
|
interface IntegrationProduct {
|
|
741
|
+
/**
|
|
742
|
+
* The ID of the IntegrationProduct entity. Used internally by SpiffCommerce.
|
|
743
|
+
*/
|
|
737
744
|
id: string;
|
|
745
|
+
/**
|
|
746
|
+
* The ID of the product on the third party platform. For example a Shopify product ID.
|
|
747
|
+
*/
|
|
738
748
|
externalProductId?: string;
|
|
749
|
+
/**
|
|
750
|
+
* The integration that this product is associated with. For example a Shopify integration.
|
|
751
|
+
*/
|
|
739
752
|
integration?: Integration;
|
|
740
753
|
}
|
|
741
754
|
interface Integration {
|
|
742
755
|
id: string;
|
|
743
756
|
enabled: boolean;
|
|
744
757
|
externalIntegrationId?: string;
|
|
758
|
+
integrationType?: IntegrationType;
|
|
759
|
+
}
|
|
760
|
+
enum IntegrationType {
|
|
761
|
+
Hub = "Hub",
|
|
762
|
+
Shopify = "Shopify"
|
|
745
763
|
}
|
|
746
764
|
/**
|
|
747
765
|
* Fields found in a variant within a line item resource.
|
|
@@ -1058,7 +1076,7 @@ interface _Bundle1 {
|
|
|
1058
1076
|
}[];
|
|
1059
1077
|
name?: string;
|
|
1060
1078
|
partner?: Partner;
|
|
1061
|
-
productCollection?:
|
|
1079
|
+
productCollection?: ProductCollectionResource;
|
|
1062
1080
|
transactions?: Transaction[];
|
|
1063
1081
|
}
|
|
1064
1082
|
interface BundleStakeholder {
|
|
@@ -1071,7 +1089,7 @@ interface BundleStakeholderInput {
|
|
|
1071
1089
|
type: StakeholderType;
|
|
1072
1090
|
customerDetails: CustomerDetailsInput;
|
|
1073
1091
|
}
|
|
1074
|
-
type
|
|
1092
|
+
type ProductCollectionResource = {
|
|
1075
1093
|
id: string;
|
|
1076
1094
|
globalPropertyConfiguration?: GlobalPropertyConfiguration;
|
|
1077
1095
|
name: string;
|
|
@@ -1462,12 +1480,17 @@ export class Variant {
|
|
|
1462
1480
|
* @returns The URL for the base asset resource configured on this variant
|
|
1463
1481
|
*/
|
|
1464
1482
|
getAsset(): string | undefined;
|
|
1483
|
+
/**
|
|
1484
|
+
* @returns The URL for the base asset resource configured on this variant
|
|
1485
|
+
*/
|
|
1486
|
+
getAssetResource(): _Asset1 | undefined;
|
|
1465
1487
|
/**
|
|
1466
1488
|
* @returns The URL for a thumbnail resource configured on this variant. When no thumbnail is configured explicitly we fall back to the base asset and see if a thumbnail is genererated for that.
|
|
1467
1489
|
*/
|
|
1468
1490
|
getThumbnail(): string | undefined;
|
|
1469
1491
|
/**
|
|
1470
1492
|
* @returns The URL for the display image configured on this variant. Can be used for things like size charts.
|
|
1493
|
+
* @deprecated To be removed in a future version
|
|
1471
1494
|
*/
|
|
1472
1495
|
getDisplayImage(): string | undefined;
|
|
1473
1496
|
/**
|
|
@@ -2070,6 +2093,57 @@ interface GlobalPropertyStateManager {
|
|
|
2070
2093
|
getAspect(name: string): string | undefined;
|
|
2071
2094
|
setAspect(name: string, value: string): Promise<void>;
|
|
2072
2095
|
}
|
|
2096
|
+
/**
|
|
2097
|
+
* A collection of products that can be used to form a bundle.
|
|
2098
|
+
*/
|
|
2099
|
+
export class ProductCollection {
|
|
2100
|
+
constructor(collection: ProductCollectionResource);
|
|
2101
|
+
/**
|
|
2102
|
+
* The ID of the product collection.
|
|
2103
|
+
*/
|
|
2104
|
+
getId(): string;
|
|
2105
|
+
/**
|
|
2106
|
+
* The name of the collection.
|
|
2107
|
+
*/
|
|
2108
|
+
getName(): string;
|
|
2109
|
+
/**
|
|
2110
|
+
* A list of products in this collections with useful helpers for interacting with them.
|
|
2111
|
+
*/
|
|
2112
|
+
getProducts(): CollectionProduct[];
|
|
2113
|
+
/**
|
|
2114
|
+
* The raw collection resource. This is generally not needed and should be avoided.
|
|
2115
|
+
*/
|
|
2116
|
+
getResource(): ProductCollectionResource;
|
|
2117
|
+
}
|
|
2118
|
+
/**
|
|
2119
|
+
* A collection product is a product within a ProductCollection. It provides a simple interface for interacting with the product.
|
|
2120
|
+
*/
|
|
2121
|
+
export class CollectionProduct {
|
|
2122
|
+
constructor(product: Product);
|
|
2123
|
+
/**
|
|
2124
|
+
* The ID of the product in SpiffCommerce.
|
|
2125
|
+
* @returns
|
|
2126
|
+
*/
|
|
2127
|
+
getId(): string;
|
|
2128
|
+
/**
|
|
2129
|
+
* The name of the product. Human readable.
|
|
2130
|
+
*/
|
|
2131
|
+
getName(): string;
|
|
2132
|
+
/**
|
|
2133
|
+
* A helper function for getting integrations
|
|
2134
|
+
* @param type The type of integration you want.
|
|
2135
|
+
* @returns The integration if found. Throws an error if not found as this data is typically a neccesity.
|
|
2136
|
+
*/
|
|
2137
|
+
getIntegrationByType(type: IntegrationType): IntegrationProduct;
|
|
2138
|
+
/**
|
|
2139
|
+
* A list of all integrations this product is connected to.
|
|
2140
|
+
*/
|
|
2141
|
+
getIntegrations(): IntegrationProduct[];
|
|
2142
|
+
/**
|
|
2143
|
+
* The raw product resource. This is generally not needed and should be avoided.
|
|
2144
|
+
*/
|
|
2145
|
+
getResource(): Product;
|
|
2146
|
+
}
|
|
2073
2147
|
/**
|
|
2074
2148
|
* A bundle serves as a container for a set of workflow experience.
|
|
2075
2149
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spiffcommerce/core",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "15.0.0",
|
|
4
4
|
"description": "Core client API for interacting with the Spiff Commerce backend.",
|
|
5
5
|
"source": "src/index.ts",
|
|
6
6
|
"main": "dist/main.js",
|
|
@@ -89,7 +89,7 @@
|
|
|
89
89
|
},
|
|
90
90
|
"dependencies": {
|
|
91
91
|
"@apollo/client": "^3.7.0",
|
|
92
|
-
"@spiffcommerce/papyrus": "5.0.
|
|
92
|
+
"@spiffcommerce/papyrus": "5.0.4",
|
|
93
93
|
"cross-fetch": "^3.1.5",
|
|
94
94
|
"graphql": "^16.6.0",
|
|
95
95
|
"lodash.clonedeep": "^4.5.0",
|