@star-insure/sdk 1.1.0 → 1.1.3
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/index.d.ts → index.js} +4 -3
- package/package.json +5 -11
- package/src/components/forms/RegistrationSearchField.tsx +2 -1
- package/dist/components/common/Button.d.ts +0 -14
- package/dist/components/common/Card.d.ts +0 -7
- package/dist/components/common/Modal.d.ts +0 -9
- package/dist/components/common/Pagination.d.ts +0 -9
- package/dist/components/common/ToastItem.d.ts +0 -3
- package/dist/components/common/Toasts.d.ts +0 -2
- package/dist/components/common/index.d.ts +0 -7
- package/dist/components/forms/DateOfBirthField.d.ts +0 -7
- package/dist/components/forms/Errors.d.ts +0 -10
- package/dist/components/forms/FormTester.d.ts +0 -6
- package/dist/components/forms/MoneyField.d.ts +0 -11
- package/dist/components/forms/RegistrationSearchField.d.ts +0 -23
- package/dist/components/forms/index.d.ts +0 -6
- package/dist/components/index.d.ts +0 -3
- package/dist/components/tables/Table.d.ts +0 -6
- package/dist/components/tables/TableActions.d.ts +0 -7
- package/dist/components/tables/TableBody.d.ts +0 -7
- package/dist/components/tables/TableCell.d.ts +0 -7
- package/dist/components/tables/TableHead.d.ts +0 -7
- package/dist/components/tables/TableHeader.d.ts +0 -9
- package/dist/components/tables/TableRow.d.ts +0 -8
- package/dist/components/tables/index.d.ts +0 -8
- package/dist/index.js +0 -8
- package/dist/lib/addressFinder.d.ts +0 -54
- package/dist/lib/auth.d.ts +0 -2
- package/dist/lib/calculateAge.d.ts +0 -5
- package/dist/lib/clickOutside.d.ts +0 -1
- package/dist/lib/dates.d.ts +0 -8
- package/dist/lib/index.d.ts +0 -12
- package/dist/lib/inertiaOptions.d.ts +0 -6
- package/dist/lib/localStorage.d.ts +0 -1
- package/dist/lib/money.d.ts +0 -32
- package/dist/lib/quoteRequestForm.d.ts +0 -19
- package/dist/lib/quoteRequestOptions.d.ts +0 -11
- package/dist/lib/toast.d.ts +0 -10
- package/dist/lib/vehicles.d.ts +0 -2
- package/dist/sdk.cjs.development.js +0 -2005
- package/dist/sdk.cjs.development.js.map +0 -1
- package/dist/sdk.cjs.production.min.js +0 -2
- package/dist/sdk.cjs.production.min.js.map +0 -1
- package/dist/sdk.esm.js +0 -1955
- package/dist/sdk.esm.js.map +0 -1
- package/dist/types/api/auth.d.ts +0 -9
- package/dist/types/api/enums.d.ts +0 -4
- package/dist/types/api/index.d.ts +0 -31
- package/dist/types/api/responses/claimRequestActions.d.ts +0 -12
- package/dist/types/api/responses/index.d.ts +0 -1
- package/dist/types/index.d.ts +0 -3
- package/dist/types/misc/index.d.ts +0 -8
- package/dist/types/misc/inertia.d.ts +0 -8
- package/dist/types/models/auth/Group.d.ts +0 -10
- package/dist/types/models/auth/Permission.d.ts +0 -4
- package/dist/types/models/auth/Role.d.ts +0 -6
- package/dist/types/models/auth/User.d.ts +0 -12
- package/dist/types/models/auth/index.d.ts +0 -4
- package/dist/types/models/claims/ClaimRequest.d.ts +0 -287
- package/dist/types/models/claims/index.d.ts +0 -1
- package/dist/types/models/index.d.ts +0 -6
- package/dist/types/models/oracle/Risk.d.ts +0 -8
- package/dist/types/models/oracle/TableData.d.ts +0 -9
- package/dist/types/models/oracle/index.d.ts +0 -2
- package/dist/types/models/payments/Gateways.d.ts +0 -1
- package/dist/types/models/payments/Payment.d.ts +0 -35
- package/dist/types/models/payments/index.d.ts +0 -2
- package/dist/types/models/quotes/Club.d.ts +0 -4
- package/dist/types/models/quotes/EmailContentOption.d.ts +0 -7
- package/dist/types/models/quotes/InformationRequest.d.ts +0 -34
- package/dist/types/models/quotes/Lead.d.ts +0 -17
- package/dist/types/models/quotes/MotorwebVehicle.d.ts +0 -120
- package/dist/types/models/quotes/PolicyBenefit.d.ts +0 -16
- package/dist/types/models/quotes/PolicyEnhancement.d.ts +0 -11
- package/dist/types/models/quotes/PostalAddress.d.ts +0 -7
- package/dist/types/models/quotes/PromoCode.d.ts +0 -18
- package/dist/types/models/quotes/QuoteRequest.d.ts +0 -88
- package/dist/types/models/quotes/QuoteRequestDeclaration.d.ts +0 -22
- package/dist/types/models/quotes/QuoteRequestForm.d.ts +0 -112
- package/dist/types/models/quotes/QuoteRequestIncident.d.ts +0 -5
- package/dist/types/models/quotes/QuoteRequestLog.d.ts +0 -10
- package/dist/types/models/quotes/QuoteRequestOptions.d.ts +0 -59
- package/dist/types/models/quotes/QuoteRequestPurchaseOption.d.ts +0 -35
- package/dist/types/models/quotes/QuoteRequestReferrer.d.ts +0 -7
- package/dist/types/models/quotes/QuoteRequestReferrerCategory.d.ts +0 -4
- package/dist/types/models/quotes/QuoteRequestVehicle.d.ts +0 -20
- package/dist/types/models/quotes/QuoteRequestVehicleDriver.d.ts +0 -10
- package/dist/types/models/quotes/RedbookVehicle.d.ts +0 -55
- package/dist/types/models/quotes/StreetAddress.d.ts +0 -8
- package/dist/types/models/quotes/index.d.ts +0 -22
- package/dist/types/models/sms-messages/SmsContentOption.d.ts +0 -7
- package/dist/types/models/sms-messages/SmsMessage.d.ts +0 -18
- package/dist/types/models/sms-messages/SmsMessageReply.d.ts +0 -10
- package/dist/types/models/sms-messages/index.d.ts +0 -3
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
export * from './types';
|
|
2
|
-
export * from './lib';
|
|
3
|
-
export * from './components';
|
|
1
|
+
export * from './types';
|
|
2
|
+
export * from './lib';
|
|
3
|
+
export * from './components';
|
|
4
|
+
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -2,14 +2,14 @@
|
|
|
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": "1.1.
|
|
5
|
+
"version": "1.1.3",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
9
9
|
"url": "https://github.com/star-insure/sdk"
|
|
10
10
|
},
|
|
11
|
-
"main": "
|
|
12
|
-
"typings": "
|
|
11
|
+
"main": "index.js",
|
|
12
|
+
"typings": "index.d.ts",
|
|
13
13
|
"files": [
|
|
14
14
|
"dist",
|
|
15
15
|
"src"
|
|
@@ -18,14 +18,8 @@
|
|
|
18
18
|
"node": ">=10"
|
|
19
19
|
},
|
|
20
20
|
"scripts": {
|
|
21
|
-
"dev": "
|
|
22
|
-
"
|
|
23
|
-
"build": "tsdx build",
|
|
24
|
-
"test": "tsdx test",
|
|
25
|
-
"lint": "tsdx lint",
|
|
26
|
-
"prepare": "tsdx build",
|
|
27
|
-
"size": "size-limit",
|
|
28
|
-
"analyze": "size-limit --why"
|
|
21
|
+
"dev": "tsc",
|
|
22
|
+
"build": "tsc"
|
|
29
23
|
},
|
|
30
24
|
"husky": {
|
|
31
25
|
"hooks": {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { sanitiseVehicleType } from '../../lib';
|
|
3
|
+
import { ApiResponse, FormStatus, MotorwebVehicleResponse, VehicleType } from '../../types';
|
|
3
4
|
import { useToast } from '../../lib/toast';
|
|
4
5
|
|
|
5
6
|
export interface VehicleData extends MotorwebVehicleResponse {
|
|
@@ -1,14 +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
|
-
}
|
|
13
|
-
export default function Button({ className, href, target, onClick, type, children, status, disabled, as }: Props): JSX.Element;
|
|
14
|
-
export {};
|
|
@@ -1,9 +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
|
-
}
|
|
8
|
-
export default function Pagination({ meta, className, showPerPageSelector }: Props): JSX.Element;
|
|
9
|
-
export {};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import Button from './Button';
|
|
2
|
-
import Card from './Card';
|
|
3
|
-
import Pagination from './Pagination';
|
|
4
|
-
import ToastItem from './ToastItem';
|
|
5
|
-
import Toasts from './Toasts';
|
|
6
|
-
import Modal from './Modal';
|
|
7
|
-
export { Button, Card, Pagination, ToastItem, Toasts, Modal, };
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { ErrorBag, Errors } from "@inertiajs/inertia";
|
|
3
|
-
interface Props {
|
|
4
|
-
heading?: string;
|
|
5
|
-
errors?: Errors & ErrorBag;
|
|
6
|
-
renderKeys?: boolean;
|
|
7
|
-
className?: string;
|
|
8
|
-
}
|
|
9
|
-
export default function Errors({ heading, errors, renderKeys, className }: Props): JSX.Element;
|
|
10
|
-
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,23 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { MotorwebVehicleResponse, VehicleType } from '../../';
|
|
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
|
-
onChange?: (values: RegistrationSearchOnChange) => void;
|
|
15
|
-
onVehicleDataFound: (vehicleData: VehicleData) => void;
|
|
16
|
-
apiUrl?: string;
|
|
17
|
-
showOdometerReadingField?: boolean;
|
|
18
|
-
showConditionField?: boolean;
|
|
19
|
-
initialRegistrationValue?: string;
|
|
20
|
-
}
|
|
21
|
-
export declare const conditionOptions: string[];
|
|
22
|
-
export default function RegistrationSearchField({ initialRegistrationValue, onVehicleDataFound, apiUrl, showOdometerReadingField, showConditionField, onChange, }: Props): JSX.Element;
|
|
23
|
-
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 Errors from './Errors';
|
|
6
|
-
export { DateOfBirthField, MoneyField, RegistrationSearchField, FormTester, Errors, };
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
interface Props {
|
|
3
|
-
children: React.ReactNode;
|
|
4
|
-
className?: string;
|
|
5
|
-
textAlign?: 'left' | 'right' | 'center';
|
|
6
|
-
sort?: string;
|
|
7
|
-
}
|
|
8
|
-
export default function TableHeader({ children, className, sort, textAlign }: Props): JSX.Element;
|
|
9
|
-
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,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>;
|
package/dist/lib/auth.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function useClickOutside(ref: any, handler: (e: Event) => void): void;
|
package/dist/lib/dates.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Formats a date like "Jan 1, 2022 at 9:50am"
|
|
3
|
-
*/
|
|
4
|
-
export declare function formatDateNice(date: string, includeTime?: boolean): string;
|
|
5
|
-
/**
|
|
6
|
-
* Formats a date like "01/01/2022 9:50AM"
|
|
7
|
-
*/
|
|
8
|
-
export declare function formatDateForTable(date: string, includeTime?: boolean): string;
|
package/dist/lib/index.d.ts
DELETED
|
@@ -1,12 +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';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function useLocalStorage<T>(key: string, initialValue: T): readonly [T, (value: T | ((val: T) => T)) => void];
|
package/dist/lib/money.d.ts
DELETED
|
@@ -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, decimals?: number): string;
|
|
29
|
-
/**
|
|
30
|
-
* Turns a formatted value in to a float
|
|
31
|
-
*/
|
|
32
|
-
export declare function formatNumber(value: string): number;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { InertiaFormProps } from "@inertiajs/inertia-react";
|
|
3
|
-
import type { QuoteRequest } from '../types';
|
|
4
|
-
interface QuoteRequestFormContextInterface {
|
|
5
|
-
form?: InertiaFormProps<QuoteRequest>;
|
|
6
|
-
handleChange?: (e: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement>) => void;
|
|
7
|
-
}
|
|
8
|
-
export declare const initialData: QuoteRequest;
|
|
9
|
-
export declare const QuoteRequestFormContext: React.Context<QuoteRequestFormContextInterface>;
|
|
10
|
-
export declare function QuoteRequestFormProvider({ children }: {
|
|
11
|
-
children: React.ReactNode;
|
|
12
|
-
}): JSX.Element;
|
|
13
|
-
/**
|
|
14
|
-
* Takes in a quote request and returns data suitable to populate a form
|
|
15
|
-
* by recursively calling this function, converting null to undefined.
|
|
16
|
-
*/
|
|
17
|
-
export declare function sanitiseQuoteRequestFormData(value: any): any;
|
|
18
|
-
export declare const useQuoteRequestForm: () => QuoteRequestFormContextInterface;
|
|
19
|
-
export {};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { QuoteRequestOptions } from '../';
|
|
3
|
-
interface QuoteRequestFormContextInterface {
|
|
4
|
-
options?: QuoteRequestOptions;
|
|
5
|
-
setOptions: (options: QuoteRequestOptions) => void;
|
|
6
|
-
}
|
|
7
|
-
export declare function QuoteRequestOptionsProvider({ children }: {
|
|
8
|
-
children: React.ReactNode;
|
|
9
|
-
}): JSX.Element;
|
|
10
|
-
export declare const useQuoteRequestOptions: () => QuoteRequestFormContextInterface;
|
|
11
|
-
export {};
|
package/dist/lib/toast.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import type { Toast } from "../types";
|
|
3
|
-
interface ToastContextInterface {
|
|
4
|
-
toasts: Toast[];
|
|
5
|
-
addToast: (toast: Toast) => void;
|
|
6
|
-
removeToast: (id: Toast['_id']) => void;
|
|
7
|
-
}
|
|
8
|
-
export declare function ToastProvider({ children }: any): JSX.Element;
|
|
9
|
-
export declare const useToast: () => ToastContextInterface;
|
|
10
|
-
export {};
|
package/dist/lib/vehicles.d.ts
DELETED