@teamnetwork-nz/gosweetspot-mcp-server 0.1.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/README.md +174 -0
- package/dist/client.d.ts +29 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +95 -0
- package/dist/client.js.map +1 -0
- package/dist/config.d.ts +10 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +33 -0
- package/dist/config.js.map +1 -0
- package/dist/datetime.d.ts +5 -0
- package/dist/datetime.d.ts.map +1 -0
- package/dist/datetime.js +65 -0
- package/dist/datetime.js.map +1 -0
- package/dist/format.d.ts +4 -0
- package/dist/format.d.ts.map +1 -0
- package/dist/format.js +58 -0
- package/dist/format.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +77 -0
- package/dist/index.js.map +1 -0
- package/dist/schemas/models.d.ts +118 -0
- package/dist/schemas/models.d.ts.map +1 -0
- package/dist/schemas/models.js +43 -0
- package/dist/schemas/models.js.map +1 -0
- package/dist/tools/address.d.ts +3 -0
- package/dist/tools/address.d.ts.map +1 -0
- package/dist/tools/address.js +28 -0
- package/dist/tools/address.js.map +1 -0
- package/dist/tools/connection.d.ts +3 -0
- package/dist/tools/connection.d.ts.map +1 -0
- package/dist/tools/connection.js +42 -0
- package/dist/tools/connection.js.map +1 -0
- package/dist/tools/customerorders.d.ts +3 -0
- package/dist/tools/customerorders.d.ts.map +1 -0
- package/dist/tools/customerorders.js +87 -0
- package/dist/tools/customerorders.js.map +1 -0
- package/dist/tools/index.d.ts +3 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +19 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/manifest.d.ts +3 -0
- package/dist/tools/manifest.d.ts.map +1 -0
- package/dist/tools/manifest.js +21 -0
- package/dist/tools/manifest.js.map +1 -0
- package/dist/tools/pickup.d.ts +3 -0
- package/dist/tools/pickup.d.ts.map +1 -0
- package/dist/tools/pickup.js +26 -0
- package/dist/tools/pickup.js.map +1 -0
- package/dist/tools/printing.d.ts +3 -0
- package/dist/tools/printing.d.ts.map +1 -0
- package/dist/tools/printing.js +64 -0
- package/dist/tools/printing.js.map +1 -0
- package/dist/tools/rates.d.ts +3 -0
- package/dist/tools/rates.d.ts.map +1 -0
- package/dist/tools/rates.js +34 -0
- package/dist/tools/rates.js.map +1 -0
- package/dist/tools/shipments.d.ts +3 -0
- package/dist/tools/shipments.d.ts.map +1 -0
- package/dist/tools/shipments.js +131 -0
- package/dist/tools/shipments.js.map +1 -0
- package/dist/types.d.ts +7 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +5 -0
- package/dist/types.js.map +1 -0
- package/package.json +42 -0
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const addressSchema: z.ZodObject<{
|
|
3
|
+
BuildingName: z.ZodOptional<z.ZodString>;
|
|
4
|
+
StreetAddress: z.ZodString;
|
|
5
|
+
Suburb: z.ZodOptional<z.ZodString>;
|
|
6
|
+
City: z.ZodString;
|
|
7
|
+
PostCode: z.ZodString;
|
|
8
|
+
CountryCode: z.ZodString;
|
|
9
|
+
}, "strip", z.ZodTypeAny, {
|
|
10
|
+
StreetAddress: string;
|
|
11
|
+
City: string;
|
|
12
|
+
PostCode: string;
|
|
13
|
+
CountryCode: string;
|
|
14
|
+
BuildingName?: string | undefined;
|
|
15
|
+
Suburb?: string | undefined;
|
|
16
|
+
}, {
|
|
17
|
+
StreetAddress: string;
|
|
18
|
+
City: string;
|
|
19
|
+
PostCode: string;
|
|
20
|
+
CountryCode: string;
|
|
21
|
+
BuildingName?: string | undefined;
|
|
22
|
+
Suburb?: string | undefined;
|
|
23
|
+
}>;
|
|
24
|
+
export declare const contactSchema: z.ZodObject<{
|
|
25
|
+
Name: z.ZodString;
|
|
26
|
+
Address: z.ZodObject<{
|
|
27
|
+
BuildingName: z.ZodOptional<z.ZodString>;
|
|
28
|
+
StreetAddress: z.ZodString;
|
|
29
|
+
Suburb: z.ZodOptional<z.ZodString>;
|
|
30
|
+
City: z.ZodString;
|
|
31
|
+
PostCode: z.ZodString;
|
|
32
|
+
CountryCode: z.ZodString;
|
|
33
|
+
}, "strip", z.ZodTypeAny, {
|
|
34
|
+
StreetAddress: string;
|
|
35
|
+
City: string;
|
|
36
|
+
PostCode: string;
|
|
37
|
+
CountryCode: string;
|
|
38
|
+
BuildingName?: string | undefined;
|
|
39
|
+
Suburb?: string | undefined;
|
|
40
|
+
}, {
|
|
41
|
+
StreetAddress: string;
|
|
42
|
+
City: string;
|
|
43
|
+
PostCode: string;
|
|
44
|
+
CountryCode: string;
|
|
45
|
+
BuildingName?: string | undefined;
|
|
46
|
+
Suburb?: string | undefined;
|
|
47
|
+
}>;
|
|
48
|
+
ContactPerson: z.ZodOptional<z.ZodString>;
|
|
49
|
+
PhoneNumber: z.ZodOptional<z.ZodString>;
|
|
50
|
+
Email: z.ZodOptional<z.ZodString>;
|
|
51
|
+
DeliveryInstructions: z.ZodOptional<z.ZodString>;
|
|
52
|
+
IsRural: z.ZodOptional<z.ZodBoolean>;
|
|
53
|
+
ExplicitNotRural: z.ZodOptional<z.ZodBoolean>;
|
|
54
|
+
SendTrackingEmail: z.ZodOptional<z.ZodBoolean>;
|
|
55
|
+
}, "strip", z.ZodTypeAny, {
|
|
56
|
+
Name: string;
|
|
57
|
+
Address: {
|
|
58
|
+
StreetAddress: string;
|
|
59
|
+
City: string;
|
|
60
|
+
PostCode: string;
|
|
61
|
+
CountryCode: string;
|
|
62
|
+
BuildingName?: string | undefined;
|
|
63
|
+
Suburb?: string | undefined;
|
|
64
|
+
};
|
|
65
|
+
ContactPerson?: string | undefined;
|
|
66
|
+
PhoneNumber?: string | undefined;
|
|
67
|
+
Email?: string | undefined;
|
|
68
|
+
DeliveryInstructions?: string | undefined;
|
|
69
|
+
IsRural?: boolean | undefined;
|
|
70
|
+
ExplicitNotRural?: boolean | undefined;
|
|
71
|
+
SendTrackingEmail?: boolean | undefined;
|
|
72
|
+
}, {
|
|
73
|
+
Name: string;
|
|
74
|
+
Address: {
|
|
75
|
+
StreetAddress: string;
|
|
76
|
+
City: string;
|
|
77
|
+
PostCode: string;
|
|
78
|
+
CountryCode: string;
|
|
79
|
+
BuildingName?: string | undefined;
|
|
80
|
+
Suburb?: string | undefined;
|
|
81
|
+
};
|
|
82
|
+
ContactPerson?: string | undefined;
|
|
83
|
+
PhoneNumber?: string | undefined;
|
|
84
|
+
Email?: string | undefined;
|
|
85
|
+
DeliveryInstructions?: string | undefined;
|
|
86
|
+
IsRural?: boolean | undefined;
|
|
87
|
+
ExplicitNotRural?: boolean | undefined;
|
|
88
|
+
SendTrackingEmail?: boolean | undefined;
|
|
89
|
+
}>;
|
|
90
|
+
export declare const packageSchema: z.ZodObject<{
|
|
91
|
+
Name: z.ZodOptional<z.ZodString>;
|
|
92
|
+
PackageCode: z.ZodOptional<z.ZodString>;
|
|
93
|
+
Type: z.ZodOptional<z.ZodString>;
|
|
94
|
+
Length: z.ZodNumber;
|
|
95
|
+
Width: z.ZodNumber;
|
|
96
|
+
Height: z.ZodNumber;
|
|
97
|
+
Kg: z.ZodNumber;
|
|
98
|
+
HasDG: z.ZodOptional<z.ZodBoolean>;
|
|
99
|
+
}, "strip", z.ZodTypeAny, {
|
|
100
|
+
Length: number;
|
|
101
|
+
Width: number;
|
|
102
|
+
Height: number;
|
|
103
|
+
Kg: number;
|
|
104
|
+
Name?: string | undefined;
|
|
105
|
+
PackageCode?: string | undefined;
|
|
106
|
+
Type?: string | undefined;
|
|
107
|
+
HasDG?: boolean | undefined;
|
|
108
|
+
}, {
|
|
109
|
+
Length: number;
|
|
110
|
+
Width: number;
|
|
111
|
+
Height: number;
|
|
112
|
+
Kg: number;
|
|
113
|
+
Name?: string | undefined;
|
|
114
|
+
PackageCode?: string | undefined;
|
|
115
|
+
Type?: string | undefined;
|
|
116
|
+
HasDG?: boolean | undefined;
|
|
117
|
+
}>;
|
|
118
|
+
//# sourceMappingURL=models.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../src/schemas/models.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;EASI,CAAC;AAG/B,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAeS,CAAC;AAGpC,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;EAWK,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
// Contact address — used inside Origin/Destination and address validation.
|
|
3
|
+
export const addressSchema = z
|
|
4
|
+
.object({
|
|
5
|
+
BuildingName: z.string().optional().describe('Building / company name at the address'),
|
|
6
|
+
StreetAddress: z.string().describe('Street number and name, e.g. "12 Wadier Place"'),
|
|
7
|
+
Suburb: z.string().optional().describe('Suburb'),
|
|
8
|
+
City: z.string().describe('City / town'),
|
|
9
|
+
PostCode: z.string().describe('Post code'),
|
|
10
|
+
CountryCode: z.string().describe('ISO Alpha-2 country code, e.g. "NZ", "AU"'),
|
|
11
|
+
})
|
|
12
|
+
.describe('Contact address');
|
|
13
|
+
// A contact (origin or destination) with an embedded address.
|
|
14
|
+
export const contactSchema = z
|
|
15
|
+
.object({
|
|
16
|
+
Name: z.string().describe('Company or person name at this location'),
|
|
17
|
+
Address: addressSchema,
|
|
18
|
+
ContactPerson: z.string().optional().describe('Named contact person'),
|
|
19
|
+
PhoneNumber: z.string().optional().describe('Contact phone number'),
|
|
20
|
+
Email: z.string().optional().describe('Contact email'),
|
|
21
|
+
DeliveryInstructions: z.string().optional().describe('Free-text delivery instructions'),
|
|
22
|
+
IsRural: z.boolean().optional().describe('Force rural delivery flag'),
|
|
23
|
+
ExplicitNotRural: z.boolean().optional().describe('Explicitly mark the address as non-rural'),
|
|
24
|
+
SendTrackingEmail: z
|
|
25
|
+
.boolean()
|
|
26
|
+
.optional()
|
|
27
|
+
.describe('Send the receiver a tracking email on dispatch'),
|
|
28
|
+
})
|
|
29
|
+
.describe('Contact with address');
|
|
30
|
+
// A package/parcel line in a rate query or shipment.
|
|
31
|
+
export const packageSchema = z
|
|
32
|
+
.object({
|
|
33
|
+
Name: z.string().optional().describe('Package/stock-size name, e.g. "GSS-DLE SATCHEL"'),
|
|
34
|
+
PackageCode: z.string().optional().describe('Stock size code, e.g. "DLE"'),
|
|
35
|
+
Type: z.string().optional().describe('Package type, e.g. "Box", "Satchel"'),
|
|
36
|
+
Length: z.number().describe('Length in cm'),
|
|
37
|
+
Width: z.number().describe('Width in cm'),
|
|
38
|
+
Height: z.number().describe('Height in cm'),
|
|
39
|
+
Kg: z.number().describe('Weight in kilograms'),
|
|
40
|
+
HasDG: z.boolean().optional().describe('Package contains dangerous goods'),
|
|
41
|
+
})
|
|
42
|
+
.describe('Package / parcel');
|
|
43
|
+
//# sourceMappingURL=models.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"models.js","sourceRoot":"","sources":["../../src/schemas/models.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,2EAA2E;AAC3E,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC;KAC3B,MAAM,CAAC;IACN,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,wCAAwC,CAAC;IACtF,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,gDAAgD,CAAC;IACpF,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC;IAChD,IAAI,EAAE,CAAC,C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AAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,iDAAiD,CAAC;IACvF,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,6BAA6B,CAAC;IAC1E,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,qCAAqC,CAAC;IAC3E,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,cAAc,CAAC;IAC3C,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,aAAa,CAAC;IACzC,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,cAAc,CAAC;IAC3C,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,qBAAqB,CAAC;IAC9C,KAAK,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,kCAAkC,CAAC;CAC3E,CAAC;KACD,QAAQ,CAAC,kBAAkB,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"address.d.ts","sourceRoot":"","sources":["../../src/tools/address.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAI7C,eAAO,MAAM,YAAY,EAAE,cAAc,EAwBxC,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { jsonBlock } from '../format.js';
|
|
3
|
+
import { addressSchema } from '../schemas/models.js';
|
|
4
|
+
export const addressTools = [
|
|
5
|
+
{
|
|
6
|
+
name: 'gss_validate_address',
|
|
7
|
+
description: 'Validate a customer address before creating a shipment. For NZ addresses this also assesses rural, Saturday and residential delivery availability, and returns the carrier services available at that address. Read-only.',
|
|
8
|
+
inputSchema: z
|
|
9
|
+
.object({
|
|
10
|
+
consignee: z.string().max(50).describe('Company or person name'),
|
|
11
|
+
contactperson: z.string().max(50).optional().describe('Named contact person'),
|
|
12
|
+
phonenumber: z.string().max(50).optional().describe('Contact phone number'),
|
|
13
|
+
email: z.string().max(200).optional().describe('Contact email'),
|
|
14
|
+
deliveryinstructions: z
|
|
15
|
+
.string()
|
|
16
|
+
.max(120)
|
|
17
|
+
.optional()
|
|
18
|
+
.describe('Free-text delivery instructions'),
|
|
19
|
+
address: addressSchema.describe('Address to validate'),
|
|
20
|
+
})
|
|
21
|
+
.strict(),
|
|
22
|
+
handler: async (client, args) => {
|
|
23
|
+
const data = await client.postQuery('/v2/addressvalidation', args);
|
|
24
|
+
return jsonBlock('Address validation', data);
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
];
|
|
28
|
+
//# sourceMappingURL=address.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"address.js","sourceRoot":"","sources":["../../src/tools/address.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAErD,MAAM,CAAC,MAAM,YAAY,GAAqB;IAC5C;QACE,IAAI,EAAE,sBAAsB;QAC5B,WAAW,EACT,2NAA2N;QAC7N,WAAW,EAAE,CAAC;aACX,MAAM,CAAC;YACN,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,wBAAwB,CAAC;YAChE,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,sBAAsB,CAAC;YAC7E,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,sBAAsB,CAAC;YAC3E,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,eAAe,CAAC;YAC/D,oBAAoB,EAAE,CAAC;iBACpB,MAAM,EAAE;iBACR,GAAG,CAAC,GAAG,CAAC;iBACR,QAAQ,EAAE;iBACV,QAAQ,CAAC,iCAAiC,CAAC;YAC9C,OAAO,EAAE,aAAa,CAAC,QAAQ,CAAC,qBAAqB,CAAC;SACvD,CAAC;aACD,MAAM,EAAE;QACX,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE;YAC9B,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,SAAS,CAAU,uBAAuB,EAAE,IAAI,CAAC,CAAC;YAC5E,OAAO,SAAS,CAAC,oBAAoB,EAAE,IAAI,CAAC,CAAC;QAC/C,CAAC;KACF;CACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connection.d.ts","sourceRoot":"","sources":["../../src/tools/connection.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAG7C,eAAO,MAAM,eAAe,EAAE,cAAc,EA2C3C,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { jsonBlock } from '../format.js';
|
|
3
|
+
export const connectionTools = [
|
|
4
|
+
{
|
|
5
|
+
name: 'gss_test_connection',
|
|
6
|
+
description: 'Verify GoSweetSpot connectivity and credentials by fetching the available carrier services for the configured access key. Reports base URL, site id and read-only/read-write mode.',
|
|
7
|
+
inputSchema: z.object({}).strict(),
|
|
8
|
+
handler: async (client) => {
|
|
9
|
+
const resp = await client.get('/api/availableservices');
|
|
10
|
+
const carriers = resp?.['Carriers'] ?? [];
|
|
11
|
+
const mode = client.isReadWrite()
|
|
12
|
+
? '✏️ read-write'
|
|
13
|
+
: '🔒 read-only (set GSS_READWRITE=true to enable writes)';
|
|
14
|
+
return [
|
|
15
|
+
'GoSweetSpot connection successful.',
|
|
16
|
+
`- **Base URL**: ${client.getBaseUrl()}`,
|
|
17
|
+
`- **Site id**: ${client.getSiteId() ?? '(not set — single-site key)'}`,
|
|
18
|
+
`- **Mode**: ${mode}`,
|
|
19
|
+
`- **Carriers available**: ${carriers.length}`,
|
|
20
|
+
].join('\n');
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
name: 'gss_get_available_services',
|
|
25
|
+
description: 'List the carriers and freight services available to the configured access key, including carrier ids, types and account numbers.',
|
|
26
|
+
inputSchema: z.object({}).strict(),
|
|
27
|
+
handler: async (client) => {
|
|
28
|
+
const data = await client.get('/api/availableservices');
|
|
29
|
+
return jsonBlock('Available carrier services', data);
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
name: 'gss_list_stock_sizes',
|
|
34
|
+
description: 'List the pre-configured stock/package sizes for the account (name, dimensions, weight, cubic volume, TrackPak flag). Use these when building package lines for rates and shipments.',
|
|
35
|
+
inputSchema: z.object({}).strict(),
|
|
36
|
+
handler: async (client) => {
|
|
37
|
+
const data = await client.get('/api/stocksizes');
|
|
38
|
+
return jsonBlock('Stock sizes', data);
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
];
|
|
42
|
+
//# sourceMappingURL=connection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connection.js","sourceRoot":"","sources":["../../src/tools/connection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,MAAM,CAAC,MAAM,eAAe,GAAqB;IAC/C;QACE,IAAI,EAAE,qBAAqB;QAC3B,WAAW,EACT,oLAAoL;QACtL,WAAW,EAAE,CA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AI,CAAC,CAAC;QACxC,CAAC;KACF;CACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"customerorders.d.ts","sourceRoot":"","sources":["../../src/tools/customerorders.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAwB7C,eAAO,MAAM,kBAAkB,EAAE,cAAc,EA+D9C,CAAC"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { jsonBlock } from '../format.js';
|
|
3
|
+
import { toUtcIso } from '../datetime.js';
|
|
4
|
+
// A single customer order line for publishing. GSS accepts a loose set of fields; the
|
|
5
|
+
// commonly-used ones are typed here and any extra keys are passed through.
|
|
6
|
+
const customerOrderSchema = z
|
|
7
|
+
.object({
|
|
8
|
+
packingslipno: z.string().describe('Unique order / packing slip number'),
|
|
9
|
+
consignee: z.string().describe('Recipient company or person name'),
|
|
10
|
+
address1: z.string().optional().describe('Address line 1'),
|
|
11
|
+
address2: z.string().optional().describe('Address line 2'),
|
|
12
|
+
suburb: z.string().optional().describe('Suburb'),
|
|
13
|
+
city: z.string().optional().describe('City / town'),
|
|
14
|
+
postcode: z.string().optional().describe('Post code'),
|
|
15
|
+
country: z.string().optional().describe('ISO Alpha-2 country code, e.g. "NZ"'),
|
|
16
|
+
contactname: z.string().optional().describe('Contact person'),
|
|
17
|
+
contactphone: z.string().optional().describe('Contact phone'),
|
|
18
|
+
email: z.string().optional().describe('Contact email'),
|
|
19
|
+
shippingdescription: z.string().optional().describe('Shipping / service description'),
|
|
20
|
+
issignaturerequired: z.boolean().optional().describe('Require signature on delivery'),
|
|
21
|
+
})
|
|
22
|
+
.passthrough();
|
|
23
|
+
export const customerOrderTools = [
|
|
24
|
+
{
|
|
25
|
+
name: 'gss_list_customer_orders',
|
|
26
|
+
description: 'Retrieve customer orders already published to the GSS queue, with optional filters. Use this to poll the status of orders you previously published.',
|
|
27
|
+
inputSchema: z
|
|
28
|
+
.object({
|
|
29
|
+
packingslipno: z
|
|
30
|
+
.string()
|
|
31
|
+
.optional()
|
|
32
|
+
.describe('Comma-separated list of packing slip numbers to filter on'),
|
|
33
|
+
createdfrom: z
|
|
34
|
+
.string()
|
|
35
|
+
.optional()
|
|
36
|
+
.describe('Earliest created datetime (ISO; converted to UTC)'),
|
|
37
|
+
createdto: z
|
|
38
|
+
.string()
|
|
39
|
+
.optional()
|
|
40
|
+
.describe('Latest created datetime (ISO; converted to UTC)'),
|
|
41
|
+
excludecompleted: z
|
|
42
|
+
.boolean()
|
|
43
|
+
.optional()
|
|
44
|
+
.describe('When true, only return pending (non-completed) orders'),
|
|
45
|
+
includeProducts: z
|
|
46
|
+
.boolean()
|
|
47
|
+
.optional()
|
|
48
|
+
.describe('Include the product lines associated with each order'),
|
|
49
|
+
page: z.number().int().positive().optional().describe('Page number'),
|
|
50
|
+
pagesize: z
|
|
51
|
+
.number()
|
|
52
|
+
.int()
|
|
53
|
+
.positive()
|
|
54
|
+
.optional()
|
|
55
|
+
.describe('Records per page (default 100)'),
|
|
56
|
+
})
|
|
57
|
+
.strict(),
|
|
58
|
+
handler: async (client, args) => {
|
|
59
|
+
const params = { ...args };
|
|
60
|
+
if (args.createdfrom)
|
|
61
|
+
params['createdfrom'] = toUtcIso(args.createdfrom);
|
|
62
|
+
if (args.createdto)
|
|
63
|
+
params['createdto'] = toUtcIso(args.createdto);
|
|
64
|
+
if (params['pagesize'] === undefined)
|
|
65
|
+
params['pagesize'] = client.getDefaultPageSize();
|
|
66
|
+
const data = await client.get('/api/customerorders', params);
|
|
67
|
+
return jsonBlock('Customer orders', data);
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
name: 'gss_publish_customer_orders',
|
|
72
|
+
description: '[write] Publish one or more customer orders into the GSS queue (or update pending ones). Operators can then search/scan the order number in the GSS portal to auto-populate delivery details. Returns a per-order result (success/failure and message).',
|
|
73
|
+
inputSchema: z
|
|
74
|
+
.object({
|
|
75
|
+
orders: z
|
|
76
|
+
.array(customerOrderSchema)
|
|
77
|
+
.min(1)
|
|
78
|
+
.describe('Array of customer orders to publish'),
|
|
79
|
+
})
|
|
80
|
+
.strict(),
|
|
81
|
+
handler: async (client, args) => {
|
|
82
|
+
const data = await client.put('/api/customerorders', args.orders);
|
|
83
|
+
return jsonBlock('Publish customer orders result', data);
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
];
|
|
87
|
+
//# sourceMappingURL=customerorders.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"customerorders.js","sourceRoot":"","sources":["../../src/tools/customerorders.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,sFAAsF;AACtF,2EAA2E;AAC3E,MAAM,mBAAmB,GAAG,CAAC;KAC1B,MAAM,CAAC;IACN,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,oCAAoC,CAAC;IACxE,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,kCAAkC,CAAC;IAClE,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,gBAAgB,CAAC;IAC1D,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,gBAAgB,CAAC;IAC1D,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC;IAChD,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,aAAa,CAAC;IACnD,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAA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AM,EAAE,IAAI,EAAE,EAAE;YAC9B,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,GAAG,CAAU,qBAAqB,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;YAC3E,OAAO,SAAS,CAAC,gCAAgC,EAAE,IAAI,CAAC,CAAC;QAC3D,CAAC;KACF;CACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C,eAAO,MAAM,QAAQ,EAAE,cAAc,EASpC,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { connectionTools } from './connection.js';
|
|
2
|
+
import { rateTools } from './rates.js';
|
|
3
|
+
import { shipmentTools } from './shipments.js';
|
|
4
|
+
import { customerOrderTools } from './customerorders.js';
|
|
5
|
+
import { printingTools } from './printing.js';
|
|
6
|
+
import { manifestTools } from './manifest.js';
|
|
7
|
+
import { pickupTools } from './pickup.js';
|
|
8
|
+
import { addressTools } from './address.js';
|
|
9
|
+
export const allTools = [
|
|
10
|
+
...connectionTools,
|
|
11
|
+
...rateTools,
|
|
12
|
+
...shipmentTools,
|
|
13
|
+
...customerOrderTools,
|
|
14
|
+
...printingTools,
|
|
15
|
+
...manifestTools,
|
|
16
|
+
...pickupTools,
|
|
17
|
+
...addressTools,
|
|
18
|
+
];
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAG5C,MAAM,CAAC,MAAM,QAAQ,GAAqB;IACxC,GAAG,eAAe;IAClB,GAAG,SAAS;IACZ,GAAG,aAAa;IAChB,GAAG,kBAAkB;IACrB,GAAG,aAAa;IAChB,GAAG,aAAa;IAChB,GAAG,WAAW;IACd,GAAG,YAAY;CAChB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../../src/tools/manifest.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAG7C,eAAO,MAAM,aAAa,EAAE,cAAc,EAkBzC,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { jsonBlock } from '../format.js';
|
|
3
|
+
export const manifestTools = [
|
|
4
|
+
{
|
|
5
|
+
name: 'gss_publish_manifest',
|
|
6
|
+
description: '[write] Batch and manifest shipments ready for carrier collection (available on certain carriers only, e.g. Mainstream Freight requires manifesting before pickup booking). Returns a base64-encoded PDF manifest per generated manifest number.',
|
|
7
|
+
inputSchema: z
|
|
8
|
+
.object({
|
|
9
|
+
consignments: z
|
|
10
|
+
.array(z.string())
|
|
11
|
+
.min(1)
|
|
12
|
+
.describe('Consignment numbers to include in the manifest'),
|
|
13
|
+
})
|
|
14
|
+
.strict(),
|
|
15
|
+
handler: async (client, args) => {
|
|
16
|
+
const data = await client.post('/v2/publishmanifest', args.consignments);
|
|
17
|
+
return jsonBlock('Publish manifest result', data);
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
];
|
|
21
|
+
//# sourceMappingURL=manifest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manifest.js","sourceRoot":"","sources":["../../src/tools/manifest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,MAAM,CAAC,MAAM,aAAa,GAAqB;IAC7C;QACE,IAAI,EAAE,sBAAsB;QAC5B,WAAW,EACT,kPAAkP;QACpP,WAAW,EAAE,CAAC;aACX,MAAM,CAAC;YACN,YAAY,EAAE,CAAC;iBACZ,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;iBACjB,GAAG,CAAC,CAAC,CAAC;iBACN,QAAQ,CAAC,gDAAgD,CAAC;SAC9D,CAAC;aACD,MAAM,EAAE;QACX,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE;YAC9B,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,IAAI,CAAU,qBAAqB,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;YAClF,OAAO,SAAS,CAAC,yBAAyB,EAAE,IAAI,CAAC,CAAC;QACpD,CAAC;KACF;CACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pickup.d.ts","sourceRoot":"","sources":["../../src/tools/pickup.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAG7C,eAAO,MAAM,WAAW,EAAE,cAAc,EAyBvC,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { jsonBlock } from '../format.js';
|
|
3
|
+
export const pickupTools = [
|
|
4
|
+
{
|
|
5
|
+
name: 'gss_book_pickup',
|
|
6
|
+
description: '[write] Book a driver to collect parcels from the site. Best-effort same-day collection — book before 2pm for same-day pickup, otherwise book again in the morning. Mainstream Freight consignments must be manifested first (gss_publish_manifest); TIL Freight is booked automatically during manifesting and cannot be booked here.',
|
|
7
|
+
inputSchema: z
|
|
8
|
+
.object({
|
|
9
|
+
Carrier: z
|
|
10
|
+
.string()
|
|
11
|
+
.describe('Carrier to book, e.g. "CastleParcel", "PostHaste", "NZCouriers", "Mainstream", "FedEx", "NZPost", "FirstGlobal"'),
|
|
12
|
+
Consignments: z
|
|
13
|
+
.array(z.string())
|
|
14
|
+
.optional()
|
|
15
|
+
.describe('Consignment numbers to collect (required for Mainstream, FedEx, NZPost)'),
|
|
16
|
+
TotalKg: z.number().optional().describe('Total weight in kg (required for FirstGlobal)'),
|
|
17
|
+
Parts: z.number().int().optional().describe('Number of parts/pieces (required for FirstGlobal)'),
|
|
18
|
+
})
|
|
19
|
+
.strict(),
|
|
20
|
+
handler: async (client, args) => {
|
|
21
|
+
const data = await client.post('/api/bookpickup', args);
|
|
22
|
+
return jsonBlock('Pickup booking result', data);
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
];
|
|
26
|
+
//# sourceMappingURL=pickup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pickup.js","sourceRoot":"","sources":["../../src/tools/pickup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,MAAM,CAAC,MAAM,WAAW,GAAqB;IAC3C;QACE,IAAI,EAAE,iBAAiB;QACvB,WAAW,EACT,wUAAwU;QAC1U,WAAW,EAAE,CAAC;aACX,MAAM,CAAC;YACN,OAAO,EAAE,CAAC;iBACP,MAAM,EAAE;iBACR,QAAQ,CACP,iHAAiH,CAClH;YACH,YAAY,EAAE,CAAC;iBACZ,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;iBACjB,QAAQ,EAAE;iBACV,QAAQ,CAAC,yEAAyE,CAAC;YACtF,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,+CAA+C,CAAC;YACxF,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,mDAAmD,CAAC;SACjG,CAAC;aACD,MAAM,EAAE;QACX,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE;YAC9B,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,IAAI,CAAU,iBAAiB,EAAE,IAAI,CAAC,CAAC;YACjE,OAAO,SAAS,CAAC,uBAAuB,EAAE,IAAI,CAAC,CAAC;QAClD,CAAC;KACF;CACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"printing.d.ts","sourceRoot":"","sources":["../../src/tools/printing.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAG7C,eAAO,MAAM,aAAa,EAAE,cAAc,EAoEzC,CAAC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { jsonBlock } from '../format.js';
|
|
3
|
+
export const printingTools = [
|
|
4
|
+
{
|
|
5
|
+
name: 'gss_list_printers',
|
|
6
|
+
description: 'List printers available to the account. Returns each printer\'s name/path (pass as "Printer" to gss_create_shipment\'s PrintToPrinter, or to gss_print_label), online status and label format.',
|
|
7
|
+
inputSchema: z.object({}).strict(),
|
|
8
|
+
handler: async (client) => {
|
|
9
|
+
const data = await client.get('/api/printers');
|
|
10
|
+
return jsonBlock('Printers', data);
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
name: 'gss_get_label',
|
|
15
|
+
description: 'Download the label(s) for a shipment as base64-encoded binary (PNG or PDF, or ZPL for thermal printers). Read-only — does not affect the print queue.',
|
|
16
|
+
inputSchema: z
|
|
17
|
+
.object({
|
|
18
|
+
connote: z.string().describe('Consignment number to fetch the label for'),
|
|
19
|
+
format: z
|
|
20
|
+
.string()
|
|
21
|
+
.optional()
|
|
22
|
+
.describe('Label format, e.g. "PDF", "PNG100x175", "PNG100x150", "ZPL200", "ZPL300". Omit to use the account default.'),
|
|
23
|
+
rotate: z.boolean().optional().describe('Rotate the label 180 degrees'),
|
|
24
|
+
})
|
|
25
|
+
.strict(),
|
|
26
|
+
handler: async (client, args) => {
|
|
27
|
+
const { connote, ...params } = args;
|
|
28
|
+
const data = await client.get('/api/labels', { connote, ...params });
|
|
29
|
+
return jsonBlock(`Label — ${connote}`, data);
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
name: 'gss_print_label',
|
|
34
|
+
description: '[write] Enqueue an existing shipment\'s label for printing on a physical printer.',
|
|
35
|
+
inputSchema: z
|
|
36
|
+
.object({
|
|
37
|
+
connote: z.string().describe('Consignment number to print'),
|
|
38
|
+
printtoprinter: z
|
|
39
|
+
.string()
|
|
40
|
+
.optional()
|
|
41
|
+
.describe('Printer name; omit to use the printer associated with the access key'),
|
|
42
|
+
})
|
|
43
|
+
.strict(),
|
|
44
|
+
handler: async (client, args) => {
|
|
45
|
+
const data = await client.post('/api/labels', args);
|
|
46
|
+
return jsonBlock('Print label result', data);
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
name: 'gss_enqueue_print',
|
|
51
|
+
description: '[write] Enqueue a raw base64-encoded image directly into the print queue.',
|
|
52
|
+
inputSchema: z
|
|
53
|
+
.object({
|
|
54
|
+
printer: z.string().describe('Target printer name'),
|
|
55
|
+
image: z.string().describe('Base64-encoded image data to print'),
|
|
56
|
+
})
|
|
57
|
+
.strict(),
|
|
58
|
+
handler: async (client, args) => {
|
|
59
|
+
const data = await client.post('/api/labels/enqueue', args);
|
|
60
|
+
return jsonBlock('Enqueue print result', data);
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
];
|
|
64
|
+
//# sourceMappingURL=printing.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|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C"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { jsonBlock } from '../format.js';
|
|
3
|
+
import { contactSchema, packageSchema } from '../schemas/models.js';
|
|
4
|
+
export const rateTools = [
|
|
5
|
+
{
|
|
6
|
+
name: 'gss_get_rates',
|
|
7
|
+
description: 'Get available courier services and rates for a destination and set of packages. This is a read-only price enquiry — it does not create a shipment. Returns available rates (with a QuoteId you can pass to gss_create_shipment), rejected rates with reasons, and validation errors.',
|
|
8
|
+
inputSchema: z
|
|
9
|
+
.object({
|
|
10
|
+
Destination: contactSchema.describe('Delivery destination'),
|
|
11
|
+
Origin: contactSchema
|
|
12
|
+
.optional()
|
|
13
|
+
.describe('Pickup origin. Omit to use the site’s configured address.'),
|
|
14
|
+
Packages: z.array(packageSchema).min(1).describe('One or more packages to rate'),
|
|
15
|
+
DeliveryReference: z
|
|
16
|
+
.string()
|
|
17
|
+
.max(60)
|
|
18
|
+
.optional()
|
|
19
|
+
.describe('Your reference for the delivery (max 60 chars)'),
|
|
20
|
+
IsSignatureRequired: z.boolean().optional().describe('Require signature on delivery'),
|
|
21
|
+
IsSaturdayDelivery: z.boolean().optional().describe('Request Saturday delivery'),
|
|
22
|
+
DeclarationType: z
|
|
23
|
+
.string()
|
|
24
|
+
.optional()
|
|
25
|
+
.describe('Customs declaration type (defaults to merchandise)'),
|
|
26
|
+
})
|
|
27
|
+
.strict(),
|
|
28
|
+
handler: async (client, args) => {
|
|
29
|
+
const data = await client.postQuery('/api/rates', args);
|
|
30
|
+
return jsonBlock('Freight rates', data);
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
];
|
|
34
|
+
//# sourceMappingURL=rates.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rates.js","sourceRoot":"","sources":["../../src/tools/rates.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,SAA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