@star-insure/sdk 5.0.12 → 6.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.
Files changed (110) hide show
  1. package/README.md +30 -1
  2. package/dist/index.d.ts +1810 -3
  3. package/dist/sdk.es.js +9436 -0
  4. package/dist/sdk.es.js.map +1 -0
  5. package/package.json +22 -45
  6. package/src/components/tables/TableHead.tsx +1 -1
  7. package/src/{tailwind-preset.js → tailwind-preset.cjs} +1 -0
  8. package/dist/components/common/Button.d.ts +0 -15
  9. package/dist/components/common/Card.d.ts +0 -7
  10. package/dist/components/common/Modal.d.ts +0 -11
  11. package/dist/components/common/Pagination.d.ts +0 -10
  12. package/dist/components/common/SimplePagination.d.ts +0 -10
  13. package/dist/components/common/ToastItem.d.ts +0 -3
  14. package/dist/components/common/Toasts.d.ts +0 -2
  15. package/dist/components/common/index.d.ts +0 -8
  16. package/dist/components/filter/Action.d.ts +0 -3
  17. package/dist/components/filter/Back.d.ts +0 -5
  18. package/dist/components/filter/Dropdown.d.ts +0 -9
  19. package/dist/components/filter/FilterItem.d.ts +0 -6
  20. package/dist/components/filter/FilterOptions.d.ts +0 -5
  21. package/dist/components/filter/PageHeader.d.ts +0 -21
  22. package/dist/components/filter/SearchBar.d.ts +0 -10
  23. package/dist/components/filter/index.d.ts +0 -1
  24. package/dist/components/forms/DateOfBirthField.d.ts +0 -12
  25. package/dist/components/forms/ErrorList.d.ts +0 -10
  26. package/dist/components/forms/FormTester.d.ts +0 -6
  27. package/dist/components/forms/MoneyField.d.ts +0 -11
  28. package/dist/components/forms/RegistrationSearchField.d.ts +0 -29
  29. package/dist/components/forms/index.d.ts +0 -6
  30. package/dist/components/index.d.ts +0 -4
  31. package/dist/components/tables/Table.d.ts +0 -6
  32. package/dist/components/tables/TableActions.d.ts +0 -7
  33. package/dist/components/tables/TableBody.d.ts +0 -7
  34. package/dist/components/tables/TableCell.d.ts +0 -8
  35. package/dist/components/tables/TableHead.d.ts +0 -7
  36. package/dist/components/tables/TableHeader.d.ts +0 -10
  37. package/dist/components/tables/TableRow.d.ts +0 -8
  38. package/dist/components/tables/index.d.ts +0 -8
  39. package/dist/index.js +0 -8
  40. package/dist/lib/addressFinder.d.ts +0 -54
  41. package/dist/lib/auth.d.ts +0 -2
  42. package/dist/lib/calculateAge.d.ts +0 -4
  43. package/dist/lib/calculatePricing.d.ts +0 -19
  44. package/dist/lib/clickOutside.d.ts +0 -1
  45. package/dist/lib/dates.d.ts +0 -20
  46. package/dist/lib/fetch.d.ts +0 -20
  47. package/dist/lib/index.d.ts +0 -14
  48. package/dist/lib/inertiaOptions.d.ts +0 -6
  49. package/dist/lib/localStorage.d.ts +0 -1
  50. package/dist/lib/money.d.ts +0 -32
  51. package/dist/lib/page.d.ts +0 -19
  52. package/dist/lib/quoteRequestForm.d.ts +0 -21
  53. package/dist/lib/quoteRequestOptions.d.ts +0 -11
  54. package/dist/lib/toast.d.ts +0 -10
  55. package/dist/lib/vehicles.d.ts +0 -2
  56. package/dist/sdk.cjs.development.js +0 -3398
  57. package/dist/sdk.cjs.development.js.map +0 -1
  58. package/dist/sdk.cjs.production.min.js +0 -2
  59. package/dist/sdk.cjs.production.min.js.map +0 -1
  60. package/dist/sdk.esm.js +0 -3339
  61. package/dist/sdk.esm.js.map +0 -1
  62. package/dist/types/api/auth.d.ts +0 -35
  63. package/dist/types/api/enums.d.ts +0 -4
  64. package/dist/types/api/index.d.ts +0 -31
  65. package/dist/types/api/responses/claimRequestActions.d.ts +0 -12
  66. package/dist/types/api/responses/index.d.ts +0 -1
  67. package/dist/types/index.d.ts +0 -3
  68. package/dist/types/misc/index.d.ts +0 -47
  69. package/dist/types/models/auth/Group.d.ts +0 -10
  70. package/dist/types/models/auth/Permission.d.ts +0 -4
  71. package/dist/types/models/auth/Role.d.ts +0 -8
  72. package/dist/types/models/auth/User.d.ts +0 -17
  73. package/dist/types/models/auth/index.d.ts +0 -4
  74. package/dist/types/models/claims/ClaimRequest.d.ts +0 -328
  75. package/dist/types/models/claims/index.d.ts +0 -1
  76. package/dist/types/models/index.d.ts +0 -6
  77. package/dist/types/models/oracle/Risk.d.ts +0 -8
  78. package/dist/types/models/oracle/TableData.d.ts +0 -9
  79. package/dist/types/models/oracle/index.d.ts +0 -2
  80. package/dist/types/models/payments/Gateways.d.ts +0 -1
  81. package/dist/types/models/payments/Payment.d.ts +0 -36
  82. package/dist/types/models/payments/index.d.ts +0 -2
  83. package/dist/types/models/quotes/Blacklist.d.ts +0 -20
  84. package/dist/types/models/quotes/Club.d.ts +0 -4
  85. package/dist/types/models/quotes/EmailContentOption.d.ts +0 -7
  86. package/dist/types/models/quotes/InformationRequest.d.ts +0 -34
  87. package/dist/types/models/quotes/Lead.d.ts +0 -17
  88. package/dist/types/models/quotes/MotorwebVehicle.d.ts +0 -120
  89. package/dist/types/models/quotes/PolicyBenefit.d.ts +0 -16
  90. package/dist/types/models/quotes/PolicyEnhancement.d.ts +0 -13
  91. package/dist/types/models/quotes/PostalAddress.d.ts +0 -7
  92. package/dist/types/models/quotes/PromoCode.d.ts +0 -18
  93. package/dist/types/models/quotes/QuoteRequest.d.ts +0 -110
  94. package/dist/types/models/quotes/QuoteRequestDeclaration.d.ts +0 -22
  95. package/dist/types/models/quotes/QuoteRequestForm.d.ts +0 -113
  96. package/dist/types/models/quotes/QuoteRequestIncident.d.ts +0 -6
  97. package/dist/types/models/quotes/QuoteRequestLog.d.ts +0 -11
  98. package/dist/types/models/quotes/QuoteRequestOptions.d.ts +0 -62
  99. package/dist/types/models/quotes/QuoteRequestPurchaseOption.d.ts +0 -38
  100. package/dist/types/models/quotes/QuoteRequestReferrer.d.ts +0 -9
  101. package/dist/types/models/quotes/QuoteRequestReferrerCategory.d.ts +0 -6
  102. package/dist/types/models/quotes/QuoteRequestVehicle.d.ts +0 -23
  103. package/dist/types/models/quotes/QuoteRequestVehicleDriver.d.ts +0 -11
  104. package/dist/types/models/quotes/RedbookVehicle.d.ts +0 -55
  105. package/dist/types/models/quotes/StreetAddress.d.ts +0 -8
  106. package/dist/types/models/quotes/index.d.ts +0 -23
  107. package/dist/types/models/sms-messages/SmsContentOption.d.ts +0 -7
  108. package/dist/types/models/sms-messages/SmsMessage.d.ts +0 -18
  109. package/dist/types/models/sms-messages/SmsMessageReply.d.ts +0 -10
  110. package/dist/types/models/sms-messages/index.d.ts +0 -3
