@hasna/capacity 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 +74 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +6663 -0
- package/dist/domain/authority-evidence.d.ts +198 -0
- package/dist/domain/catalog.d.ts +65 -0
- package/dist/domain/counter.d.ts +7 -0
- package/dist/domain/eligibility.d.ts +4 -0
- package/dist/domain/ids.d.ts +47 -0
- package/dist/domain/invariants.d.ts +4 -0
- package/dist/domain/models.d.ts +300 -0
- package/dist/domain/native-subscription.d.ts +211 -0
- package/dist/domain/online-generation-receipt.d.ts +497 -0
- package/dist/domain/state.d.ts +19 -0
- package/dist/errors.d.ts +26 -0
- package/dist/http/handler.d.ts +3 -0
- package/dist/http/openapi.d.ts +1070 -0
- package/dist/http/stores.d.ts +20 -0
- package/dist/http/types.d.ts +141 -0
- package/dist/index.d.ts +56 -0
- package/dist/index.js +14909 -0
- package/dist/sdk/index.d.ts +8 -0
- package/dist/sdk/local.d.ts +5 -0
- package/dist/sdk/remote.d.ts +2 -0
- package/dist/sdk/types.d.ts +107 -0
- package/dist/serialization/dto.d.ts +13 -0
- package/dist/serialization/json.d.ts +7 -0
- package/dist/storage/credential-use-authorizer.d.ts +9 -0
- package/dist/storage/credential-verifier.d.ts +13 -0
- package/dist/storage/effect-dispatch.d.ts +278 -0
- package/dist/storage/file-recovery-ledger.d.ts +66 -0
- package/dist/storage/memory.d.ts +47 -0
- package/dist/storage/native-revocation.d.ts +10 -0
- package/dist/storage/postgres-config.d.ts +25 -0
- package/dist/storage/postgres-migrations.d.ts +10 -0
- package/dist/storage/postgres-migrator.d.ts +12 -0
- package/dist/storage/postgres.d.ts +90 -0
- package/dist/storage/recovery.d.ts +11 -0
- package/dist/storage/repository.d.ts +310 -0
- package/dist/storage/shared.d.ts +18 -0
- package/dist/storage/sqlite-migrations.d.ts +11 -0
- package/dist/storage/sqlite.d.ts +51 -0
- package/dist/version.d.ts +2 -0
- package/package.json +49 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { BootstrapIntent, BootstrapIntentCreateContext, BootstrapIntentStore, HttpIdempotencyRequest, HttpIdempotencyStore, StoredHttpResponse } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* Process-local implementation for local/test use. Self-hosted multi-replica
|
|
4
|
+
* deployments must inject a durable store with the same conditional-insert
|
|
5
|
+
* behavior.
|
|
6
|
+
*/
|
|
7
|
+
export declare class MemoryHttpIdempotencyStore implements HttpIdempotencyStore {
|
|
8
|
+
private readonly entries;
|
|
9
|
+
execute(request: HttpIdempotencyRequest, operation: () => Promise<StoredHttpResponse>): Promise<StoredHttpResponse>;
|
|
10
|
+
}
|
|
11
|
+
/** Inert metadata only. There is intentionally no API-consumption method. */
|
|
12
|
+
export declare class MemoryBootstrapIntentStore implements BootstrapIntentStore {
|
|
13
|
+
private readonly lifetimeMs;
|
|
14
|
+
private readonly intents;
|
|
15
|
+
private readonly replay;
|
|
16
|
+
constructor(lifetimeMs?: number);
|
|
17
|
+
create(context: BootstrapIntentCreateContext): Promise<BootstrapIntent>;
|
|
18
|
+
get(authCapsuleId: BootstrapIntent["authCapsuleId"], intentId: string): Promise<BootstrapIntent | undefined>;
|
|
19
|
+
private projectStatus;
|
|
20
|
+
}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import type { Counter } from "../domain/counter";
|
|
2
|
+
import type { AuthCapsuleId, CredentialOperationId, EntityId } from "../domain/ids";
|
|
3
|
+
import type { AuthCapsule, CredentialBinding, CredentialOperation, EligibilityRequest, EntityKind, EntityMap, SlotEligibilityMetadata } from "../domain/models";
|
|
4
|
+
import type { MutationContext, MutationResult, RepositoryDoctor } from "../storage/repository";
|
|
5
|
+
export declare const ACCOUNTS_HTTP_SCOPES: readonly ["accounts:read", "accounts:write", "accounts:provider-ownership:verify", "accounts:capacity-pools:attest", "accounts:terms:attest", "accounts:execution-policy:attest", "accounts:health:report", "accounts:placement:attest", "accounts:deployment:attest", "accounts:capsules:bootstrap-intent", "accounts:credentials:request", "accounts:credentials:issue", "accounts:credentials:handles:read", "accounts:eligibility:issue", "accounts:generation:check", "accounts:admin"];
|
|
6
|
+
export type AccountsHttpScope = (typeof ACCOUNTS_HTTP_SCOPES)[number];
|
|
7
|
+
/**
|
|
8
|
+
* The authenticator creates this value from verified transport credentials.
|
|
9
|
+
* No request JSON member or unverified header is ever projected into it.
|
|
10
|
+
*/
|
|
11
|
+
export interface AccountsAuthenticatedPrincipal {
|
|
12
|
+
readonly actorRef: string;
|
|
13
|
+
readonly subjectRef: string;
|
|
14
|
+
readonly issuer: string;
|
|
15
|
+
readonly audience: string;
|
|
16
|
+
readonly scopes: ReadonlySet<AccountsHttpScope>;
|
|
17
|
+
/** Exact owners the verified actor may act for. There is deliberately no wildcard. */
|
|
18
|
+
readonly authorizedOwnerRefs: ReadonlySet<string>;
|
|
19
|
+
}
|
|
20
|
+
export interface AccountsRequestAuthenticator {
|
|
21
|
+
authenticate(request: Request, expectedAudience: string): Promise<AccountsAuthenticatedPrincipal | undefined>;
|
|
22
|
+
}
|
|
23
|
+
export interface CatalogHttpService {
|
|
24
|
+
get<K extends EntityKind>(kind: K, id: EntityMap[K]["id"]): Promise<EntityMap[K]>;
|
|
25
|
+
list<K extends EntityKind>(kind: K): Promise<readonly EntityMap[K][]>;
|
|
26
|
+
eligibility(request: EligibilityRequest): Promise<SlotEligibilityMetadata>;
|
|
27
|
+
doctor(): Promise<RepositoryDoctor>;
|
|
28
|
+
add?<K extends EntityKind>(kind: K, record: EntityMap[K], context: MutationContext): Promise<MutationResult<EntityMap[K]>>;
|
|
29
|
+
}
|
|
30
|
+
export interface BootstrapIntent {
|
|
31
|
+
readonly schemaVersion: "accounts.bootstrap-intent.v1";
|
|
32
|
+
readonly id: string;
|
|
33
|
+
readonly authCapsuleId: AuthCapsuleId;
|
|
34
|
+
readonly ownerRef: string;
|
|
35
|
+
readonly canonicalNodeId: string;
|
|
36
|
+
readonly nodeGeneration: Counter;
|
|
37
|
+
readonly placementGeneration: Counter;
|
|
38
|
+
readonly authGeneration: Counter;
|
|
39
|
+
readonly capsuleRevision: Counter;
|
|
40
|
+
readonly status: "pending" | "expired";
|
|
41
|
+
readonly createdAt: string;
|
|
42
|
+
readonly expiresAt: string;
|
|
43
|
+
}
|
|
44
|
+
export interface BootstrapIntentCreateContext {
|
|
45
|
+
readonly principal: AccountsAuthenticatedPrincipal;
|
|
46
|
+
readonly capsule: AuthCapsule;
|
|
47
|
+
readonly idempotencyKey: string;
|
|
48
|
+
readonly reasonCode: string;
|
|
49
|
+
readonly requestDigest: string;
|
|
50
|
+
readonly now: string;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* A store can only create or read inert intent metadata. It intentionally has
|
|
54
|
+
* no consume, provider-login, device-code, browser, or reauthentication method.
|
|
55
|
+
*/
|
|
56
|
+
export interface BootstrapIntentStore {
|
|
57
|
+
create(context: BootstrapIntentCreateContext): Promise<BootstrapIntent>;
|
|
58
|
+
get(authCapsuleId: AuthCapsuleId, intentId: string): Promise<BootstrapIntent | undefined>;
|
|
59
|
+
}
|
|
60
|
+
export interface CredentialOperationRequest {
|
|
61
|
+
readonly kind: "rotation" | "revocation";
|
|
62
|
+
readonly binding: Extract<CredentialBinding, {
|
|
63
|
+
readonly status: "pending" | "active" | "retiring";
|
|
64
|
+
}>;
|
|
65
|
+
readonly expectedRevision: Counter;
|
|
66
|
+
readonly principal: AccountsAuthenticatedPrincipal;
|
|
67
|
+
readonly idempotencyKey: string;
|
|
68
|
+
readonly reasonCode: string;
|
|
69
|
+
readonly requestDigest: string;
|
|
70
|
+
}
|
|
71
|
+
/** Public operations are intent/status only; execution is deliberately absent. */
|
|
72
|
+
export interface CredentialOperationIntentService {
|
|
73
|
+
request(request: CredentialOperationRequest): Promise<CredentialOperation>;
|
|
74
|
+
get(id: CredentialOperationId): Promise<CredentialOperation | undefined>;
|
|
75
|
+
list(ownerRef: string): Promise<readonly CredentialOperation[]>;
|
|
76
|
+
}
|
|
77
|
+
export interface StoredHttpResponse {
|
|
78
|
+
readonly status: number;
|
|
79
|
+
readonly body: string;
|
|
80
|
+
readonly headers?: Readonly<Record<string, string>>;
|
|
81
|
+
}
|
|
82
|
+
export interface HttpIdempotencyRequest {
|
|
83
|
+
readonly actorRef: string;
|
|
84
|
+
readonly audience: string;
|
|
85
|
+
readonly method: string;
|
|
86
|
+
readonly route: string;
|
|
87
|
+
readonly key: string;
|
|
88
|
+
readonly requestDigest: string;
|
|
89
|
+
}
|
|
90
|
+
/** Production deployments must back this with the same durable authority as the API. */
|
|
91
|
+
export interface HttpIdempotencyStore {
|
|
92
|
+
execute(request: HttpIdempotencyRequest, operation: () => Promise<StoredHttpResponse>): Promise<StoredHttpResponse>;
|
|
93
|
+
}
|
|
94
|
+
export interface InternalHttpService {
|
|
95
|
+
/** Credential- and network-free PROBE_NATIVE. It cannot mint or consume a grant. */
|
|
96
|
+
probeNativeSubscription?(body: unknown, principal: AccountsAuthenticatedPrincipal): Promise<Readonly<Record<string, unknown>>>;
|
|
97
|
+
/** Accounts-only closed maintenance reservation/grant issuance. */
|
|
98
|
+
issueCapsuleMaintenanceGrant?(body: unknown, principal: AccountsAuthenticatedPrincipal): Promise<Readonly<Record<string, unknown>>>;
|
|
99
|
+
/** Accounts-only atomic one-use maintenance grant consumption. */
|
|
100
|
+
consumeCapsuleMaintenanceGrant?(body: unknown, principal: AccountsAuthenticatedPrincipal): Promise<Readonly<Record<string, unknown>>>;
|
|
101
|
+
/** Accounts-owned atomic one-use capability ordinal consumption. */
|
|
102
|
+
consumeCapabilityUse?(body: unknown, principal: AccountsAuthenticatedPrincipal): Promise<Readonly<Record<string, unknown>>>;
|
|
103
|
+
/** Returns a verified, signed snake_case wire object or fails closed. */
|
|
104
|
+
issueSlotEligibility?(body: unknown, principal: AccountsAuthenticatedPrincipal): Promise<Readonly<Record<string, unknown>>>;
|
|
105
|
+
/** Returns a verified, signed closed online-generation receipt or fails closed. */
|
|
106
|
+
checkGeneration?(body: unknown, principal: AccountsAuthenticatedPrincipal): Promise<Readonly<Record<string, unknown>>>;
|
|
107
|
+
ingestCapacityPoolEvidence?(body: unknown, principal: AccountsAuthenticatedPrincipal): Promise<Readonly<Record<string, unknown>>>;
|
|
108
|
+
ingestExecutionPolicyEvidence?(body: unknown, principal: AccountsAuthenticatedPrincipal): Promise<Readonly<Record<string, unknown>>>;
|
|
109
|
+
ingestCredentialBindingReceipt?(body: unknown, principal: AccountsAuthenticatedPrincipal): Promise<Readonly<Record<string, unknown>>>;
|
|
110
|
+
}
|
|
111
|
+
export interface AccountsHttpDeploymentConfig {
|
|
112
|
+
readonly mode: "self_hosted";
|
|
113
|
+
readonly identityRealm: string;
|
|
114
|
+
readonly organizationRef: string;
|
|
115
|
+
readonly publicAudience: string;
|
|
116
|
+
readonly internalAudience: string;
|
|
117
|
+
readonly allowedIssuers: ReadonlySet<string>;
|
|
118
|
+
}
|
|
119
|
+
export interface AccountsHttpHandlerOptions {
|
|
120
|
+
readonly deployment: AccountsHttpDeploymentConfig;
|
|
121
|
+
readonly authenticator: AccountsRequestAuthenticator;
|
|
122
|
+
readonly catalog: CatalogHttpService;
|
|
123
|
+
readonly bootstrapIntents?: BootstrapIntentStore;
|
|
124
|
+
readonly credentialOperations?: CredentialOperationIntentService;
|
|
125
|
+
readonly internal?: InternalHttpService;
|
|
126
|
+
readonly idempotency?: HttpIdempotencyStore;
|
|
127
|
+
readonly packageVersion: string;
|
|
128
|
+
readonly contractSha256: string;
|
|
129
|
+
readonly openApiDocument: Readonly<Record<string, unknown>>;
|
|
130
|
+
readonly now?: () => Date;
|
|
131
|
+
}
|
|
132
|
+
export declare const HTTP_ENTITY_ROUTES: Readonly<{
|
|
133
|
+
readonly "provider-accounts": "account";
|
|
134
|
+
readonly entitlements: "entitlement";
|
|
135
|
+
readonly "capacity-pools": "capacity_pool";
|
|
136
|
+
readonly "account-lanes": "access_method";
|
|
137
|
+
readonly "auth-capsules": "auth_capsule";
|
|
138
|
+
readonly "credential-bindings": "credential_binding";
|
|
139
|
+
}>;
|
|
140
|
+
export type HttpEntityRoute = keyof typeof HTTP_ENTITY_ROUTES;
|
|
141
|
+
export type AnyEntityIdentifier = EntityId;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { AccountsCatalog as AccountsCatalogType } from "./domain/catalog";
|
|
2
|
+
import { type ConnectPostgresAccountsOptions } from "./storage/postgres";
|
|
3
|
+
export { ACCOUNT_ERROR_CODES, AccountsError, asAccountsError, exitCodeForError, toErrorEnvelope, } from "./errors";
|
|
4
|
+
export type { AccountErrorCode, ErrorEnvelope, SafeErrorDetail, SafeErrorDetails, } from "./errors";
|
|
5
|
+
export { MAX_COUNTER, compareCounters, counter, incrementCounter, parseCounter, } from "./domain/counter";
|
|
6
|
+
export type { Counter } from "./domain/counter";
|
|
7
|
+
export { isUuidV7, newAccessMethodId, newAccountEventId, newAccountId, newAccountLaneId, newAuthCapsuleId, newCapacityPoolId, newCredentialBindingId, newCredentialOperationId, newEligibilityEvidenceId, newEntitlementId, newProviderAccountId, parseAccessMethodId, parseAccountId, parseAccountLaneId, parseAuthCapsuleId, parseCanonicalNodeId, parseCapacityPoolId, parseCredentialBindingId, parseCredentialOperationId, parseEligibilityEvidenceId, parseEntitlementId, parseProviderAccountId, } from "./domain/ids";
|
|
8
|
+
export type { AccessMethodId, AccountEventId, AccountId, AccountLaneId, AuthCapsuleId, CanonicalNodeId, CapacityPoolId, CredentialBindingId, CredentialOperationId, EligibilityEvidenceId, EntitlementId, ProviderAccountId, } from "./domain/ids";
|
|
9
|
+
export { ACCOUNTS_CAPACITY_SCHEMA_VERSION, ELIGIBILITY_REASON_CODES, } from "./domain/models";
|
|
10
|
+
export type { Account, AccountLane, AccountStatus, AccessMethod, AccessMethodStatus, AccessTransport, AnyEntity, AuthCapsule, AuthCapsuleStatus, CapabilitySet, CapacityPool, CapacityPoolStatus, CredentialBinding, CredentialBindingMetadata, CredentialBindingStatus, CredentialOperation, CredentialOperationKind, CredentialOperationState, NonterminalCredentialBinding, RetiredHandleCredentialBinding, RevocationBarrierCredentialBinding, CredentialPurpose, CredentialResolver, DataPolicy, DenyState, EligibleSlotEligibility, EligibilityAccessTarget, EligibilityReasonCode, EligibilityRequest, EntityKind, EntityMap, Entitlement, EntitlementStatus, FundingKind, HealthObservation, IneligibleSlotEligibility, ProviderAccount, SlotEligibility, SlotEligibilityMetadata, TermsDecision, } from "./domain/models";
|
|
11
|
+
export { assertTransition, validateNativeReauthenticationCandidate, validateRoutineNativeRefreshCandidate, } from "./domain/state";
|
|
12
|
+
export { decodeRecordEnvelope, deserializeRecordEnvelope, encodeRecordEnvelope, serializeRecordEnvelope, validateEntity, validateEligibilityRequest, validateSlotEligibility, } from "./serialization/dto";
|
|
13
|
+
export type { RecordEnvelope } from "./serialization/dto";
|
|
14
|
+
export { canonicalJson, parseClosedJson, parseClosedJsonBytes } from "./serialization/json";
|
|
15
|
+
export { AUTHORITY_EVIDENCE_SCHEMA_VERSION, AUTHORITY_EVIDENCE_TYPES, AUTHORITY_ISSUER_CLASSES, verifyAuthorityEvidence, } from "./domain/authority-evidence";
|
|
16
|
+
export type { AuthorityEvidenceBinding, AuthorityEvidenceEnvelope, AuthorityEvidenceExpectation, AuthorityEvidencePayload, AuthorityEvidenceTrustRoot, AuthorityEvidenceType, AuthorityIssuerClass, ProviderCapacityPayload, ProviderOwnershipPayload, } from "./domain/authority-evidence";
|
|
17
|
+
export { ONLINE_GENERATION_CHECK_RECEIPT_SCHEMA_VERSION, ONLINE_GENERATION_RECEIPT_MAXIMUM_AGE_MS, ONLINE_GENERATION_RECEIPT_MAXIMUM_CLOCK_SKEW_MS, ONLINE_GENERATION_RECEIPT_MAXIMUM_LIFETIME_MS, ONLINE_GENERATION_RECEIPT_MAX_USES, consumeOnlineGenerationCheckReceiptUse, projectOnlineGenerationCheckReceipt, verifyAllowedOnlineGenerationCheckReceipt, verifyOnlineGenerationCheckReceipt, } from "./domain/online-generation-receipt";
|
|
18
|
+
export type { ConsumedOnlineGenerationReceiptUse, OnlineGenerationCheckReceiptDraft, OnlineGenerationCheckReceiptExpectation, OnlineGenerationCheckReceiptTrustRoot, OnlineGenerationReceiptUseCasRequest, OnlineGenerationReceiptUseCasResult, OnlineGenerationReceiptUseGuard, OnlineGenerationReceiptUseStore, ProjectedOnlineGenerationCheckReceipt, ProviderDestinationPolicy, VerifiedAllowedOnlineGenerationCheckReceipt, VerifiedOnlineGenerationCheckReceipt, } from "./domain/online-generation-receipt";
|
|
19
|
+
export { CAPSULE_MAINTENANCE_CONSUME_RECEIPT_SCHEMA_VERSION, CAPSULE_MAINTENANCE_CONSUME_REQUEST_SCHEMA_VERSION, CAPSULE_MAINTENANCE_GRANT_SCHEMA_VERSION, CAPSULE_MAINTENANCE_REQUEST_SCHEMA_VERSION, NATIVE_SUBSCRIPTION_PROBE_REQUEST_SCHEMA_VERSION, NATIVE_SUBSCRIPTION_PROBE_RESULT_SCHEMA_VERSION, CapsuleMaintenanceAuthority, InMemoryNativeCapabilityUseStore, StaticNativeSubscriptionSnapshotSource, evaluateNativeSubscriptionProbe, parseNativeSubscriptionProbeRequest, verifyCapsuleMaintenanceGrant, } from "./domain/native-subscription";
|
|
20
|
+
export type { CapsuleMaintenanceAuthorityOptions, CapsuleMaintenanceCommand, CapsuleMaintenanceConsumeReceipt, CapsuleMaintenanceConsumeRequest, CapsuleMaintenanceGrant, CapsuleMaintenanceRequest, CapsuleMaintenanceTargetKind, CapsuleMaintenanceTransport, CapsuleMaintenanceTrust, InMemoryNativeCapabilityUseStoreOptions, NativeCapabilityUseCurrentState, NativeSubscriptionBindingSnapshot, NativeSubscriptionProbeRequest, NativeSubscriptionProbeResult, NativeSubscriptionSnapshotSource, } from "./domain/native-subscription";
|
|
21
|
+
export { EffectDispatchJournal, effectOutcomeSigningBytes } from "./storage/effect-dispatch";
|
|
22
|
+
export type { EffectDispatchAppend, EffectDispatchInput, EffectDispatchJournalOptions, EffectDispatchRecord, EffectDispatchState, EffectOutcomeKind, EffectOutcomeRecord, EffectOutcomeSigningInput, EffectPrepareInput, UnsignedEffectOutcomeRecord, } from "./storage/effect-dispatch";
|
|
23
|
+
export { FileRecoveryLedger, OwnerOnlySignedAppendLog } from "./storage/file-recovery-ledger";
|
|
24
|
+
export type { FileRecoveryLedgerOptions, OwnerOnlySignedAppendLogOptions, SignedLogFrontier, SignedLogRecord, SignedLogSnapshot, } from "./storage/file-recovery-ledger";
|
|
25
|
+
export declare const POSTGRES_ADAPTER_STATUS: Readonly<{
|
|
26
|
+
adapter: "postgres";
|
|
27
|
+
implemented: true;
|
|
28
|
+
conformanceClaim: true;
|
|
29
|
+
target: "self_hosted";
|
|
30
|
+
}>;
|
|
31
|
+
export { runPostgresMigrations } from "./storage/postgres-migrator";
|
|
32
|
+
export type { PostgresMigrationReport } from "./storage/postgres-migrator";
|
|
33
|
+
export { ACCOUNTS_V1_CONTRACT_SHA256, PACKAGE_VERSION } from "./version";
|
|
34
|
+
export { createAccountsCapacity } from "./sdk/index";
|
|
35
|
+
export type { AccountLanesApi, AccountsAuthProvider, AccountsCapacity, AccountsDeployment, AuthCapsulesApi, BootstrapIntentInput, CallOptions, CapacityQueryApi, CreateAccountLaneInput, CreateEntitlementInput, CreateProviderAccountInput, EntitlementsApi, ListOptions, LocalRecoveryConfiguration, MutationOptions, Page, ProviderAccountsApi, ProviderAccountView, ReadonlyCapacityPoolsApi, ReadonlyCredentialBindingsApi, RevisionMutationOptions, } from "./sdk/index";
|
|
36
|
+
export { createAccountsHttpHandler } from "./http/handler";
|
|
37
|
+
export { ACCOUNTS_CAPACITY_OPENAPI, serializeAccountsCapacityOpenApi } from "./http/openapi";
|
|
38
|
+
export { MemoryBootstrapIntentStore, MemoryHttpIdempotencyStore, } from "./http/stores";
|
|
39
|
+
export type { AccountsAuthenticatedPrincipal, AccountsHttpDeploymentConfig, AccountsHttpHandlerOptions, AccountsHttpScope, AccountsRequestAuthenticator, BootstrapIntent, BootstrapIntentStore, CatalogHttpService, CredentialOperationIntentService, HttpIdempotencyStore, InternalHttpService, } from "./http/types";
|
|
40
|
+
export interface CatalogFactoryOptions {
|
|
41
|
+
readonly clock?: () => Date;
|
|
42
|
+
}
|
|
43
|
+
export interface SQLiteCatalogFactoryOptions extends CatalogFactoryOptions {
|
|
44
|
+
readonly path: string;
|
|
45
|
+
readonly recovery?: {
|
|
46
|
+
readonly ledgerPath: string;
|
|
47
|
+
readonly catalogIncarnation: string;
|
|
48
|
+
readonly signingKey: Uint8Array;
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
export interface PostgresCatalogFactoryOptions extends CatalogFactoryOptions, ConnectPostgresAccountsOptions {
|
|
52
|
+
}
|
|
53
|
+
export type AccountsCapacityReader = Pick<AccountsCatalogType, "get" | "list" | "eligibility" | "checkCurrent" | "doctor" | "close">;
|
|
54
|
+
export declare function createInMemoryAccounts(options?: CatalogFactoryOptions): AccountsCapacityReader;
|
|
55
|
+
export declare function createSQLiteAccounts(options: SQLiteCatalogFactoryOptions): AccountsCapacityReader;
|
|
56
|
+
export declare function createPostgresAccounts(options: PostgresCatalogFactoryOptions): Promise<AccountsCapacityReader>;
|