@liftitinc/geocoding 0.2.0 → 0.3.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 +4 -4
- package/dist/index.cjs +74 -36
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +75 -36
- package/dist/index.js.map +1 -1
- package/package.json +16 -16
package/README.md
CHANGED
|
@@ -24,7 +24,7 @@ import { GeocodingClient } from '@liftit/geocoding';
|
|
|
24
24
|
const client = new GeocodingClient({
|
|
25
25
|
apiKey: 'your-api-key',
|
|
26
26
|
// Optional configuration:
|
|
27
|
-
// baseUrl: 'https://
|
|
27
|
+
// baseUrl: 'https://api.codepin.co',
|
|
28
28
|
// timeout: 10000,
|
|
29
29
|
// maxRetries: 3,
|
|
30
30
|
});
|
|
@@ -66,7 +66,7 @@ console.log(address.address_components?.city);
|
|
|
66
66
|
| Parameter | Type | Default | Description |
|
|
67
67
|
|-----------|------|---------|-------------|
|
|
68
68
|
| `apiKey` | `string` | Required | Your Liftit Geocoding API key |
|
|
69
|
-
| `baseUrl` | `string` | `"https://
|
|
69
|
+
| `baseUrl` | `string` | `"https://api.codepin.co"` | API base URL |
|
|
70
70
|
| `timeout` | `number` | `10000` | Request timeout in milliseconds |
|
|
71
71
|
| `maxRetries` | `number` | `3` | Maximum retry attempts for transient errors |
|
|
72
72
|
| `baseDelay` | `number` | `1000` | Initial retry delay in milliseconds |
|
|
@@ -319,5 +319,5 @@ MIT - see [LICENSE](./LICENSE) for details.
|
|
|
319
319
|
## Support
|
|
320
320
|
|
|
321
321
|
- **GitHub Issues**: [Report bugs and request features](https://github.com/Liftitapp/geocoding-enterprise/issues)
|
|
322
|
-
- **API Reference**: [View API documentation](https://
|
|
323
|
-
- **Homepage**: [https://
|
|
322
|
+
- **API Reference**: [View API documentation](https://codepin.co/docs)
|
|
323
|
+
- **Homepage**: [https://codepin.co](https://codepin.co)
|
package/dist/index.cjs
CHANGED
|
@@ -309,7 +309,7 @@ var HttpClient = class {
|
|
|
309
309
|
};
|
|
310
310
|
|
|
311
311
|
// src/client.ts
|
|
312
|
-
var DEFAULT_BASE_URL = "https://
|
|
312
|
+
var DEFAULT_BASE_URL = "https://api.codepin.co";
|
|
313
313
|
var DEFAULT_TIMEOUT = 1e4;
|
|
314
314
|
var DEFAULT_MAX_RETRIES = 3;
|
|
315
315
|
var DEFAULT_BASE_DELAY = 1e3;
|
|
@@ -356,8 +356,7 @@ var GeocodingClient = class {
|
|
|
356
356
|
country: request.country,
|
|
357
357
|
city: request.city,
|
|
358
358
|
region: request.region,
|
|
359
|
-
address: request.address
|
|
360
|
-
custom_zone: request.custom_zone
|
|
359
|
+
address: request.address
|
|
361
360
|
},
|
|
362
361
|
{ signal: options?.signal }
|
|
363
362
|
);
|
|
@@ -4425,30 +4424,46 @@ var coerce = {
|
|
|
4425
4424
|
};
|
|
4426
4425
|
var NEVER = INVALID;
|
|
4427
4426
|
|
|
4427
|
+
// ../shared/dist/domain/coordinate.js
|
|
4428
|
+
var coordinateSchema = external_exports.object({
|
|
4429
|
+
lat: external_exports.number(),
|
|
4430
|
+
lng: external_exports.number()
|
|
4431
|
+
}).refine((val) => val.lat >= -90 && val.lat <= 90, {
|
|
4432
|
+
message: "Latitude must be between -90 and 90",
|
|
4433
|
+
path: ["lat"]
|
|
4434
|
+
}).refine((val) => val.lng >= -180 && val.lng <= 180, {
|
|
4435
|
+
message: "Longitude must be between -180 and 180",
|
|
4436
|
+
path: ["lng"]
|
|
4437
|
+
});
|
|
4438
|
+
|
|
4439
|
+
// ../shared/dist/domain/country-code.js
|
|
4440
|
+
var VALID_COUNTRY_CODES = [
|
|
4441
|
+
"co",
|
|
4442
|
+
"mx",
|
|
4443
|
+
"pe",
|
|
4444
|
+
"cl",
|
|
4445
|
+
"ec",
|
|
4446
|
+
"ar",
|
|
4447
|
+
"br"
|
|
4448
|
+
];
|
|
4449
|
+
var countryCodeSchema = external_exports.string().toLowerCase().refine((c) => VALID_COUNTRY_CODES.includes(c), {
|
|
4450
|
+
message: `Invalid country code. Supported: ${VALID_COUNTRY_CODES.join(", ")}`
|
|
4451
|
+
});
|
|
4452
|
+
|
|
4428
4453
|
// ../shared/dist/schemas/geocode.js
|
|
4429
4454
|
external_exports.object({
|
|
4430
|
-
country:
|
|
4455
|
+
country: countryCodeSchema,
|
|
4431
4456
|
city: external_exports.string().min(1, "City is required").max(100),
|
|
4432
4457
|
region: external_exports.string().max(100).optional().default(""),
|
|
4433
|
-
address: external_exports.string().min(3, "Address must be at least 3 characters").max(500, "Address is too long")
|
|
4434
|
-
custom_zone: external_exports.union([external_exports.boolean(), external_exports.string().transform((v) => v === "true")]).optional().default(false)
|
|
4435
|
-
});
|
|
4436
|
-
var locationSchema = external_exports.object({
|
|
4437
|
-
lat: external_exports.number(),
|
|
4438
|
-
lng: external_exports.number()
|
|
4439
|
-
});
|
|
4440
|
-
var zoneSchema = external_exports.object({
|
|
4441
|
-
id: external_exports.number(),
|
|
4442
|
-
name: external_exports.string(),
|
|
4443
|
-
type: external_exports.string()
|
|
4458
|
+
address: external_exports.string().min(3, "Address must be at least 3 characters").max(500, "Address is too long")
|
|
4444
4459
|
});
|
|
4460
|
+
var locationSchema = coordinateSchema;
|
|
4445
4461
|
external_exports.object({
|
|
4446
4462
|
cleaned_address: external_exports.boolean().optional(),
|
|
4447
4463
|
geocode: external_exports.object({
|
|
4448
4464
|
formatted_address: external_exports.string()
|
|
4449
4465
|
}),
|
|
4450
|
-
location: locationSchema
|
|
4451
|
-
zone: zoneSchema.optional()
|
|
4466
|
+
location: locationSchema
|
|
4452
4467
|
});
|
|
4453
4468
|
|
|
4454
4469
|
// ../shared/dist/schemas/reverse-geocode.js
|
|
@@ -4478,8 +4493,7 @@ external_exports.object({
|
|
|
4478
4493
|
formatted_address: external_exports.string()
|
|
4479
4494
|
}),
|
|
4480
4495
|
location: locationSchema,
|
|
4481
|
-
address_components: addressComponentsSchema.optional()
|
|
4482
|
-
zone: zoneSchema.optional()
|
|
4496
|
+
address_components: addressComponentsSchema.optional()
|
|
4483
4497
|
});
|
|
4484
4498
|
|
|
4485
4499
|
// ../shared/dist/schemas/auth.js
|
|
@@ -4503,13 +4517,9 @@ external_exports.object({
|
|
|
4503
4517
|
code: authErrorCodeSchema,
|
|
4504
4518
|
message: external_exports.string()
|
|
4505
4519
|
});
|
|
4506
|
-
external_exports.object({
|
|
4507
|
-
email: external_exports.string().email("Invalid email format"),
|
|
4508
|
-
password: external_exports.string().min(1, "Password is required")
|
|
4509
|
-
});
|
|
4510
4520
|
|
|
4511
4521
|
// ../shared/dist/schemas/billing.js
|
|
4512
|
-
var PlanTier = external_exports.enum(["free", "
|
|
4522
|
+
var PlanTier = external_exports.enum(["free", "standard", "premium", "enterprise"]);
|
|
4513
4523
|
var PlanConfig = external_exports.object({
|
|
4514
4524
|
tier: PlanTier,
|
|
4515
4525
|
name: external_exports.string(),
|
|
@@ -4651,6 +4661,21 @@ external_exports.object({
|
|
|
4651
4661
|
subscription: Subscription.optional(),
|
|
4652
4662
|
prorationPreview: ProrationPreview.optional()
|
|
4653
4663
|
});
|
|
4664
|
+
external_exports.object({
|
|
4665
|
+
completed: external_exports.boolean(),
|
|
4666
|
+
trialEndsAt: external_exports.string().nullable()
|
|
4667
|
+
});
|
|
4668
|
+
external_exports.object({
|
|
4669
|
+
setupIntentId: external_exports.string().min(1, "SetupIntent ID is required")
|
|
4670
|
+
});
|
|
4671
|
+
external_exports.object({
|
|
4672
|
+
trialEndsAt: external_exports.string(),
|
|
4673
|
+
alreadyCompleted: external_exports.boolean().optional()
|
|
4674
|
+
});
|
|
4675
|
+
external_exports.object({
|
|
4676
|
+
clientSecret: external_exports.string(),
|
|
4677
|
+
setupIntentId: external_exports.string()
|
|
4678
|
+
});
|
|
4654
4679
|
|
|
4655
4680
|
// ../shared/dist/schemas/api-keys.js
|
|
4656
4681
|
var ApiKeyEnvironment = external_exports.enum(["test", "live"]);
|
|
@@ -4731,30 +4756,45 @@ external_exports.object({
|
|
|
4731
4756
|
daily: external_exports.array(DailyUsageRecord)
|
|
4732
4757
|
});
|
|
4733
4758
|
|
|
4759
|
+
// ../shared/dist/schemas/signup.js
|
|
4760
|
+
external_exports.object({
|
|
4761
|
+
email: external_exports.string().email("Invalid email format").toLowerCase().trim(),
|
|
4762
|
+
password: external_exports.string().min(6, "Password must be at least 6 characters").max(72, "Password must not exceed 72 characters"),
|
|
4763
|
+
// bcrypt limit
|
|
4764
|
+
captchaToken: external_exports.string().optional()
|
|
4765
|
+
});
|
|
4766
|
+
external_exports.object({
|
|
4767
|
+
success: external_exports.literal(true),
|
|
4768
|
+
data: external_exports.object({
|
|
4769
|
+
user: external_exports.object({
|
|
4770
|
+
id: external_exports.string(),
|
|
4771
|
+
email: external_exports.string().email(),
|
|
4772
|
+
emailConfirmed: external_exports.boolean()
|
|
4773
|
+
}),
|
|
4774
|
+
message: external_exports.string()
|
|
4775
|
+
})
|
|
4776
|
+
});
|
|
4777
|
+
external_exports.object({
|
|
4778
|
+
email: external_exports.string().email("Invalid email format").toLowerCase().trim()
|
|
4779
|
+
});
|
|
4780
|
+
|
|
4734
4781
|
// ../shared/dist/schemas/geocode-wire.js
|
|
4735
4782
|
var geocodeRequestWireSchema = external_exports.object({
|
|
4736
4783
|
country: external_exports.string().min(2).max(3).describe("ISO 3166-1 alpha-2 or alpha-3 country code"),
|
|
4737
4784
|
city: external_exports.string().min(1).max(100).describe("City name"),
|
|
4738
4785
|
region: external_exports.string().max(100).optional().describe("State/department/region name"),
|
|
4739
|
-
address: external_exports.string().min(3).max(500).describe("Street address to geocode")
|
|
4740
|
-
custom_zone: external_exports.boolean().optional().default(false).describe("Include TMS zone information")
|
|
4786
|
+
address: external_exports.string().min(3).max(500).describe("Street address to geocode")
|
|
4741
4787
|
});
|
|
4742
4788
|
var locationWireSchema = external_exports.object({
|
|
4743
4789
|
lat: external_exports.number().describe("Latitude coordinate"),
|
|
4744
4790
|
lng: external_exports.number().describe("Longitude coordinate")
|
|
4745
4791
|
});
|
|
4746
|
-
var zoneWireSchema = external_exports.object({
|
|
4747
|
-
id: external_exports.number().describe("Zone ID in TMS"),
|
|
4748
|
-
name: external_exports.string().describe("Zone name"),
|
|
4749
|
-
type: external_exports.string().describe("Zone type (custom or city-based)")
|
|
4750
|
-
});
|
|
4751
4792
|
var geocodeResponseWireSchema = external_exports.object({
|
|
4752
4793
|
cleaned_address: external_exports.boolean().optional().describe("True if NLP service cleaned the address"),
|
|
4753
4794
|
geocode: external_exports.object({
|
|
4754
4795
|
formatted_address: external_exports.string().describe("Standardized address format")
|
|
4755
4796
|
}),
|
|
4756
|
-
location: locationWireSchema
|
|
4757
|
-
zone: zoneWireSchema.optional()
|
|
4797
|
+
location: locationWireSchema
|
|
4758
4798
|
});
|
|
4759
4799
|
|
|
4760
4800
|
// ../shared/dist/schemas/reverse-geocode-wire.js
|
|
@@ -4775,8 +4815,7 @@ var reverseGeocodeResponseWireSchema = external_exports.object({
|
|
|
4775
4815
|
formatted_address: external_exports.string().describe("Full formatted address")
|
|
4776
4816
|
}),
|
|
4777
4817
|
location: locationWireSchema,
|
|
4778
|
-
address_components: addressComponentsWireSchema.optional()
|
|
4779
|
-
zone: zoneWireSchema.optional()
|
|
4818
|
+
address_components: addressComponentsWireSchema.optional()
|
|
4780
4819
|
});
|
|
4781
4820
|
|
|
4782
4821
|
exports.AuthenticationError = AuthenticationError;
|
|
@@ -4795,6 +4834,5 @@ exports.locationWireSchema = locationWireSchema;
|
|
|
4795
4834
|
exports.reverseGeocodeRequestWireSchema = reverseGeocodeRequestWireSchema;
|
|
4796
4835
|
exports.reverseGeocodeResponseWireSchema = reverseGeocodeResponseWireSchema;
|
|
4797
4836
|
exports.sleep = sleep;
|
|
4798
|
-
exports.zoneWireSchema = zoneWireSchema;
|
|
4799
4837
|
//# sourceMappingURL=index.cjs.map
|
|
4800
4838
|
//# sourceMappingURL=index.cjs.map
|