/** * ShopInterface defines the object that given back from the ShopRepository, it should methods to get the shop data and set them */ export interface ShopInterface { getShopId(): string; getShopUrl(): string; setShopUrl(url: string): void; getShopSecret(): string; setShopSecret(secret: string): void; getPreviousShopSecret(): string | null; setPreviousShopSecret(secret: string | null): void; getPendingShopSecret(): string | null; setPendingShopSecret(secret: string | null): void; getPendingShopUrl(): string | null; setPendingShopUrl(url: string | null): void; getSecretsRotatedAt(): Date | null; setSecretsRotatedAt(rotatedAt: Date | null): void; getShopClientId(): string | null; getShopClientSecret(): string | null; getShopActive(): boolean; setShopCredentials(clientId: string, clientSecret: string): void; setShopActive(active: boolean): void; /** * Indicates whether at least one registration confirmation has been completed. */ isRegistrationConfirmed(): boolean; setRegistrationConfirmed(): void; /** * @deprecated tag:v6.0.0 - Will be removed. Double signature verification will always be enforced. */ setVerifiedWithDoubleSignature(): void; /** * @deprecated tag:v6.0.0 - Will be removed. Double signature verification will always be enforced. */ hasVerifiedWithDoubleSignature(): boolean; } /** * ShopRepositoryInterface is the storage interface for the shops, you should implement this to save the shop data to your database * For testing cases the InMemoryShopRepository can be used */ export interface ShopRepositoryInterface { createShop(id: string, url: string, secret: string): Promise; getShopById(id: string): Promise; updateShop(shop: Shop): Promise; deleteShop(id: string): Promise; } /** * SimpleShop is a simple implementation of the ShopInterface, it stores the shop data in memory */ export declare class SimpleShop implements ShopInterface { private shopId; private shopUrl; private shopSecret; private previousShopSecret; private pendingShopSecret; private pendingShopUrl; private secretsRotatedAt; private shopClientId; private shopClientSecret; private shopActive; private registrationConfirmed; /** * @deprecated tag:v6.0.0 - Will be removed. Double signature verification will always be enforced. */ private verifiedWithDoubleSignature; constructor(shopId: string, shopUrl: string, shopSecret: string, registrationConfirmed?: boolean); getShopActive(): boolean; setShopActive(active: boolean): void; getShopId(): string; getShopUrl(): string; setShopUrl(url: string): void; getShopSecret(): string; setShopSecret(secret: string): void; getPreviousShopSecret(): string | null; setPreviousShopSecret(secret: string | null): void; getPendingShopSecret(): string | null; setPendingShopSecret(secret: string | null): void; getPendingShopUrl(): string | null; setPendingShopUrl(url: string | null): void; getSecretsRotatedAt(): Date | null; setSecretsRotatedAt(rotatedAt: Date | null): void; getShopClientId(): string | null; getShopClientSecret(): string | null; setShopCredentials(clientId: string, clientSecret: string): void; isRegistrationConfirmed(): boolean; setRegistrationConfirmed(): void; /** * @deprecated tag:v6.0.0 - Will be removed. Double signature verification will always be enforced. */ setVerifiedWithDoubleSignature(): void; /** * @deprecated tag:v6.0.0 - Will be removed. Double signature verification will always be enforced. */ hasVerifiedWithDoubleSignature(): boolean; } /** * InMemoryShopRepository is a simple implementation of the ShopRepositoryInterface, it stores the shop data in memory */ export declare class InMemoryShopRepository implements ShopRepositoryInterface { private storage; constructor(); createShop(id: string, url: string, secret: string): Promise; getShopById(id: string): Promise; updateShop(shop: SimpleShop): Promise; deleteShop(id: string): Promise; } //# sourceMappingURL=repository.d.ts.map