package/package.json CHANGED
@@ -2,83 +2,60 @@
2
2
  "name": "@star-insure/sdk",
3
3
  "description": "The SDK for Star Insure client apps with shared helper functions and TypeScript definitions.",
4
4
  "author": "alexclark_nz",
5
- "version": "5.0.12",
5
+ "version": "6.0.0",
6
6
  "license": "MIT",
7
7
  "repository": {
8
8
  "type": "git",
9
9
  "url": "https://github.com/star-insure/sdk"
10
10
  },
11
- "main": "dist/index.js",
12
- "typings": "dist/index.d.ts",
11
+ "type": "module",
12
+ "main": "./dist/sdk.cjs.js",
13
+ "module": "./dist/sdk.es.js",
14
+ "types": "./dist/index.d.ts",
15
+ "browser": "./dist/sdk.es.js",
13
16
  "files": [
14
17
  "dist",
15
18
  "src"
16
19
  ],
17
20
  "engines": {
18
- "node": ">=10"
21
+ "node": ">=14"
19
22
  },
20
23
  "scripts": {
21
- "dev": "tsdx watch",
22
- "start": "tsdx watch",
23
- "build": "tsdx build",
24
- "test": "TZ='Pacific/Auckland' tsdx test --passWithNoTests",
25
- "lint": "tsdx lint",
26
- "prepare": "tsdx build",
27
- "size": "size-limit",
28
- "analyze": "size-limit --why",
29
- "publish": "np"
24
+ "dev": "vite build --watch",
25
+ "build": "vite build",
26
+ "preview": "vite preview",
27
+ "lint": "eslint src --ext ts,tsx",
28
+ "test": "vitest",
29
+ "release": "np"
30
30
  },
