@aoxborrow/registrar-client 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/LICENSE +21 -0
- package/README.md +415 -0
- package/dist/index.cjs +6798 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +768 -0
- package/dist/index.d.ts +768 -0
- package/dist/index.js +6747 -0
- package/dist/index.js.map +1 -0
- package/package.json +110 -0
- package/src/client.ts +200 -0
- package/src/constants.ts +11 -0
- package/src/errors.ts +192 -0
- package/src/features.ts +104 -0
- package/src/http.ts +230 -0
- package/src/index.ts +39 -0
- package/src/portfolio.ts +65 -0
- package/src/registrar.ts +240 -0
- package/src/registrars/cloudflare.ts +1205 -0
- package/src/registrars/dynadot.ts +1097 -0
- package/src/registrars/gandi.ts +970 -0
- package/src/registrars/godaddy.ts +1342 -0
- package/src/registrars/index.ts +41 -0
- package/src/registrars/namebright.ts +775 -0
- package/src/registrars/namecheap.ts +870 -0
- package/src/registrars/namesilo.ts +997 -0
- package/src/registrars/porkbun.ts +930 -0
- package/src/registrars/spaceship.ts +736 -0
- package/src/types.ts +446 -0
- package/src/utils.ts +135 -0
- package/src/xml.ts +39 -0
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
Registrar,
|
|
3
|
+
RegistrarConstructor,
|
|
4
|
+
RegistrarCredentials,
|
|
5
|
+
RegistrarOptions,
|
|
6
|
+
} from '../types';
|
|
7
|
+
import { CloudflareRegistrar } from './cloudflare';
|
|
8
|
+
import { DynadotRegistrar } from './dynadot';
|
|
9
|
+
import { GandiRegistrar } from './gandi';
|
|
10
|
+
import { GoDaddyRegistrar } from './godaddy';
|
|
11
|
+
import { NameBrightRegistrar } from './namebright';
|
|
12
|
+
import { NamecheapRegistrar } from './namecheap';
|
|
13
|
+
import { NameSiloRegistrar } from './namesilo';
|
|
14
|
+
import { PorkbunRegistrar } from './porkbun';
|
|
15
|
+
import { SpaceshipRegistrar } from './spaceship';
|
|
16
|
+
|
|
17
|
+
// the built-in registrar providers, keyed by id
|
|
18
|
+
export const registrars = {
|
|
19
|
+
cloudflare: CloudflareRegistrar,
|
|
20
|
+
dynadot: DynadotRegistrar,
|
|
21
|
+
gandi: GandiRegistrar,
|
|
22
|
+
godaddy: GoDaddyRegistrar,
|
|
23
|
+
namebright: NameBrightRegistrar,
|
|
24
|
+
namecheap: NamecheapRegistrar,
|
|
25
|
+
namesilo: NameSiloRegistrar,
|
|
26
|
+
porkbun: PorkbunRegistrar,
|
|
27
|
+
spaceship: SpaceshipRegistrar,
|
|
28
|
+
} satisfies Record<string, RegistrarConstructor>;
|
|
29
|
+
|
|
30
|
+
// id of a built-in registrar
|
|
31
|
+
export type RegistrarName = keyof typeof registrars;
|
|
32
|
+
|
|
33
|
+
// construct a registrar provider by id
|
|
34
|
+
export function createRegistrar(
|
|
35
|
+
name: RegistrarName,
|
|
36
|
+
credentials: RegistrarCredentials,
|
|
37
|
+
options?: RegistrarOptions
|
|
38
|
+
): Registrar {
|
|
39
|
+
const RegistrarClass = registrars[name];
|
|
40
|
+
return new RegistrarClass(credentials, options);
|
|
41
|
+
}
|