-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f57eedc
commit cc6721f
Showing
26 changed files
with
119 additions
and
113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
export enum AddressType { | ||
Billing = 'billing', | ||
Shipping = 'shipping', | ||
} | ||
|
||
export enum PdkEvent { | ||
CheckoutUpdate = 'checkoutUpdate', | ||
CheckoutUpdated = 'checkoutUpdated', | ||
StoreInitialize = 'storeInitialize', | ||
StoreInitialized = 'storeInitialized', | ||
} | ||
|
||
export enum AddressField { | ||
Address1 = 'address1', | ||
City = 'city', | ||
Country = 'country', | ||
PostalCode = 'postalCode', | ||
} | ||
|
||
export enum PdkField { | ||
AddressType = 'addressType', | ||
ShippingMethod = 'shippingMethod', | ||
} | ||
|
||
export type AddressFields = Record<AddressField, string>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,32 @@ | ||
import {type EndpointObject} from '@myparcel-pdk/common'; | ||
import { | ||
type EndpointObject, | ||
type PdkEndpointDefinition, | ||
type PdkEndpointParameters, | ||
type PdkEndpointResponse, | ||
type Plugin, | ||
} from '@myparcel-pdk/common'; | ||
import {type FrontendEndpoint} from '../endpoints'; | ||
|
||
export type FrontendPdkEndpointObject = EndpointObject<FrontendEndpoint>; | ||
|
||
export type FrontendEndpointData<E extends FrontendEndpoint> = FrontendPdkEndpointObject[E] & { | ||
baseUrl: string; | ||
}; | ||
|
||
export type FrontendEndpointResponse<E extends FrontendEndpoint> = PdkEndpointResponse<E, FrontendEndpointDefinition>; | ||
|
||
export type FrontendEndpointParameters<E extends FrontendEndpoint> = PdkEndpointParameters< | ||
E, | ||
FrontendEndpointDefinition | ||
>; | ||
|
||
interface FetchCheckoutContextDefinition extends PdkEndpointDefinition { | ||
formattedResponse: Plugin.ModelContextCheckoutContext; | ||
name: FrontendEndpoint.FetchCheckoutContext; | ||
parameters: { | ||
shippingMethod?: string; | ||
}; | ||
response: [Plugin.ModelContextCheckoutContext]; | ||
} | ||
|
||
export type FrontendEndpointDefinition = FetchCheckoutContextDefinition; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
export * from './address.types'; | ||
export * from './endpoints.types'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
export * from './endpoints.types'; | ||
export * from './types'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.