31
- "husky": {
32
- "hooks": {
33
- "pre-commit": "tsdx lint"
34
- }
35
- },
36
- "prettier": {
37
- "printWidth": 80,
38
- "semi": true,
39
- "singleQuote": true,
40
- "trailingComma": "es5"
41
- },
42
- "module": "dist/sdk.esm.js",
43
- "size-limit": [
44
- {
45
- "path": "dist/starinsure-sdk.cjs.production.min.js",
46
- "limit": "10 KB"
47
- },
48
- {
49
- "path": "dist/starinsure-sdk.esm.js",
50
- "limit": "10 KB"
51
- }
52
- ],
53
31
  "devDependencies": {
54
- "@size-limit/preset-small-lib": "^7.0.8",
32
+ "@babel/plugin-transform-react-jsx": "^7.25.9",
55
33
  "@types/lodash-es": "^4.17.6",
56
34
  "@types/react": "^18.0.19",
57
35
  "@types/react-dom": "^18.0.6",
58
36
  "@types/uuid": "^8.3.4",
59
- "husky": "^8.0.1",
37
+ "@vitejs/plugin-react": "^4.3.4",
60
38
  "np": "^9.2.0",
61
- "react": "^18.2.0",
62
- "size-limit": "^7.0.8",
63
- "tsdx": "^0.14.1",
64
- "tslib": "^2.4.0",
65
- "typescript": "^3.9.10"
39
+ "typescript": "^5.7.3",
40
+ "vite": "^6.0.7",
41
+ "vite-plugin-dts": "^4.4.0",
42
+ "vitest": "^2.1.8"
66
43
  },
67
44
  "dependencies": {
68
45
  "@headlessui/react": "^1.6.3",
69
- "@inertiajs/react": "^1.0.0",
70
46
  "@tailwindcss/forms": "^0.5.9",
71
47
  "@tailwindcss/typography": "^0.5.15",
72
48
  "classnames": "^2.3.2",
73
49
  "date-fns": "^2.28.0",
74
50
  "lodash-es": "^4.17.21",
75
- "react-dom": "^18.2.0",
76
51
  "react-icons": "^4.11.0",
77
52
  "react-select": "^5.8.0",
78
53
  "react-tooltip": "^5.25.0",
79
54
  "uuid": "^9.0.0"
80
55
  },
