@hasna/domains 0.0.27 → 0.0.28

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 (55) hide show
  1. package/README.md +28 -0
  2. package/dist/cli/commands/brandsight.d.ts.map +1 -1
  3. package/dist/cli/commands/db.d.ts +7 -0
  4. package/dist/cli/commands/db.d.ts.map +1 -0
  5. package/dist/cli/commands/dns.d.ts.map +1 -1
  6. package/dist/cli/commands/domain.d.ts.map +1 -1
  7. package/dist/cli/commands/history.d.ts.map +1 -1
  8. package/dist/cli/commands/monitor.d.ts.map +1 -1
  9. package/dist/cli/commands/owner.d.ts.map +1 -1
  10. package/dist/cli/commands/research.d.ts.map +1 -1
  11. package/dist/cli/commands/route53.d.ts.map +1 -1
  12. package/dist/cli/commands/sedo.d.ts.map +1 -1
  13. package/dist/cli/commands/ssl.d.ts.map +1 -1
  14. package/dist/cli/commands/storage.d.ts.map +1 -1
  15. package/dist/cli/commands/wallet.d.ts.map +1 -1
  16. package/dist/cli/commands/zone.d.ts.map +1 -1
  17. package/dist/cli/index.js +33412 -18337
  18. package/dist/generated/storage-kit/health.d.ts +20 -0
  19. package/dist/generated/storage-kit/health.d.ts.map +1 -0
  20. package/dist/generated/storage-kit/index.d.ts +8 -0
  21. package/dist/generated/storage-kit/index.d.ts.map +1 -0
  22. package/dist/generated/storage-kit/migrations.d.ts +48 -0
  23. package/dist/generated/storage-kit/migrations.d.ts.map +1 -0
  24. package/dist/generated/storage-kit/mode.d.ts +48 -0
  25. package/dist/generated/storage-kit/mode.d.ts.map +1 -0
  26. package/dist/generated/storage-kit/pool.d.ts +34 -0
  27. package/dist/generated/storage-kit/pool.d.ts.map +1 -0
  28. package/dist/generated/storage-kit/query.d.ts +36 -0
  29. package/dist/generated/storage-kit/query.d.ts.map +1 -0
  30. package/dist/generated/storage-kit/tls.d.ts +26 -0
  31. package/dist/generated/storage-kit/tls.d.ts.map +1 -0
  32. package/dist/index.js +34299 -19874
  33. package/dist/lib/compact-output.d.ts +31 -0
  34. package/dist/lib/compact-output.d.ts.map +1 -0
  35. package/dist/mcp/index.d.ts.map +1 -1
  36. package/dist/mcp/index.js +23163 -3582
  37. package/dist/mcp/storage-tools.d.ts.map +1 -1
  38. package/dist/sdk/client.d.ts +198 -0
  39. package/dist/sdk/client.d.ts.map +1 -0
  40. package/dist/sdk/index.d.ts +14 -0
  41. package/dist/sdk/index.d.ts.map +1 -0
  42. package/dist/sdk/index.js +176 -0
  43. package/dist/server/app.d.ts +33 -0
  44. package/dist/server/app.d.ts.map +1 -0
  45. package/dist/server/index.d.ts +19 -0
  46. package/dist/server/index.d.ts.map +1 -0
  47. package/dist/server/index.js +1384 -0
  48. package/dist/server/migrations.d.ts +22 -0
  49. package/dist/server/migrations.d.ts.map +1 -0
  50. package/dist/server/openapi.d.ts +25 -0
  51. package/dist/server/openapi.d.ts.map +1 -0
  52. package/dist/server/repo.d.ts +44 -0
  53. package/dist/server/repo.d.ts.map +1 -0
  54. package/dist/storage.js +2 -4868
  55. package/package.json +13 -4
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Cloud Postgres migrations for domains-serve.
3
+ *
4
+ * Combines the app schema (`PG_MIGRATIONS`) with the vendored storage kit's
5
+ * checksum-guarded `MigrationLedger` and the @hasna/contracts api-keys table.
6
+ * Runs against the OWNER role DSN (DDL), not the request-path app role.
7
+ *
8
+ * PURE REMOTE (Amendment A1): migrations run against the cloud Postgres. There
9
+ * is no local schema and no ledger sync between machines.
10
+ */
11
+ import { type Migration, type MigrationResult } from "../generated/storage-kit/index.js";
12
+ /** Env var holding the owner-role DSN (DDL privileges). Falls back to the app DSN. */
13
+ export declare const OWNER_DSN_ENV = "HASNA_DOMAINS_DATABASE_URL_OWNER";
14
+ export declare const APP_DSN_ENV = "HASNA_DOMAINS_DATABASE_URL";
15
+ /** The ordered migration set: app schema first, then the shared api-keys table. */
16
+ export declare function buildMigrations(): Migration[];
17
+ /** Run all pending migrations against the owner DSN. */
18
+ export declare function runMigrations(opts?: {
19
+ dryRun?: boolean;
20
+ env?: NodeJS.ProcessEnv;
21
+ }): Promise<MigrationResult>;
22
+ //# sourceMappingURL=migrations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"migrations.d.ts","sourceRoot":"","sources":["../../src/server/migrations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,EAGL,KAAK,SAAS,EACd,KAAK,eAAe,EACrB,MAAM,mCAAmC,CAAC;AAK3C,sFAAsF;AACtF,eAAO,MAAM,aAAa,qCAAqC,CAAC;AAChE,eAAO,MAAM,WAAW,+BAA+B,CAAC;AAGxD,mFAAmF;AACnF,wBAAgB,eAAe,IAAI,SAAS,EAAE,CAU7C;AAYD,wDAAwD;AACxD,wBAAsB,aAAa,CACjC,IAAI,GAAE;IAAE,MAAM,CAAC,EAAE,OAAO,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAA;CAAO,GACvD,OAAO,CAAC,eAAe,CAAC,CAW1B"}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * OpenAPI 3.1 description of the domains-serve HTTP API.
3
+ *
4
+ * This is the single source of truth for the versioned `/v1` surface and the
5
+ * generated SDK (`src/sdk`, produced by `@hasna/contracts` generateSdkFromOpenApi).
6
+ */
7
+ export interface OpenApiDoc {
8
+ openapi: string;
9
+ info: {
10
+ title: string;
11
+ version: string;
12
+ description?: string;
13
+ };
14
+ servers?: {
15
+ url: string;
16
+ }[];
17
+ paths: Record<string, Record<string, unknown>>;
18
+ components: {
19
+ schemas: Record<string, unknown>;
20
+ securitySchemes?: Record<string, unknown>;
21
+ };
22
+ security?: Record<string, unknown[]>[];
23
+ }
24
+ export declare function buildOpenApiSpec(version: string): OpenApiDoc;
25
+ //# sourceMappingURL=openapi.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"openapi.d.ts","sourceRoot":"","sources":["../../src/server/openapi.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC/D,OAAO,CAAC,EAAE;QAAE,GAAG,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAC5B,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IAC/C,UAAU,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAAC,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE,CAAC;IAC5F,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;CACxC;AAYD,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,UAAU,CAqW5D"}
@@ -0,0 +1,44 @@
1
+ /**
2
+ * PG-backed repository for the domains-serve HTTP API.
3
+ *
4
+ * PURE REMOTE (Amendment A1): every call reads and writes the app's cloud
5
+ * Postgres directly through the vendored storage kit's typed query client.
6
+ * There is no cache, no local mirror, and no sync engine here — that degraded
7
+ * client behaviour lives in the CLIENT, out of scope for the service.
8
+ *
9
+ * The row shapes mirror the local SQLite model in `src/db`, but the storage is
10
+ * native Postgres: booleans are real BOOLEAN columns and the JSON columns
11
+ * (nameservers / whois / metadata) are TEXT holding JSON strings.
12
+ */
13
+ import type { TypedQueryClient } from "../generated/storage-kit/index.js";
14
+ import type { Domain, CreateDomainInput, UpdateDomainInput, DomainStats, DomainOffer, CreateDomainOfferInput } from "../db/domain-records.js";
15
+ import type { DnsRecord, CreateDnsRecordInput } from "../db/dns-records.js";
16
+ export declare class HttpError extends Error {
17
+ readonly status: number;
18
+ constructor(status: number, message: string);
19
+ }
20
+ /** Repository bound to a typed query client (the vendored kit's cloud pool). */
21
+ export declare class DomainsRepo {
22
+ private readonly db;
23
+ constructor(db: TypedQueryClient);
24
+ createDomain(input: CreateDomainInput): Promise<Domain>;
25
+ getDomain(id: string): Promise<Domain | null>;
26
+ getDomainByName(name: string): Promise<Domain | null>;
27
+ listDomains(opts: {
28
+ search?: string;
29
+ status?: string;
30
+ limit?: number;
31
+ offset?: number;
32
+ }): Promise<Domain[]>;
33
+ updateDomain(id: string, patch: UpdateDomainInput): Promise<Domain | null>;
34
+ deleteDomain(id: string): Promise<boolean>;
35
+ countDomains(): Promise<number>;
36
+ getStats(): Promise<DomainStats>;
37
+ listDnsRecords(domainId: string): Promise<DnsRecord[]>;
38
+ createDnsRecord(domainId: string, input: CreateDnsRecordInput): Promise<DnsRecord>;
39
+ getDnsRecord(id: string): Promise<DnsRecord | null>;
40
+ deleteDnsRecord(id: string): Promise<boolean>;
41
+ listOffers(domainId: string): Promise<DomainOffer[]>;
42
+ createOffer(domainId: string, input: CreateDomainOfferInput): Promise<DomainOffer>;
43
+ }
44
+ //# sourceMappingURL=repo.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"repo.d.ts","sourceRoot":"","sources":["../../src/server/repo.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAE1E,OAAO,KAAK,EACV,MAAM,EAEN,iBAAiB,EACjB,iBAAiB,EACjB,WAAW,EACX,WAAW,EACX,sBAAsB,EACvB,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,SAAS,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAuF5E,qBAAa,SAAU,SAAQ,KAAK;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM;gBAAd,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;CAIrD;AAID,gFAAgF;AAChF,qBAAa,WAAW;IACV,O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