@myparcel-dev/pdk-common 2.1.1 → 2.2.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/CHANGELOG.md +20 -0
- package/dist/types/carrier.types.d.ts +15 -13
- package/dist/types/php-pdk.types.d.ts +3 -1
- package/package.json +1 -1
- package/src/types/carrier.types.ts +15 -13
- package/src/types/php-pdk.types.ts +3 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,26 @@
|
|
|
2
2
|
|
|
3
3
|
<!-- MONOWEAVE:BELOW -->
|
|
4
4
|
|
|
5
|
+
## [2.2.0](https://github.com/myparcelnl/js-pdk/compare/@myparcel-dev/pdk-common@2.1.2...@myparcel-dev/pdk-common@2.2.0) "@myparcel-dev/pdk-common" (2026-09-24)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* **checkout:** refresh the context when the recipient business flag changes ([#461](https://github.com/myparcelnl/js-pdk/issues/461)) ([0689762](https://github.com/myparcelnl/js-pdk/commit/0689762ae5b14c592e664b286612796aed0c7a9d)), closes [myparcelnl/woocommerce#1848](https://github.com/myparcelnl/woocommerce/issues/1848) [#359](https://github.com/myparcelnl/js-pdk/issues/359)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
## [2.1.2](https://github.com/myparcelnl/js-pdk/compare/@myparcel-dev/pdk-common@2.1.1...@myparcel-dev/pdk-common@2.1.2) "@myparcel-dev/pdk-common" (2026-08-19)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Bug Fixes
|
|
19
|
+
|
|
20
|
+
* **insurance:** read insurance limits from the flat capabilities format ([#383](https://github.com/myparcelnl/js-pdk/issues/383)) ([8794c46](https://github.com/myparcelnl/js-pdk/commit/8794c46ee0ffce36fdad9b3e7dc95e44ee56af23)), closes [myparcelnl/pdk#511](https://github.com/myparcelnl/pdk/issues/511)
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
5
25
|
## [2.1.1](https://github.com/myparcelnl/js-pdk/compare/@myparcel-dev/pdk-common@2.1.0...@myparcel-dev/pdk-common@2.1.1) "@myparcel-dev/pdk-common" (2026-08-07)
|
|
6
26
|
|
|
7
27
|
|
|
@@ -13,19 +13,21 @@ export type CarrierModel = {
|
|
|
13
13
|
isSelectedByDefault: boolean;
|
|
14
14
|
requires?: string[];
|
|
15
15
|
excludes?: string[];
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
16
|
+
/**
|
|
17
|
+
* Insurance limits, in cents. Each is optional: a missing `max` means the carrier sets no
|
|
18
|
+
* ceiling, and a missing `min` means it sets no floor.
|
|
19
|
+
*/
|
|
20
|
+
min?: {
|
|
21
|
+
amount: number;
|
|
22
|
+
currency: string;
|
|
23
|
+
};
|
|
24
|
+
max?: {
|
|
25
|
+
amount: number;
|
|
26
|
+
currency: string;
|
|
27
|
+
};
|
|
28
|
+
default?: {
|
|
29
|
+
amount: number;
|
|
30
|
+
currency: string;
|
|
29
31
|
};
|
|
30
32
|
};
|
|
31
33
|
} & Record<string, {
|
|
@@ -266,6 +266,8 @@ export declare namespace Plugin {
|
|
|
266
266
|
pickupLocationsDefaultView: string;
|
|
267
267
|
priceStandardDelivery: number;
|
|
268
268
|
carrierSettings: unknown[];
|
|
269
|
+
/** Whether the context was built for a business recipient. Decides which carriers it holds. */
|
|
270
|
+
isBusiness: boolean;
|
|
269
271
|
};
|
|
270
272
|
type ModelContextCheckoutContextSettings = {
|
|
271
273
|
actions: {
|
|
@@ -280,7 +282,7 @@ export declare namespace Plugin {
|
|
|
280
282
|
carriersWithTaxFields: CarrierName[];
|
|
281
283
|
};
|
|
282
284
|
type ModelContextCheckoutContext = {
|
|
283
|
-
config:
|
|
285
|
+
config: ModelContextDeliveryOptionsConfig;
|
|
284
286
|
platformConfig: Record<'carriers', unknown[]>;
|
|
285
287
|
endpoints: EndpointRequestCollection;
|
|
286
288
|
settings: ModelContextCheckoutContextSettings;
|
package/package.json
CHANGED
|
@@ -13,19 +13,21 @@ export type CarrierModel = {
|
|
|
13
13
|
isSelectedByDefault: boolean;
|
|
14
14
|
requires?: string[];
|
|
15
15
|
excludes?: string[];
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
16
|
+
/**
|
|
17
|
+
* Insurance limits, in cents. Each is optional: a missing `max` means the carrier sets no
|
|
18
|
+
* ceiling, and a missing `min` means it sets no floor.
|
|
19
|
+
*/
|
|
20
|
+
min?: {
|
|
21
|
+
amount: number;
|
|
22
|
+
currency: string;
|
|
23
|
+
};
|
|
24
|
+
max?: {
|
|
25
|
+
amount: number;
|
|
26
|
+
currency: string;
|
|
27
|
+
};
|
|
28
|
+
default?: {
|
|
29
|
+
amount: number;
|
|
30
|
+
currency: string;
|
|
29
31
|
};
|
|
30
32
|
};
|
|
31
33
|
} & Record<
|
|
@@ -324,6 +324,8 @@ export namespace Plugin {
|
|
|
324
324
|
pickupLocationsDefaultView: string;
|
|
325
325
|
priceStandardDelivery: number;
|
|
326
326
|
carrierSettings: unknown[];
|
|
327
|
+
/** Whether the context was built for a business recipient. Decides which carriers it holds. */
|
|
328
|
+
isBusiness: boolean;
|
|
327
329
|
};
|
|
328
330
|
|
|
329
331
|
export type ModelContextCheckoutContextSettings = {
|
|
@@ -348,7 +350,7 @@ export namespace Plugin {
|
|
|
348
350
|
};
|
|
349
351
|
|
|
350
352
|
export type ModelContextCheckoutContext = {
|
|
351
|
-
config:
|
|
353
|
+
config: ModelContextDeliveryOptionsConfig;
|
|
352
354
|
platformConfig: Record<'carriers', unknown[]>; // @todo this is a temporary generic type, until capabilities is implemented in the deliveryOptions
|
|
353
355
|
endpoints: EndpointRequestCollection;
|
|
354
356
|
settings: ModelContextCheckoutContextSettings;
|