81
56
  "peerDependencies": {
82
- "react": "^18.2.0"
57
+ "@inertiajs/react": "^2.0.0",
58
+ "react": "^18.2.0",
59
+ "react-dom": "^18.2.0"
83
60
  }
84
61
  }
@@ -8,7 +8,7 @@ interface Props extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLTableSe
8
8
 
9
9
  export default function TableHead({ children, className, ...props }: Props) {
10
10
  return (
11
- <thead {...props} className={cn(className, 'px-3 py-4 text-sm text-white bg-gray-600')}>
11
+ <thead {...props} className={cn(className, 'px-3 py-4 text-sm text-white bg-primary')}>
12
12
  {children}
13
13
  </thead>
14
14
  )
@@ -1,3 +1,4 @@
1
+ /** @type {import('tailwindcss').Config} */
1
2
  module.exports = {
2
3
  content: [
3
4
  './resources/**/*.blade.php',
@@ -1,15 +0,0 @@
1
- import React from 'react';
2
- interface Props {
3
- className?: string;
4
- href?: string;
5
- target?: '_blank' | '_self';
6
- onClick?: Function;
7
- type?: 'button' | 'submit';
8
- status?: 'primary' | 'danger' | 'warning' | 'info' | 'default';
9
- children: React.ReactNode;
10
- disabled?: boolean;
11
- as?: 'link' | 'button' | 'a';
12
- small?: boolean;
13
- }
14
- export default function Button({ className, href, target, onClick, type, children, status, disabled, as, small, }: Props): JSX.Element;
15
- export {};
@@ -1,7 +0,0 @@
1
- import React from 'react';
2
- interface Props {
3
- className?: string;
4
- children: React.ReactNode;
5
- }
6
- export default function Card({ className, children }: Props): JSX.Element;
7
- export {};
@@ -1,11 +0,0 @@
1
- import React from 'react';
2
- interface Props {
3
- children: React.ReactNode;
4
- isActive?: boolean;
5
- onClose: () => void;
6
- title?: string;
7
- width?: string;
8
- className?: string;
9
- }
10
- export default function Modal({ children, isActive, onClose, title, width, className }: Props): JSX.Element;
11
- export {};
@@ -1,10 +0,0 @@
1
- /// <reference types="react" />
2
- import type { Meta } from "../../types";
3
- interface Props {
4
- className?: string;
5
- meta: Meta;
6
- showPerPageSelector?: boolean;
7
- defaultValue?: number;
8
- }
9
- export default function Pagination({ meta, className, showPerPageSelector, defaultValue }: Props): JSX.Element;
10
- export {};
@@ -1,10 +0,0 @@
1
- /// <reference types="react" />
2
- import { Meta } from '../../types';
3
- interface Props {
4
- className?: string;
5
- meta: Meta;
6
- showPerPageSelector?: boolean;
7
- defaultValue?: number;
8
- }
9
- export default function SimplePagination({ meta, className, showPerPageSelector, defaultValue, }: Props): JSX.Element;
10
- export {};
@@ -1,3 +0,0 @@
1
- /// <reference types="react" />
2
- import type { Toast } from '../../types';
3
- export default function ToastItem({ _id, message, status }: Toast): JSX.Element;
@@ -1,2 +0,0 @@
1
- /// <reference types="react" />
2
- export default function Toasts(): JSX.Element;
@@ -1,8 +0,0 @@
1
- import Button from './Button';
2
- import Card from './Card';
3
- import Pagination from './Pagination';
4
- import SimplePagination from './SimplePagination';
5
- import ToastItem from './ToastItem';
6
- import Toasts from './Toasts';
7
- import Modal from './Modal';
8
- export { Button, Card, Pagination, SimplePagination, ToastItem, Toasts, Modal, };
@@ -1,3 +0,0 @@
1
- /// <reference types="react" />
2
- import { TPageHeaderAction } from "../../types";
3
- export default function Action({ title, href, as, target, type, onClick, shortcutKey, backgroundColor, textColor, actions }: TPageHeaderAction): JSX.Element;
@@ -1,5 +0,0 @@
1
- /// <reference types="react" />
2
- export declare function BackButton({ back, className }: {
3
- back?: string | boolean;
4
- className?: string;
5
- }): JSX.Element;
@@ -1,9 +0,0 @@
1
- import React from "react";
2
- declare type Props = {
3
- onClose: Function;
4
- active: boolean;
5
- title: React.ReactNode;
6
- children: React.ReactNode;
7
- };
8
- declare function Dropdown({ onClose, active, title, children }: Props): JSX.Element;
9
- export default Dropdown;
@@ -1,6 +0,0 @@
1
- /// <reference types="react" />
2
- import { FilterOption } from "../../types";
3
- export declare function FilterItem({ filter }: {
4
- filter: FilterOption;
5
- path?: string;
6
- }): JSX.Element;
@@ -1,5 +0,0 @@
1
- /// <reference types="react" />
2
- import { FilterOption } from "../../types";
3
- export declare function FilterOptions({ filterOptions }: {
4
- filterOptions: FilterOption[];
5
- }): JSX.Element;
@@ -1,21 +0,0 @@
1
- import React from 'react';
2
- import { FilterOption, TPageHeaderAction } from '../../types';
3
- interface Props {
4
- title: string;
5
- search?: string;
6
- className?: string;
7
- innerClassName?: string;
8
- back?: boolean | string;
9
- actions?: TPageHeaderAction[];
10
- backText?: string;
11
- filterOptions?: FilterOption[];
12
- focusSearchShortcut?: boolean;
13
- children?: React.ReactNode;
14
- }
15
- declare function PageHeader({ title, search, className, innerClassName, back, actions, filterOptions, focusSearchShortcut, children }: Props): JSX.Element;
16
- declare namespace PageHeader {
17
- var Action: ({ children }: {
18
- children: React.ReactNode;
19
- }) => JSX.Element;
20
- }
21
- export default PageHeader;
@@ -1,10 +0,0 @@
1
- /// <reference types="react" />
2
- interface Props {
3
- search?: string;
4
- active: boolean;
5
- onActive: Function;
6
- placeholder?: string;
7
- focusSearchShortcut?: boolean;
8
- }
9
- export default function SearchBar({ search, active, onActive, placeholder, focusSearchShortcut }: Props): JSX.Element;
10
- export {};
@@ -1 +0,0 @@
1
- export { default as PageHeader } from './PageHeader';
@@ -1,12 +0,0 @@
1
- /// <reference types="react" />
2
- interface Props {
3
- name?: string;
4
- id?: string;
5
- onChange: (dateString: string) => void;
6
- value?: string;
7
- maxYear?: number;
8
- showAge?: boolean;
9
- isRequired?: boolean;
10
- }
11
- export default function DateOfBirthField({ name, id, onChange, value, maxYear, showAge, isRequired }: Props): JSX.Element;
12
- export {};
@@ -1,10 +0,0 @@
1
- /// <reference types="react" />
2
- import { ErrorBag, Errors } from '@inertiajs/core';
3
- interface Props {
4
- heading?: string;
5
- errors?: Errors & ErrorBag;
6
- renderKeys?: boolean;
7
- className?: string;
8
- }
9
- export default function ErrorList({ heading, errors, renderKeys, className, }: Props): JSX.Element;
10
- export {};
@@ -1,6 +0,0 @@
1
- /// <reference types="react" />
2
- interface Props {
3
- populatePurchaseOptions: boolean;
4
- }
5
- export default function FormTester({ populatePurchaseOptions }: Props): JSX.Element;
6
- export {};
@@ -1,11 +0,0 @@
1
- /// <reference types="react" />
2
- interface Props {
3
- value?: number;
4
- onChange: (value: number) => void;
5
- id?: string;
6
- name?: string;
7
- className?: string;
8
- required?: boolean;
9
- }
10
- export default function MoneyField({ value, onChange, name, id, className, required }: Props): JSX.Element;
11
- export {};
@@ -1,29 +0,0 @@
1
- /// <reference types="react" />
2
- import { MotorwebVehicleResponse, VehicleType } from '../../types';
3
- export interface VehicleData extends MotorwebVehicleResponse {
4
- make: string;
5
- model: string;
6
- year: string;
7
- vehicle_type: VehicleType;
8
- is_heavy: boolean;
9
- }
10
- export interface RegistrationSearchOnChange {
11
- registration: string;
12
- }
13
- interface Props {
14
- name?: string;
15
- onChange?: (values: RegistrationSearchOnChange) => void;
16
- onVehicleDataFound: (vehicleData: VehicleData) => void;
17
- apiUrl?: string;
18
- showOdometerReadingField?: boolean;
19
- showConditionField?: boolean;
20
- initialRegistrationValue?: string;
21
- outerClassName?: string;
22
- odoInputClassName?: string;
23
- conditionSelectClassName?: string;
24
- regoInputClassName?: string;
25
- searchBtnClassName?: string;
26
- }
27
- export declare const conditionOptions: string[];
28
- export default function RegistrationSearchField({ name, initialRegistrationValue, onVehicleDataFound, apiUrl, showOdometerReadingField, showConditionField, onChange, outerClassName, odoInputClassName, conditionSelectClassName, regoInputClassName, searchBtnClassName, }: Props): JSX.Element;
29
- export {};
@@ -1,6 +0,0 @@
1
- import DateOfBirthField from './DateOfBirthField';
2
- import MoneyField from './MoneyField';
3
- import RegistrationSearchField from './RegistrationSearchField';
4
- import FormTester from './FormTester';
5
- import ErrorList from './ErrorList';
6
- export { DateOfBirthField, MoneyField, RegistrationSearchField, FormTester, ErrorList, };
@@ -1,4 +0,0 @@
1
- export * from './common';
2
- export * from './tables';
3
- export * from './forms';
4
- export * from './filter';
@@ -1,6 +0,0 @@
1
- import React from 'react';
2
- interface Props extends React.DetailedHTMLProps<React.TableHTMLAttributes<HTMLTableElement>, HTMLTableElement> {
3
- children: React.ReactNode;
4
- }
5
- export default function Table({ children, ...props }: Props): JSX.Element;
6
- export {};
@@ -1,7 +0,0 @@
1
- import React from 'react';
2
- interface Props {
3
- children: React.ReactNode;
4
- className?: string;
5
- }
6
- export default function TableActions({ children, className }: Props): JSX.Element;
7
- export {};
@@ -1,7 +0,0 @@
1
- import React from 'react';
2
- interface Props extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement> {
3
- children: React.ReactNode;
4
- className?: string;
5
- }
6
- export default function TableBody({ children, className, ...props }: Props): JSX.Element;
7
- export {};
@@ -1,8 +0,0 @@
1
- import React from 'react';
2
- interface Props extends React.DetailedHTMLProps<React.TdHTMLAttributes<HTMLTableDataCellElement>, HTMLTableDataCellElement> {
3
- children: React.ReactNode;
4
- className?: string;
5
- condensed?: true;
6
- }
7
- export default function TableCell({ children, className, condensed, ...props }: Props): JSX.Element;
8
- export {};
@@ -1,7 +0,0 @@
1
- import React from 'react';
2
- interface Props extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement> {
3
- children: React.ReactNode;
4
- className?: string;
5
- }
6
- export default function TableHead({ children, className, ...props }: Props): JSX.Element;
7
- export {};
@@ -1,10 +0,0 @@
1
- import React from 'react';
2
- interface Props extends React.DetailedHTMLProps<React.ThHTMLAttributes<HTMLTableHeaderCellElement>, HTMLTableHeaderCellElement> {
3
- children: React.ReactNode;
4
- className?: string;
5
- textAlign?: 'left' | 'right' | 'center';
6
- sort?: string;
7
- condensed?: true;
8
- }
9
- export default function TableHeader({ children, className, sort, textAlign, condensed, ...props }: Props): JSX.Element;
10
- export {};
@@ -1,8 +0,0 @@
1
- import React from 'react';
2
- interface Props extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLTableRowElement>, HTMLTableRowElement> {
3
- children: React.ReactNode;
4
- className?: string;
5
- onClick?: (e?: React.SyntheticEvent) => void;
6
- }
7
- export default function TableRow({ children, className, onClick, ...props }: Props): JSX.Element;
8
- export {};
@@ -1,8 +0,0 @@
1
- import Table from './Table';
2
- import TableActions from './TableActions';
3
- import TableBody from './TableBody';
4
- import TableCell from './TableCell';
5
- import TableHead from './TableHead';
6
- import TableHeader from './TableHeader';
7
- import TableRow from './TableRow';
8
- export { Table, TableActions, TableBody, TableCell, TableHead, TableHeader, TableRow, };
package/dist/index.js DELETED
@@ -1,8 +0,0 @@
1
-
2
- 'use strict'
3
-
4
- if (process.env.NODE_ENV === 'production') {
5
- module.exports = require('./sdk.cjs.production.min.js')
6
- } else {
7
- module.exports = require('./sdk.cjs.development.js')
8
- }
@@ -1,54 +0,0 @@
1
- export interface AddressCompletion {
2
- a: string;
3
- pxid: string;
4
- v: number;
5
- }
6
- export interface AddressData {
7
- pxid: string;
8
- a: string;
9
- aims_address_id: string;
10
- sufi: number;
11
- ta_id: string;
12
- ta: string;
13
- tasub_id: string;
14
- tasub: string;
15
- number: string;
16
- x: string;
17
- y: string;
18
- postcode: string;
19
- street: string;
20
- street_name: string;
21
- street_type: string;
22
- city: string;
23
- suburb: string;
24
- region_id: string;
25
- region: string;
26
- postal_line_1: string;
27
- postal_line_2: string;
28
- aims_road_section_id: string;
29
- rural: string;
30
- address_line_1: string;
31
- address_line_2?: string;
32
- primary_parcel_id: string;
33
- meshblock: string;
34
- sa1_id: string;
35
- sa2_id: string;
36
- sa2: string;
37
- cb_id: string;
38
- cb: string;
39
- ward_id: string;
40
- ward: string;
41
- con_id: string;
42
- con: string;
43
- maoricon_id: string;
44
- maoricon: string;
45
- iur_id: string;
46
- iur: string;
47
- ur_id: string;
48
- ur: string;
49
- landwater_id: string;
50
- landwater: string;
51
- success: boolean;
52
- }
53
- export declare function autocomplete(search: string): Promise<AddressCompletion[]>;
54
- export declare function getAddressData(completion: AddressCompletion): Promise<AddressData | null>;
@@ -1,2 +0,0 @@
1
- import type { AuthContext } from '../types';
2
- export declare function useAuth(): AuthContext;
@@ -1,4 +0,0 @@
1
- /**
2
- * Calculate someone's age from a date of birth.
3
- */
4
- export declare function calculateAge(date: string | Date | null | undefined): number;
@@ -1,19 +0,0 @@
1
- import type { PolicyEnhancement, QuoteRequestPurchaseOption } from "../types";
2
- interface CalculationArguments {
3
- option: QuoteRequestPurchaseOption;
4
- selectedEnhancements: PolicyEnhancement['id'][];
5
- brokerFee?: number;
6
- }
7
- export declare function calcMonthlyEnhancementPrice(enhancement: PolicyEnhancement): number;
8
- /**
9
- * Fix rounding errors we get from subtracting, and then adding GST back on
10
- * (Issues with 2 decimal place rounding)
11
- */
12
- export declare function fixRoundingError(premium: number): number;
13
- export declare function calcPurchaseOptionPricing({ option, selectedEnhancements, brokerFee }: CalculationArguments): {
14
- monthly: number;
15
- annually: number;
16
- monthlyWithGst: number;
17
- annuallyWithGst: number;
18
- };
19
- export {};
@@ -1 +0,0 @@
1
- export declare function useClickOutside(ref: any, handler: (e: Event) => void): void;
@@ -1,20 +0,0 @@
1
- /**
2
- * Formats a date like "Jan 1, 2022 at 9:50am"
3
- */
4
- export declare function formatDateNice(date: string | null | undefined, includeTime?: boolean): string;
5
- /**
6
- * Formats a date like "01/01/2022 09:50"
7
- */
8
- export declare function formatDateForTable(date: string | null | undefined, includeTime?: boolean): string;
9
- /**
10
- * Formats a date to Star Insure standard format - dd/mm/yyyy
11
- */
12
- export declare function formatDate(date: Date | string | null | undefined, overrideFormatString?: string): string;
13
- /**
14
- * Formats a dateTime to Star Insure standard format - dd/mm/yyyy hh:mm
15
- */
16
- export declare function formatDateTime(dateTime: Date | string | null | undefined, overrideFormatString?: string): string;
17
- /**
18
- * Attempts to create a date object from a date string
19
- */
20
- export declare function createDate(dateString: Date | string | null | undefined): Date | null;
@@ -1,20 +0,0 @@
1
- declare type FetchOptions = {
2
- url: string;
3
- method?: 'GET' | 'POST' | 'PUT' | 'DELETE';
4
- params?: Record<string, any>;
5
- headers?: Record<string, string>;
6
- };
7
- declare type FetcherFunction<T> = () => Promise<{
8
- ok: false;
9
- message: string | undefined;
10
- data?: undefined;
11
- } | {
12
- ok: true;
13
- data?: T;
14
- message: string | undefined;
15
- }>;
16
- /**
17
- * A helper to return a fetch function including default headers and authorization.
18
- */
19
- export declare function useFetch<T = any>({ url: baseUrl, method, params, headers, }: FetchOptions): FetcherFunction<T>;
20
- export {};
@@ -1,14 +0,0 @@
1
- export * from './dates';
2
- export * from './money';
3
- export * from './vehicles';
4
- export * from './auth';
5
- export * from './clickOutside';
6
- export * from './inertiaOptions';
7
- export * from './localStorage';
8
- export * from './toast';
9
- export * from './quoteRequestForm';
10
- export * from './quoteRequestOptions';
11
- export * from './addressFinder';
12
- export * from './calculateAge';
13
- export * from './calculatePricing';
14
- export * from './fetch';
@@ -1,6 +0,0 @@
1
- import type { VisitOptions } from '@inertiajs/core';
2
- interface Options {
3
- successMessage?: string;
4
- }
5
- export declare function useInertiaOptions({ successMessage }?: Options): VisitOptions;
6
- export {};
@@ -1 +0,0 @@
1
- export declare function useLocalStorage<T>(key: string, initialValue: T): readonly [T, (value: T | ((val: T) => T)) => void];
@@ -1,32 +0,0 @@
1
- /**
2
- * Safely rounds a number
3
- */
4
- export declare function round(value: number): number;
5
- /**
6
- * Gets the GST value from a number
7
- */
8
- export declare function getGst(value: number): number;
9
- /**
10
- * Adds GST to a number
11
- */
12
- export declare function addGst(value: number): number;
13
- /**
14
- * Subtracts GST from a number
15
- */
16
- export declare function subtractGst(value: number): number;
17
- /**
18
- * Calculates the various GST values on a figure
19
- */
20
- export declare function gstCalc(input: number | string): {
21
- gst: number;
22
- amountInclusive: number;
23
- amountExclusive: number;
24
- };
25
- /**
26
- * Formats a value nicely
27
- */
28
- export declare function formatMoney(value: string | number | null | undefined, decimals?: number): string;
29
- /**
30
- * Turns a formatted value in to a float
31
- */
32
- export declare function formatNumber(value: string): number;