@infosoftas/s4-orders-js-sdk 0.1.21 → 0.2.1

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.
Files changed (72) hide show
  1. package/.editorconfig +0 -0
  2. package/.release-it.json +0 -0
  3. package/README.md +572 -471
  4. package/build/postcss-scope-tailwind.cjs +0 -0
  5. package/components.json +0 -0
  6. package/package.json +62 -58
  7. package/src/App.completion.test.tsx +677 -0
  8. package/src/App.css +0 -14
  9. package/src/App.paymentReturn.test.tsx +341 -0
  10. package/src/App.tsx +722 -639
  11. package/src/ErrorBoundary.tsx +0 -0
  12. package/src/api/InvoiceApi.ts +0 -0
  13. package/src/api/OrdersApi.ts +74 -59
  14. package/src/api/SubscribeApi.ts +0 -0
  15. package/src/bundle.ts +0 -0
  16. package/src/components/Alert/Alert.tsx +0 -0
  17. package/src/components/Button/Button.tsx +0 -0
  18. package/src/components/EHFForm/EHFForm.tsx +250 -253
  19. package/src/components/FormFields/AddressField.tsx +0 -0
  20. package/src/components/FormFields/EmailField.tsx +0 -0
  21. package/src/components/FormFields/FormFields.helper.ts +0 -0
  22. package/src/components/FormFields/FormFieldsMapper.ts +0 -0
  23. package/src/components/FormFields/InputField.tsx +0 -0
  24. package/src/components/FormFields/NameField.tsx +0 -0
  25. package/src/components/FormFields/PhoneField.tsx +0 -0
  26. package/src/components/FormFields/TermsCheckbox.tsx +0 -0
  27. package/src/components/FormFields/ToggleFiled.tsx +0 -0
  28. package/src/components/FormFields/fieldValidators.ts +0 -0
  29. package/src/components/OIOForm/OIOForm.tsx +304 -307
  30. package/src/components/OrderDenialModal/OrderDenialModal.tsx +0 -0
  31. package/src/components/OrderForm/ContactDetailsSection.tsx +0 -0
  32. package/src/components/OrderForm/OrderForm.tsx +417 -420
  33. package/src/components/OrderForm/PaymentMethodContent.tsx +0 -0
  34. package/src/components/OrderForm/PaymentMethodSection.tsx +0 -0
  35. package/src/components/OrderForm/SubmitConfirmationDialog.tsx +0 -0
  36. package/src/components/OrderForm/orderFormState.ts +0 -0
  37. package/src/components/OrderForm/useSlotElement.tsx +0 -0
  38. package/src/components/ui/alert-dialog.tsx +0 -0
  39. package/src/components/ui/alert.tsx +0 -0
  40. package/src/components/ui/button.tsx +0 -0
  41. package/src/components/ui/card.tsx +0 -0
  42. package/src/components/ui/checkbox.tsx +0 -0
  43. package/src/components/ui/field.tsx +0 -0
  44. package/src/components/ui/input.tsx +0 -0
  45. package/src/components/ui/label.tsx +0 -0
  46. package/src/components/ui/radio-group.tsx +0 -0
  47. package/src/components/ui/separator.tsx +0 -0
  48. package/src/components/ui/skeleton.tsx +0 -0
  49. package/src/components/ui/spinner.tsx +0 -0
  50. package/src/components/ui/switch.tsx +0 -0
  51. package/src/components/ui/textarea.tsx +0 -0
  52. package/src/constants/index.ts +0 -0
  53. package/src/custom.d.ts +0 -0
  54. package/src/enums/api.ts +0 -0
  55. package/src/enums/general.ts +42 -40
  56. package/src/hooks/useOrderForm.tsx +400 -403
  57. package/src/hooks/usePaymentReturn.tsx +139 -0
  58. package/src/hooks/useQueryParams.ts +0 -0
  59. package/src/index.tsx +0 -0
  60. package/src/lib/utils.ts +0 -0
  61. package/src/types/api.ts +0 -0
  62. package/src/types/general.ts +153 -136
  63. package/src/types/order.ts +91 -70
  64. package/src/utils/fetcher.ts +131 -113
  65. package/src/utils/helper.ts +0 -0
  66. package/src/utils/order.helper.test.ts +81 -0
  67. package/src/utils/order.helper.ts +285 -272
  68. package/src/utils/waitForOrderCompletion.ts +125 -0
  69. package/tsconfig.json +39 -38
  70. package/src/components/MainIframe/MainIframe.tsx +0 -42
  71. package/src/hooks/useIframe.tsx +0 -59
  72. package/src/hooks/useMessageEvent.tsx +0 -194
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
package/src/custom.d.ts CHANGED
File without changes
package/src/enums/api.ts CHANGED
File without changes
@@ -1,40 +1,42 @@
1
- export enum PaymentMethodEnum {
2
- Vipps = 'Vipps',
3
- MobilePay = 'MobilePay',
4
- SwedbankPay = 'SwedbankPay',
5
- Mollie = 'Mollie',
6
- Invoice = 'Invoice',
7
- Email = 'Email',
8
- EHF = 'EHF',
9
- OIO = 'OIO',
10
- }
11
-
12
- export enum MessageEventTypeEnum {
13
- ORDER_FLOW_COMPLETE = 'orderFlowComplete',
14
- ORDER_FLOW_CANCEL = 'orderFlowCancel',
15
- ORDER_UPDATE_INFO = 'orderUpdateInfo',
16
- VIPPS_COMPLETE = 'completeOrder',
17
- CANCEL = 'cancel',
18
- COMPLETE = 'complete',
19
- }
20
-
21
- export enum InvoiceLookupNetworkEnum {
22
- EHF = '0192',
23
- OIO_GLN = '0088',
24
- OIO_Danish_CVR = '0096',
25
- }
26
-
27
- export enum FormTypeEnum {
28
- ORDER = 'order',
29
- EHF = 'EHF',
30
- OIO = 'OIO',
31
- }
32
-
33
- export enum UserActionEnum {
34
- SELECT_FORM = 'selectForm',
35
- SELECT_PAYMENT_METHOD = 'selectPaymentMethod',
36
- SELECT_FALLBACK_OFFER = 'selectFallbackOffer',
37
- RETURN_TO_MAIN = 'returnToMain',
38
- TOGGLE_INVOICE_ADDRESS = 'toggleInvoiceAddress',
39
- SEARCH_ORGANIZATION_NUMBER = 'searchOrganizationNumber',
40
- }
1
+ export enum PaymentMethodEnum {
2
+ Vipps = 'Vipps',
3
+ MobilePay = 'MobilePay',
4
+ SwedbankPay = 'SwedbankPay',
5
+ Mollie = 'Mollie',
6
+ Invoice = 'Invoice',
7
+ Email = 'Email',
8
+ EHF = 'EHF',
9
+ OIO = 'OIO',
10
+ }
11
+
12
+ export enum MessageEventTypeEnum {
13
+ ORDER_FLOW_COMPLETE = 'orderFlowComplete',
14
+ ORDER_FLOW_CANCEL = 'orderFlowCancel',
15
+ ORDER_UPDATE_INFO = 'orderUpdateInfo',
16
+ }
17
+
18
+ export enum PaymentReturnActionEnum {
19
+ COMPLETE = 'complete',
20
+ CANCEL = 'cancel',
21
+ }
22
+
23
+ export enum InvoiceLookupNetworkEnum {
24
+ EHF = '0192',
25
+ OIO_GLN = '0088',
26
+ OIO_Danish_CVR = '0096',
27
+ }
28
+
29
+ export enum FormTypeEnum {
30
+ ORDER = 'order',
31
+ EHF = 'EHF',
32
+ OIO = 'OIO',
33
+ }
34
+
35
+ export enum UserActionEnum {
36
+ SELECT_FORM = 'selectForm',
37
+ SELECT_PAYMENT_METHOD = 'selectPaymentMethod',
38
+ SELECT_FALLBACK_OFFER = 'selectFallbackOffer',
39
+ RETURN_TO_MAIN = 'returnToMain',
40
+ TOGGLE_INVOICE_ADDRESS = 'toggleInvoiceAddress',
41
+ SEARCH_ORGANIZATION_NUMBER = 'searchOrganizationNumber',
42
+ }