import { z } from "zod"; import * as ctp from "@commercetools/platform-sdk"; import { Address, ApprovalFlow, ApprovalRule, ApprovalRuleDraft, AssociateRole, AssociateRoleDraft, AttributeGroup, AttributeGroupDraft, BaseResource, BusinessUnit, BusinessUnitDraft, BusinessUnitKeyReference, Cart, CartDiscount, CartDiscountDraft, CartDraft, CartReference, Category, CategoryDraft, Channel, ChannelDraft, ChannelReference, ChannelResourceIdentifier, CustomFields, CustomObject, CustomObjectDraft, Customer, CustomerCreatePasswordResetToken, CustomerDraft, CustomerGroup, CustomerGroupDraft, CustomerResetPassword, CustomerToken, DiscountCode, DiscountCodeDraft, DiscountGroup, DiscountGroupDraft, Extension, ExtensionDraft, ExternalTaxRateDraft, FacetResults, FieldContainer, FilteredFacetResult, InventoryEntry, InventoryEntryDraft, LineItem, LineItemDraft, MyCustomerChangePassword, MyCustomerEmailVerify, MyCustomerResetPassword, MyOrderFromCartDraft, MyQuoteRequestDraft, Order, OrderEdit, OrderEditDraft, OrderFromCartDraft, OrderFromQuoteDraft, OrderImportDraft, OrderPagedSearchResponse, OrderReference, OrderSearchRequest, PagedQueryResponse, Payment, PaymentDraft, Product, ProductDiscount, ProductDiscountDraft, ProductDraft, ProductPagedSearchResponse, ProductProjection, ProductProjectionPagedSearchResponse, ProductSearchRequest, ProductSelection, ProductSelectionDraft, ProductTailoring, ProductType, ProductTypeDraft, Project, QueryParam, Quote, QuoteDraft, QuoteRequest, QuoteRequestDraft, RangeFacetResult, RecurrencePolicy, RecurrencePolicyDraft, RecurringOrder, RecurringOrderDraft, ResourceIdentifier, Review, ReviewDraft, ReviewRatingStatistics, ShippingInfo, ShippingMethod, ShippingMethodDraft, ShippingMethodReference, ShoppingList, ShoppingListDraft, ShoppingListLineItem, StagedQuote, StagedQuoteDraft, StandalonePrice, StandalonePriceDraft, State, StateDraft, Store, StoreDraft, StoreKeyReference, Subscription, SubscriptionDraft, SuggestionResult, TaxCategory, TaxCategoryDraft, TermFacetResult, Type, TypeDraft, TypeResourceIdentifier, UpdateAction, Zone, ZoneDraft, ZoneReference } from "@commercetools/platform-sdk"; //#region src/repositories/abstract.d.ts type QueryParams$1 = { expand?: string[]; where?: string[]; offset?: number; limit?: number; [key: string]: QueryParam; }; type GetParams$1 = { expand?: string[]; }; type RepositoryContext = { projectKey: string; storeKey?: string; clientId?: string; associateId?: string; businessUnitKey?: string; }; declare abstract class AbstractRepository { protected _storage: AbstractStorage; protected config: Config; protected actions: AbstractUpdateHandler | undefined; constructor(config: Config); saveNew({ projectKey }: RepositoryContext, resource: R): Promise; saveUpdate({ projectKey }: RepositoryContext, version: number, resource: R): Promise; postProcessResource(context: RepositoryContext, resource: any): Promise; processUpdateActions(context: RepositoryContext, resource: R, version: number, actions: UpdateAction[]): Promise; } declare abstract class AbstractResourceRepository extends AbstractRepository { protected _typeId: T; /** * Optional Zod schema for validating creation drafts. * When set and strict mode is enabled, the service layer will * validate incoming request bodies against this schema before * passing them to create(). */ draftSchema?: z.ZodType; constructor(typeId: T, config: Config); /** * Whether strict validation is enabled. */ get strict(): boolean; abstract create(context: RepositoryContext, draft: any): Promise; protected getTypeId(): T; /** * Apply expand clauses to a resource without re-fetching from storage. */ expand(context: RepositoryContext, resource: ResourceMap[T], expand: string[] | undefined): Promise; delete(context: RepositoryContext, id: string, params?: GetParams$1): Promise; get(context: RepositoryContext, id: string, params?: GetParams$1): Promise; getByKey(context: RepositoryContext, key: string, params?: GetParams$1): Promise; postProcessResource(context: RepositoryContext, resource: ResourceMap[T], params?: GetParams$1): Promise; query(context: RepositoryContext, params?: QueryParams$1): Promise[]; }>; saveNew(context: RepositoryContext, resource: ShallowWritable): Promise; saveUpdate(context: RepositoryContext, version: number, resource: ShallowWritable): Promise; } declare class AbstractUpdateHandler { _storage: AbstractStorage; constructor(_storage: AbstractStorage); /** * Shared implementation for setCustomField update actions. * * Throws InvalidOperation if the resource has no custom type set. * When `value` is `null`, the field is removed; otherwise it is set. */ protected _setCustomFieldValues(resource: { custom?: CustomFields; }, { name, value }: { name: string; value?: unknown; }): void; /** * Shared implementation for setCustomType update actions. * * When `type` is provided, resolves the type reference and sets the * custom fields on the resource. When `type` is not provided, removes * the custom fields entirely. */ protected _setCustomType(context: RepositoryContext, resource: { custom?: CustomFields; }, { type, fields }: { type?: TypeResourceIdentifier; fields?: FieldContainer; }): Promise; /** * Hook to reject an action based on the state the resource is in at the * point the action is applied, rather than the state it started in. */ protected beforeAction(resource: BaseResource | Project, action: UpdateAction): void; apply(context: RepositoryContext, resource: R, version: number, actions: UpdateAction[]): Promise; } //#endregion //#region src/repositories/product-tailoring.d.ts declare class ProductTailoringRepository extends AbstractResourceRepository<"product-tailoring"> { constructor(config: Config); create(context: RepositoryContext, draft: any): Promise; } //#endregion //#region src/repositories/approval-flow.d.ts /** * Test-only draft for seeding ApprovalFlows. In commercetools, ApprovalFlows * are generated automatically when an Order matches an active ApprovalRule; * this draft exists so test fixtures can create them via the mock. */ type ApprovalFlowDraft = { order: OrderReference; businessUnit: BusinessUnitKeyReference; status?: ApprovalFlow["status"]; rules?: ApprovalFlow["rules"]; approvals?: ApprovalFlow["approvals"]; eligibleApprovers?: ApprovalFlow["eligibleApprovers"]; pendingApprovers?: ApprovalFlow["pendingApprovers"]; currentTierPendingApprovers?: ApprovalFlow["currentTierPendingApprovers"]; }; declare class ApprovalFlowRepository extends AbstractResourceRepository<"approval-flow"> { constructor(config: Config); create(context: RepositoryContext, draft: ApprovalFlowDraft): Promise; } //#endregion //#region src/repositories/approval-rule.d.ts declare class ApprovalRuleRepository extends AbstractResourceRepository<"approval-rule"> { constructor(config: Config); create(context: RepositoryContext, draft: ApprovalRuleDraft & { businessUnit?: { typeId: "business-unit"; key: string; }; }): Promise; } //#endregion //#region src/repositories/business-unit.d.ts declare class BusinessUnitRepository extends AbstractResourceRepository<"business-unit"> { constructor(config: Config); create(context: RepositoryContext, draft: BusinessUnitDraft): Promise; private _isCompanyDraft; private _isDivisionDraft; } //#endregion //#region src/repositories/cart/index.d.ts declare class CartRepository extends AbstractResourceRepository<"cart"> { constructor(config: Config); create(context: RepositoryContext, draft: CartDraft): Promise; getActiveCart(projectKey: string): Promise; draftLineItemtoLineItem: (projectKey: string, draftLineItem: LineItemDraft, currency: string, country: string | undefined, taxMode?: Cart["taxMode"], roundingMode?: Cart["taxRoundingMode"]) => Promise; createShippingInfo(context: RepositoryContext, resource: Writable, shippingMethodRef: NonNullable, externalTaxRate?: ExternalTaxRateDraft): Promise>; } //#endregion //#region src/orderSearch.d.ts declare class OrderSearch { protected _storage: AbstractStorage; constructor(config: Config); search(projectKey: string, params: OrderSearchRequest): Promise; } //#endregion //#region src/repositories/order/index.d.ts declare class OrderRepository extends AbstractResourceRepository<"order"> { protected _searchService: OrderSearch; constructor(config: Config); create(context: RepositoryContext, draft: OrderFromCartDraft): Promise; createFromCart(context: RepositoryContext, cartReference: CartReference, orderNumber?: string): Promise; createFromQuote(context: RepositoryContext, draft: OrderFromQuoteDraft): Promise; import(context: RepositoryContext, draft: OrderImportDraft): Promise; private lineItemFromImportDraft; private customLineItemFromImportDraft; getWithOrderNumber(context: RepositoryContext, orderNumber: string, params?: QueryParams$1): Promise; createShippingInfo(context: RepositoryContext, resource: Writable, shippingMethodRef: ShippingMethodReference): Promise>; private shippingInfoFromImportDraft; private deliveriesFromImportDraft; search(context: RepositoryContext, searchRequest: OrderSearchRequest): Promise; } //#endregion //#region src/repositories/quote/index.d.ts declare class QuoteRepository extends AbstractResourceRepository<"quote"> { constructor(config: Config); create(context: RepositoryContext, draft: QuoteDraft): Promise; } //#endregion //#region src/repositories/quote-request/index.d.ts declare class QuoteRequestRepository extends AbstractResourceRepository<"quote-request"> { constructor(config: Config); create(context: RepositoryContext, draft: QuoteRequestDraft | MyQuoteRequestDraft): Promise; createFromCart(context: RepositoryContext, cartReference: CartReference): Promise; } //#endregion //#region src/repositories/shopping-list/index.d.ts declare class ShoppingListRepository extends AbstractResourceRepository<"shopping-list"> { constructor(config: Config); create(context: RepositoryContext, draft: ShoppingListDraft): Promise; draftLineItemtoLineItem: (projectKey: string, draftLineItem: LineItemDraft) => Promise; } //#endregion //#region src/repositories/as-associate.d.ts declare class AsAssociateOrderRepository extends OrderRepository {} declare class AsAssociateCartRepository extends CartRepository {} declare class AsAssociateQuoteRepository extends QuoteRepository {} declare class AsAssociateQuoteRequestRepository extends QuoteRequestRepository {} declare class AsAssociateShoppingListRepository extends ShoppingListRepository {} declare class AsAssociateBusinessUnitRepository extends BusinessUnitRepository {} declare class AsAssociateApprovalFlowRepository extends ApprovalFlowRepository {} declare class AsAssociateApprovalRuleRepository extends ApprovalRuleRepository {} //#endregion //#region src/repositories/associate-role.d.ts declare class AssociateRoleRepository extends AbstractResourceRepository<"associate-role"> { constructor(config: Config); create(context: RepositoryContext, draft: AssociateRoleDraft): Promise; } //#endregion //#region src/repositories/attribute-group.d.ts declare class AttributeGroupRepository extends AbstractResourceRepository<"attribute-group"> { constructor(config: Config); create(context: RepositoryContext, draft: AttributeGroupDraft): Promise; } //#endregion //#region src/repositories/cart-discount/index.d.ts declare class CartDiscountRepository extends AbstractResourceRepository<"cart-discount"> { constructor(config: Config); create(context: RepositoryContext, draft: CartDiscountDraft): Promise; private transformValueDraft; } //#endregion //#region src/repositories/category/index.d.ts declare class CategoryRepository extends AbstractResourceRepository<"category"> { constructor(config: Config); create(context: RepositoryContext, draft: CategoryDraft): Promise; postProcessResource(context: RepositoryContext, resource: Writable, params?: GetParams$1): Promise; } //#endregion //#region src/repositories/channel.d.ts declare class ChannelRepository extends AbstractResourceRepository<"channel"> { constructor(config: Config); create(context: RepositoryContext, draft: ChannelDraft): Promise; } //#endregion //#region src/repositories/custom-object.d.ts declare class CustomObjectRepository extends AbstractResourceRepository<"key-value-document"> { constructor(config: Config); create(context: RepositoryContext, draft: Writable): Promise; getWithContainerAndKey(context: RepositoryContext, container: string, key: string): Promise; queryWithContainer(context: RepositoryContext, container: string, params?: QueryParams$1): Promise; } //#endregion //#region src/repositories/customer/index.d.ts declare class CustomerRepository extends AbstractResourceRepository<"customer"> { constructor(config: Config); create(context: RepositoryContext, draft: CustomerDraft): Promise; saveUpdate(context: RepositoryContext, version: number, resource: ShallowWritable): Promise>; passwordResetToken(context: RepositoryContext, request: CustomerCreatePasswordResetToken): Promise; passwordReset(context: RepositoryContext, resetPassword: CustomerResetPassword | MyCustomerResetPassword): Promise<{ id: string; version: number; key?: string; customerNumber?: string; externalId?: string; createdAt: string; lastModifiedAt: string; lastModifiedBy?: { clientId?: string; externalUserId?: string; customer?: { typeId: 'customer'; id: string; obj?: /*elided*/ any | undefined; } | undefined; anonymousId?: string; attributedTo?: { clientId?: string; source: import("@commercetools/platform-sdk").AttributionSource; } | undefined; associate?: { typeId: 'customer'; id: string; obj?: any | undefined; } | undefined; } | undefined; createdBy?: { clientId?: string; externalUserId?: string; customer?: { typeId: 'customer'; id: string; obj?: any | undefined; } | undefined; anonymousId?: string; attributedTo?: { clientId?: string; source: import("@commercetools/platform-sdk").AttributionSource; } | undefined; associate?: { typeId: 'customer'; id: string; obj?: any | undefined; } | undefined; } | undefined; email: string; password?: string; firstName?: string; lastName?: string; middleName?: string; title?: string; dateOfBirth?: string; companyName?: string; vatId?: string; addresses: WritableArray
; defaultShippingAddressId?: string; shippingAddressIds: WritableArray; defaultBillingAddressId?: string; billingAddressIds: WritableArray; isEmailVerified: boolean; customerGroup?: { typeId: 'customer-group'; id: string; obj?: { id: string; version: number; createdAt: string; lastModifiedAt: string; lastModifiedBy?: { clientId?: string; externalUserId?: string; customer?: { typeId: 'customer'; id: string; obj?: any | undefined; } | undefined; anonymousId?: string; attributedTo?: { clientId?: string; source: import("@commercetools/platform-sdk").AttributionSource; } | undefined; associate?: { typeId: 'customer'; id: string; obj?: any | undefined; } | undefined; } | undefined; createdBy?: { clientId?: string; externalUserId?: string; customer?: { typeId: 'customer'; id: string; obj?: any | undefined; } | undefined; anonymousId?: string; attributedTo?: { clientId?: string; source: import("@commercetools/platform-sdk").AttributionSource; } | undefined; associate?: { typeId: 'customer'; id: string; obj?: any | undefined; } | undefined; } | undefined; key?: string; name: string; custom?: { type: { typeId: 'type'; id: string; obj?: { id: string; version: number; createdAt: string; lastModifiedAt: string; lastModifiedBy?: { clientId?: string; externalUserId?: string; customer?: { typeId: 'customer'; id: string; obj?: any | undefined; } | undefined; anonymousId?: string; attributedTo?: { clientId?: string; source: import("@commercetools/platform-sdk").AttributionSource; } | undefined; associate?: { typeId: 'customer'; id: string; obj?: any | undefined; } | undefined; } | undefined; createdBy?: { clientId?: string; externalUserId?: string; customer?: { typeId: 'customer'; id: string; obj?: any | undefined; } | undefined; anonymousId?: string; attributedTo?: { clientId?: string; source: import("@commercetools/platform-sdk").AttributionSource; } | undefined; associate?: { typeId: 'customer'; id: string; obj?: any | undefined; } | undefined; } | undefined; key: string; name: { [x: string]: string; }; description?: { [x: string]: string; } | undefined; resourceTypeIds: WritableArray; fieldDefinitions: WritableArray; } | undefined; }; fields: { [x: string]: any; }; } | undefined; } | undefined; } | undefined; customerGroupAssignments: WritableArray; custom?: { type: { typeId: 'type'; id: string; obj?: { id: string; version: number; createdAt: string; lastModifiedAt: string; lastModifiedBy?: { clientId?: string; externalUserId?: string; customer?: { typeId: 'customer'; id: string; obj?: any | undefined; } | undefined; anonymousId?: string; attributedTo?: { clientId?: string; source: import("@commercetools/platform-sdk").AttributionSource; } | undefined; associate?: { typeId: 'customer'; id: string; obj?: any | undefined; } | undefined; } | undefined; createdBy?: { clientId?: string; externalUserId?: string; customer?: { typeId: 'customer'; id: string; obj?: any | undefined; } | undefined; anonymousId?: string; attributedTo?: { clientId?: string; source: import("@commercetools/platform-sdk").AttributionSource; } | undefined; associate?: { typeId: 'customer'; id: string; obj?: any | undefined; } | undefined; } | undefined; key: string; name: { [x: string]: string; }; description?: { [x: string]: string; } | undefined; resourceTypeIds: WritableArray; fieldDefinitions: WritableArray; } | undefined; }; fields: { [x: string]: any; }; } | undefined; locale?: string; salutation?: string; stores: WritableArray; authenticationMode: import("@commercetools/platform-sdk").AuthenticationMode; }>; emailToken(context: RepositoryContext, id: string): Promise; emailTokenConfirm(context: RepositoryContext, request: { tokenValue: string; }): Promise<{ id: string; version: number; key?: string; customerNumber?: string; externalId?: string; createdAt: string; lastModifiedAt: string; lastModifiedBy?: { clientId?: string; externalUserId?: string; customer?: { typeId: 'customer'; id: string; obj?: /*elided*/ any | undefined; } | undefined; anonymousId?: string; attributedTo?: { clientId?: string; source: import("@commercetools/platform-sdk").AttributionSource; } | undefined; associate?: { typeId: 'customer'; id: string; obj?: any | undefined; } | undefined; } | undefined; createdBy?: { clientId?: string; externalUserId?: string; customer?: { typeId: 'customer'; id: string; obj?: any | undefined; } | undefined; anonymousId?: string; attributedTo?: { clientId?: string; source: import("@commercetools/platform-sdk").AttributionSource; } | undefined; associate?: { typeId: 'customer'; id: string; obj?: any | undefined; } | undefined; } | undefined; email: string; password?: string; firstName?: string; lastName?: string; middleName?: string; title?: string; dateOfBirth?: string; companyName?: string; vatId?: string; addresses: WritableArray
; defaultShippingAddressId?: string; shippingAddressIds: WritableArray; defaultBillingAddressId?: string; billingAddressIds: WritableArray; isEmailVerified: boolean; customerGroup?: { typeId: 'customer-group'; id: string; obj?: { id: string; version: number; createdAt: string; lastModifiedAt: string; lastModifiedBy?: { clientId?: string; externalUserId?: string; customer?: { typeId: 'customer'; id: string; obj?: any | undefined; } | undefined; anonymousId?: string; attributedTo?: { clientId?: string; source: import("@commercetools/platform-sdk").AttributionSource; } | undefined; associate?: { typeId: 'customer'; id: string; obj?: any | undefined; } | undefined; } | undefined; createdBy?: { clientId?: string; externalUserId?: string; customer?: { typeId: 'customer'; id: string; obj?: any | undefined; } | undefined; anonymousId?: string; attributedTo?: { clientId?: string; source: import("@commercetools/platform-sdk").AttributionSource; } | undefined; associate?: { typeId: 'customer'; id: string; obj?: any | undefined; } | undefined; } | undefined; key?: string; name: string; custom?: { type: { typeId: 'type'; id: string; obj?: { id: string; version: number; createdAt: string; lastModifiedAt: string; lastModifiedBy?: { clientId?: string; externalUserId?: string; customer?: { typeId: 'customer'; id: string; obj?: any | undefined; } | undefined; anonymousId?: string; attributedTo?: { clientId?: string; source: import("@commercetools/platform-sdk").AttributionSource; } | undefined; associate?: { typeId: 'customer'; id: string; obj?: any | undefined; } | undefined; } | undefined; createdBy?: { clientId?: string; externalUserId?: string; customer?: { typeId: 'customer'; id: string; obj?: any | undefined; } | undefined; anonymousId?: string; attributedTo?: { clientId?: string; source: import("@commercetools/platform-sdk").AttributionSource; } | undefined; associate?: { typeId: 'customer'; id: string; obj?: any | undefined; } | undefined; } | undefined; key: string; name: { [x: string]: string; }; description?: { [x: string]: string; } | undefined; resourceTypeIds: WritableArray; fieldDefinitions: WritableArray; } | undefined; }; fields: { [x: string]: any; }; } | undefined; } | undefined; } | undefined; customerGroupAssignments: WritableArray; custom?: { type: { typeId: 'type'; id: string; obj?: { id: string; version: number; createdAt: string; lastModifiedAt: string; lastModifiedBy?: { clientId?: string; externalUserId?: string; customer?: { typeId: 'customer'; id: string; obj?: any | undefined; } | undefined; anonymousId?: string; attributedTo?: { clientId?: string; source: import("@commercetools/platform-sdk").AttributionSource; } | undefined; associate?: { typeId: 'customer'; id: string; obj?: any | undefined; } | undefined; } | undefined; createdBy?: { clientId?: string; externalUserId?: string; customer?: { typeId: 'customer'; id: string; obj?: any | undefined; } | undefined; anonymousId?: string; attributedTo?: { clientId?: string; source: import("@commercetools/platform-sdk").AttributionSource; } | undefined; associate?: { typeId: 'customer'; id: string; obj?: any | undefined; } | undefined; } | undefined; key: string; name: { [x: string]: string; }; description?: { [x: string]: string; } | undefined; resourceTypeIds: WritableArray; fieldDefinitions: WritableArray; } | undefined; }; fields: { [x: string]: any; }; } | undefined; locale?: string; salutation?: string; stores: WritableArray; authenticationMode: import("@commercetools/platform-sdk").AuthenticationMode; }>; private storeReferenceToStoreKeyReference; } //#endregion //#region src/repositories/customer-group.d.ts declare class CustomerGroupRepository extends AbstractResourceRepository<"customer-group"> { constructor(config: Config); create(context: RepositoryContext, draft: CustomerGroupDraft): Promise; } //#endregion //#region src/repositories/discount-code/index.d.ts declare class DiscountCodeRepository extends AbstractResourceRepository<"discount-code"> { constructor(config: Config); create(context: RepositoryContext, draft: DiscountCodeDraft): Promise; } //#endregion //#region src/repositories/discount-group/index.d.ts declare class DiscountGroupRepository extends AbstractResourceRepository<"discount-group"> { constructor(config: Config); create(context: RepositoryContext, draft: DiscountGroupDraft): Promise; } //#endregion //#region src/repositories/extension.d.ts declare class ExtensionRepository extends AbstractResourceRepository<"extension"> { constructor(config: Config); create(context: RepositoryContext, draft: ExtensionDraft): Promise; postProcessResource(context: RepositoryContext, resource: Extension): Promise; } //#endregion //#region src/repositories/inventory-entry/index.d.ts declare class InventoryEntryRepository extends AbstractResourceRepository<"inventory-entry"> { constructor(config: Config); create(context: RepositoryContext, draft: InventoryEntryDraft): Promise; } //#endregion //#region src/repositories/my-customer.d.ts declare class MyCustomerRepository extends CustomerRepository { changePassword(context: RepositoryContext, changePassword: MyCustomerChangePassword): Promise<{ id: string; version: number; key?: string; customerNumber?: string; externalId?: string; createdAt: string; lastModifiedAt: string; lastModifiedBy?: { clientId?: string; externalUserId?: string; customer?: { typeId: 'customer'; id: string; obj?: /*elided*/ any | undefined; } | undefined; anonymousId?: string; attributedTo?: { clientId?: string; source: import("@commercetools/platform-sdk").AttributionSource; } | undefined; associate?: { typeId: 'customer'; id: string; obj?: any | undefined; } | undefined; } | undefined; createdBy?: { clientId?: string; externalUserId?: string; customer?: { typeId: 'customer'; id: string; obj?: any | undefined; } | undefined; anonymousId?: string; attributedTo?: { clientId?: string; source: import("@commercetools/platform-sdk").AttributionSource; } | undefined; associate?: { typeId: 'customer'; id: string; obj?: any | undefined; } | undefined; } | undefined; email: string; password?: string; firstName?: string; lastName?: string; middleName?: string; title?: string; dateOfBirth?: string; companyName?: string; vatId?: string; addresses: WritableArray; defaultShippingAddressId?: string; shippingAddressIds: WritableArray; defaultBillingAddressId?: string; billingAddressIds: WritableArray; isEmailVerified: boolean; customerGroup?: { typeId: 'customer-group'; id: string; obj?: { id: string; version: number; createdAt: string; lastModifiedAt: string; lastModifiedBy?: { clientId?: string; externalUserId?: string; customer?: { typeId: 'customer'; id: string; obj?: any | undefined; } | undefined; anonymousId?: string; attributedTo?: { clientId?: string; source: import("@commercetools/platform-sdk").AttributionSource; } | undefined; associate?: { typeId: 'customer'; id: string; obj?: any | undefined; } | undefined; } | undefined; createdBy?: { clientId?: string; externalUserId?: string; customer?: { typeId: 'customer'; id: string; obj?: any | undefined; } | undefined; anonymousId?: string; attributedTo?: { clientId?: string; source: import("@commercetools/platform-sdk").AttributionSource; } | undefined; associate?: { typeId: 'customer'; id: string; obj?: any | undefined; } | undefined; } | undefined; key?: string; name: string; custom?: { type: { typeId: 'type'; id: string; obj?: { id: string; version: number; createdAt: string; lastModifiedAt: string; lastModifiedBy?: { clientId?: string; externalUserId?: string; customer?: { typeId: 'customer'; id: string; obj?: any | undefined; } | undefined; anonymousId?: string; attributedTo?: { clientId?: string; source: import("@commercetools/platform-sdk").AttributionSource; } | undefined; associate?: { typeId: 'customer'; id: string; obj?: any | undefined; } | undefined; } | undefined; createdBy?: { clientId?: string; externalUserId?: string; customer?: { typeId: 'customer'; id: string; obj?: any | undefined; } | undefined; anonymousId?: string; attributedTo?: { clientId?: string; source: import("@commercetools/platform-sdk").AttributionSource; } | undefined; associate?: { typeId: 'customer'; id: string; obj?: any | undefined; } | undefined; } | undefined; key: string; name: { [x: string]: string; }; description?: { [x: string]: string; } | undefined; resourceTypeIds: WritableArray; fieldDefinitions: WritableArray; } | undefined; }; fields: { [x: string]: any; }; } | undefined; } | undefined; } | undefined; customerGroupAssignments: WritableArray; custom?: { type: { typeId: 'type'; id: string; obj?: { id: string; version: number; createdAt: string; lastModifiedAt: string; lastModifiedBy?: { clientId?: string; externalUserId?: string; customer?: { typeId: 'customer'; id: string; obj?: any | undefined; } | undefined; anonymousId?: string; attributedTo?: { clientId?: string; source: import("@commercetools/platform-sdk").AttributionSource; } | undefined; associate?: { typeId: 'customer'; id: string; obj?: any | undefined; } | undefined; } | undefined; createdBy?: { clientId?: string; externalUserId?: string; customer?: { typeId: 'customer'; id: string; obj?: any | undefined; } | undefined; anonymousId?: string; attributedTo?: { clientId?: string; source: import("@commercetools/platform-sdk").AttributionSource; } | undefined; associate?: { typeId: 'customer'; id: string; obj?: any | undefined; } | undefined; } | undefined; key: string; name: { [x: string]: string; }; description?: { [x: string]: string; } | undefined; resourceTypeIds: WritableArray; fieldDefinitions: WritableArray; } | undefined; }; fields: { [x: string]: any; }; } | undefined; locale?: string; salutation?: string; stores: WritableArray; authenticationMode: import("@commercetools/platform-sdk").AuthenticationMode; }>; confirmEmail(context: RepositoryContext, resetPassword: MyCustomerEmailVerify): Promise<{ id: string; version: number; key?: string; customerNumber?: string; externalId?: string; createdAt: string; lastModifiedAt: string; lastModifiedBy?: { clientId?: string; externalUserId?: string; customer?: { typeId: 'customer'; id: string; obj?: /*elided*/ any | undefined; } | undefined; anonymousId?: string; attributedTo?: { clientId?: string; source: import("@commercetools/platform-sdk").AttributionSource; } | undefined; associate?: { typeId: 'customer'; id: string; obj?: any | undefined; } | undefined; } | undefined; createdBy?: { clientId?: string; externalUserId?: string; customer?: { typeId: 'customer'; id: string; obj?: any | undefined; } | undefined; anonymousId?: string; attributedTo?: { clientId?: string; source: import("@commercetools/platform-sdk").AttributionSource; } | undefined; associate?: { typeId: 'customer'; id: string; obj?: any | undefined; } | undefined; } | undefined; email: string; password?: string; firstName?: string; lastName?: string; middleName?: string; title?: string; dateOfBirth?: string; companyName?: string; vatId?: string; addresses: WritableArray; defaultShippingAddressId?: string; shippingAddressIds: WritableArray; defaultBillingAddressId?: string; billingAddressIds: WritableArray; isEmailVerified: boolean; customerGroup?: { typeId: 'customer-group'; id: string; obj?: { id: string; version: number; createdAt: string; lastModifiedAt: string; lastModifiedBy?: { clientId?: string; externalUserId?: string; customer?: { typeId: 'customer'; id: string; obj?: any | undefined; } | undefined; anonymousId?: string; attributedTo?: { clientId?: string; source: import("@commercetools/platform-sdk").AttributionSource; } | undefined; associate?: { typeId: 'customer'; id: string; obj?: any | undefined; } | undefined; } | undefined; createdBy?: { clientId?: string; externalUserId?: string; customer?: { typeId: 'customer'; id: string; obj?: any | undefined; } | undefined; anonymousId?: string; attributedTo?: { clientId?: string; source: import("@commercetools/platform-sdk").AttributionSource; } | undefined; associate?: { typeId: 'customer'; id: string; obj?: any | undefined; } | undefined; } | undefined; key?: string; name: string; custom?: { type: { typeId: 'type'; id: string; obj?: { id: string; version: number; createdAt: string; lastModifiedAt: string; lastModifiedBy?: { clientId?: string; externalUserId?: string; customer?: { typeId: 'customer'; id: string; obj?: any | undefined; } | undefined; anonymousId?: string; attributedTo?: { clientId?: string; source: import("@commercetools/platform-sdk").AttributionSource; } | undefined; associate?: { typeId: 'customer'; id: string; obj?: any | undefined; } | undefined; } | undefined; createdBy?: { clientId?: string; externalUserId?: string; customer?: { typeId: 'customer'; id: string; obj?: any | undefined; } | undefined; anonymousId?: string; attributedTo?: { clientId?: string; source: import("@commercetools/platform-sdk").AttributionSource; } | undefined; associate?: { typeId: 'customer'; id: string; obj?: any | undefined; } | undefined; } | undefined; key: string; name: { [x: string]: string; }; description?: { [x: string]: string; } | undefined; resourceTypeIds: WritableArray; fieldDefinitions: WritableArray; } | undefined; }; fields: { [x: string]: any; }; } | undefined; } | undefined; } | undefined; customerGroupAssignments: WritableArray; custom?: { type: { typeId: 'type'; id: string; obj?: { id: string; version: number; createdAt: string; lastModifiedAt: string; lastModifiedBy?: { clientId?: string; externalUserId?: string; customer?: { typeId: 'customer'; id: string; obj?: any | undefined; } | undefined; anonymousId?: string; attributedTo?: { clientId?: string; source: import("@commercetools/platform-sdk").AttributionSource; } | undefined; associate?: { typeId: 'customer'; id: string; obj?: any | undefined; } | undefined; } | undefined; createdBy?: { clientId?: string; externalUserId?: string; customer?: { typeId: 'customer'; id: string; obj?: any | undefined; } | undefined; anonymousId?: string; attributedTo?: { clientId?: string; source: import("@commercetools/platform-sdk").AttributionSource; } | undefined; associate?: { typeId: 'customer'; id: string; obj?: any | undefined; } | undefined; } | undefined; key: string; name: { [x: string]: string; }; description?: { [x: string]: string; } | undefined; resourceTypeIds: WritableArray; fieldDefinitions: WritableArray; } | undefined; }; fields: { [x: string]: any; }; } | undefined; locale?: string; salutation?: string; stores: WritableArray; authenticationMode: import("@commercetools/platform-sdk").AuthenticationMode; }>; deleteMe(context: RepositoryContext): Promise; getMe(context: RepositoryContext): Promise; } //#endregion //#region src/repositories/my-order.d.ts declare class MyOrderRepository extends OrderRepository { create(context: RepositoryContext, draft: MyOrderFromCartDraft): Promise; } //#endregion //#region src/repositories/order-edit.d.ts declare class OrderEditRepository extends AbstractResourceRepository<"order-edit"> { constructor(config: Config); create(context: RepositoryContext, draft: OrderEditDraft): Promise; } //#endregion //#region src/repositories/payment/index.d.ts declare class PaymentRepository extends AbstractResourceRepository<"payment"> { constructor(config: Config); create(context: RepositoryContext, draft: PaymentDraft): Promise; } //#endregion //#region src/lib/review-statistics.d.ts declare class ReviewStatisticsService { private _storage; constructor(_storage: AbstractStorage); calculateProductReviewStatistics(projectKey: string, productId: string): Promise; } //#endregion //#region src/product-search.d.ts interface ProductSearchVariantAvailability { isOnStock: boolean; availableQuantity: number; isOnStockForChannel: string | undefined; } declare class ProductSearch { protected _storage: AbstractStorage; constructor(config: Config); search(projectKey: string, params: ProductSearchRequest): Promise; transformProduct(product: Product, staged: boolean, availabilityBySku: Map, categoriesById: Map): ProductProjection; } //#endregion //#region src/repositories/product/index.d.ts declare class ProductRepository extends AbstractResourceRepository<"product"> { protected _searchService: ProductSearch; protected _reviewStatisticsService: ReviewStatisticsService; constructor(config: Config); create(context: RepositoryContext, draft: ProductDraft): Promise; postProcessResource(context: RepositoryContext, resource: Product, params?: GetParams$1): Promise; search(context: RepositoryContext, searchRequest: ProductSearchRequest): Promise; } //#endregion //#region src/repositories/product-discount.d.ts declare class ProductDiscountRepository extends AbstractResourceRepository<"product-discount"> { constructor(config: Config); create(context: RepositoryContext, draft: ProductDiscountDraft): Promise; } //#endregion //#region src/lib/projectionSearchFilter.d.ts type RangeExpression = { type: "RangeExpression"; start?: number; stop?: number; match: (obj: any) => boolean; }; type FilterExpression = { type: "FilterExpression"; match: (obj: any) => boolean; }; //#endregion //#region src/product-projection-search.d.ts type ProductProjectionSearchParams = { fuzzy?: boolean; fuzzyLevel?: number; markMatchingVariants?: boolean; staged?: boolean; filter?: string[]; "filter.facets"?: string[]; "filter.query"?: string[]; facet?: string | string[]; sort?: string | string[]; limit?: number; offset?: number; withTotal?: boolean; priceCurrency?: string; priceCountry?: string; priceCustomerGroup?: string; priceChannel?: string; localeProjection?: string; storeProjection?: string; expand?: string | string[]; [key: string]: QueryParam; }; declare class ProductProjectionSearch { protected _storage: AbstractStorage; protected _reviewStatisticsService: ReviewStatisticsService; constructor(config: Config); search(projectKey: string, params: ProductProjectionSearchParams): Promise; transform(product: Product, staged: boolean, projectKey: string): Promise; getFacets(params: ProductProjectionSearchParams, products: ProductProjection[]): FacetResults; /** * TODO: This implemention needs the following additional features: * - counting products * - correct dataType */ termFacet(facet: string, products: ProductProjection[], countProducts: boolean): TermFacetResult; filterFacet(source: string, filters: FilterExpression[] | undefined, products: ProductProjection[], countProducts: boolean): FilteredFacetResult; rangeFacet(source: string, ranges: RangeExpression[] | undefined, products: ProductProjection[], countProducts: boolean): RangeFacetResult; } //#endregion //#region src/repositories/product-projection.d.ts type ProductProjectionQueryParams = { staged?: boolean; priceCurrency?: string; priceCountry?: string; priceCustomerGroup?: string; priceChannel?: string; localeProjection?: string; storeProjection?: string; expand?: string | string[]; sort?: string | string[]; limit?: number; offset?: number; withTotal?: boolean; where?: string | string[]; [key: string]: QueryParam; }; type ProductProjectionSuggestParams = { searchKeywords: Record; staged?: boolean; fuzzy?: boolean; fuzzyLevel?: number; limit?: number; }; declare class ProductProjectionRepository extends AbstractResourceRepository<"product-projection"> { protected _searchService: ProductProjectionSearch; constructor(config: Config); create(context: RepositoryContext, draft: ProductDraft): Promise; get(context: RepositoryContext, id: string, params?: GetParams$1): Promise; query(context: RepositoryContext, params?: ProductProjectionQueryParams): Promise<{ count: number; total: number; offset: number; limit: number; results: ProductProjection[]; }>; search(context: RepositoryContext, query: ProductProjectionQueryParams): Promise; suggest(context: RepositoryContext, params: ProductProjectionSuggestParams): Promise; } //#endregion //#region src/repositories/product-selection.d.ts declare class ProductSelectionRepository extends AbstractResourceRepository<"product-selection"> { constructor(config: Config); create(context: RepositoryContext, draft: ProductSelectionDraft): Promise; } //#endregion //#region src/repositories/product-type.d.ts declare class ProductTypeRepository extends AbstractResourceRepository<"product-type"> { constructor(config: Config); create(context: RepositoryContext, draft: ProductTypeDraft): Promise; } //#endregion //#region src/repositories/project.d.ts declare class ProjectRepository extends AbstractRepository { constructor(config: Config); get(context: RepositoryContext): Promise; postProcessResource(context: RepositoryContext, resource: Project | null): Promise; saveNew(context: RepositoryContext, resource: Writable): Promise; saveUpdate(context: RepositoryContext, version: number, resource: Project): Promise; } //#endregion //#region src/repositories/quote-staged/index.d.ts declare class StagedQuoteRepository extends AbstractResourceRepository<"staged-quote"> { constructor(config: Config); create(context: RepositoryContext, draft: StagedQuoteDraft): Promise; } //#endregion //#region src/repositories/recurrence-policy/index.d.ts declare class RecurrencePolicyRepository extends AbstractResourceRepository<"recurrence-policy"> { constructor(config: Config); create(context: RepositoryContext, draft: RecurrencePolicyDraft): Promise; } //#endregion //#region src/repositories/recurring-order/index.d.ts declare class RecurringOrderRepository extends AbstractResourceRepository<"recurring-order"> { constructor(config: Config); create(context: RepositoryContext, draft: RecurringOrderDraft): Promise; } //#endregion //#region src/repositories/review.d.ts declare class ReviewRepository extends AbstractResourceRepository<"review"> { constructor(config: Config); create(context: RepositoryContext, draft: ReviewDraft): Promise; } //#endregion //#region src/repositories/shipping-method/index.d.ts declare class ShippingMethodRepository extends AbstractResourceRepository<"shipping-method"> { constructor(config: Config); create(context: RepositoryContext, draft: ShippingMethodDraft): Promise; matchingCart(context: RepositoryContext, cartId: string, params?: GetParams$1): Promise<{ limit?: number; count: number; total?: number; offset?: number; results: { id: string; version: number; createdAt: string; lastModifiedAt: string; lastModifiedBy?: import("@commercetools/platform-sdk").LastModifiedBy; createdBy?: import("@commercetools/platform-sdk").CreatedBy; key?: string; name: string; localizedName?: import("@commercetools/platform-sdk").LocalizedString; description?: string; localizedDescription?: import("@commercetools/platform-sdk").LocalizedString; taxCategory: import("@commercetools/platform-sdk").TaxCategoryReference; active: boolean; isDefault: boolean; predicate?: string; custom?: import("@commercetools/platform-sdk").CustomFields; stores: import("@commercetools/platform-sdk").StoreKeyReference[]; zoneRates: { zone: ZoneReference; shippingRates: import("@commercetools/platform-sdk").ShippingRate[]; }[]; }[]; } | undefined>; private _transformZoneRateDraft; } //#endregion //#region src/repositories/standalone-price.d.ts declare class StandAlonePriceRepository extends AbstractResourceRepository<"standalone-price"> { constructor(config: Config); create(context: RepositoryContext, draft: StandalonePriceDraft): Promise; transformChannelReferenceDraft(channel: ChannelResourceIdentifier): ChannelReference; } //#endregion //#region src/repositories/state.d.ts declare class StateRepository extends AbstractResourceRepository<"state"> { constructor(config: Config); create(context: RepositoryContext, draft: StateDraft): Promise; } //#endregion //#region src/repositories/store.d.ts declare class StoreRepository extends AbstractResourceRepository<"store"> { constructor(config: Config); create(context: RepositoryContext, draft: StoreDraft): Promise; } //#endregion //#region src/repositories/subscription.d.ts declare class SubscriptionRepository extends AbstractResourceRepository<"subscription"> { constructor(config: Config); create(context: RepositoryContext, draft: SubscriptionDraft): Promise; } //#endregion //#region src/repositories/tax-category/index.d.ts declare class TaxCategoryRepository extends AbstractResourceRepository<"tax-category"> { constructor(config: Config); create(context: RepositoryContext, draft: TaxCategoryDraft): Promise; } //#endregion //#region src/repositories/type/index.d.ts declare class TypeRepository extends AbstractResourceRepository<"type"> { constructor(config: Config); create(context: RepositoryContext, draft: TypeDraft): Promise; } //#endregion //#region src/repositories/zone.d.ts declare class ZoneRepository extends AbstractResourceRepository<"zone"> { constructor(config: Config); create(context: RepositoryContext, draft: ZoneDraft): Promise; } //#endregion //#region src/repositories/index.d.ts type RepositoryMap = ReturnType; declare const createRepositories: (config: Config) => { "as-associate": { "approval-flow": AsAssociateApprovalFlowRepository; "approval-rule": AsAssociateApprovalRuleRepository; "business-unit": AsAssociateBusinessUnitRepository; cart: AsAssociateCartRepository; order: AsAssociateOrderRepository; quote: AsAssociateQuoteRepository; "quote-request": AsAssociateQuoteRequestRepository; "shopping-list": AsAssociateShoppingListRepository; }; "approval-flow": ApprovalFlowRepository; "approval-rule": ApprovalRuleRepository; "associate-role": AssociateRoleRepository; "attribute-group": AttributeGroupRepository; "business-unit": BusinessUnitRepository; category: CategoryRepository; cart: CartRepository; "cart-discount": CartDiscountRepository; customer: CustomerRepository; channel: ChannelRepository; "customer-group": CustomerGroupRepository; "discount-code": DiscountCodeRepository; "discount-group": DiscountGroupRepository; extension: ExtensionRepository; "inventory-entry": InventoryEntryRepository; "key-value-document": CustomObjectRepository; order: OrderRepository; "order-edit": OrderEditRepository; payment: PaymentRepository; "my-cart": CartRepository; "my-order": MyOrderRepository; "my-customer": MyCustomerRepository; "my-payment": PaymentRepository; "my-shopping-list": ShoppingListRepository; product: ProductRepository; "product-type": ProductTypeRepository; "product-discount": ProductDiscountRepository; "product-projection": ProductProjectionRepository; "product-selection": ProductSelectionRepository; "product-tailoring": ProductTailoringRepository; project: ProjectRepository; "recurring-order": RecurringOrderRepository; "recurrence-policy": RecurrencePolicyRepository; review: ReviewRepository; quote: QuoteRepository; "quote-request": QuoteRequestRepository; "shipping-method": ShippingMethodRepository; "shopping-list": ShoppingListRepository; "staged-quote": StagedQuoteRepository; "standalone-price": StandAlonePriceRepository; state: StateRepository; store: StoreRepository; subscription: SubscriptionRepository; "tax-category": TaxCategoryRepository; type: TypeRepository; zone: ZoneRepository; }; //#endregion //#region src/types.d.ts type Builtin = string | number | boolean | undefined | null | symbol | bigint | Date | RegExp; type Writable = T extends Builtin ? T : T extends ReadonlyArray ? WritableArray : T extends object ? { -readonly [P in keyof T]: Writable; } : T; interface WritableArray extends Array> {} type ShallowWritable = { -readonly [P in keyof T]: T[P]; }; type ResourceType = keyof ResourceMap & keyof RepositoryMap; type ResourceMap = { "approval-flow": ctp.ApprovalFlow; "approval-rule": ctp.ApprovalRule; "attribute-group": ctp.AttributeGroup; "associate-role": ctp.AssociateRole; "business-unit": ctp.BusinessUnit; "cart-discount": ctp.CartDiscount; cart: ctp.Cart; category: ctp.Category; channel: ctp.Channel; "customer-email-token": never; "customer-group": ctp.CustomerGroup; "customer-password-token": never; customer: ctp.Customer; "discount-code": ctp.DiscountCode; "discount-group": ctp.DiscountGroup; extension: ctp.Extension; "inventory-entry": ctp.InventoryEntry; "key-value-document": ctp.CustomObject; "order-edit": ctp.OrderEdit; order: ctp.Order; payment: ctp.Payment; "product-discount": ctp.ProductDiscount; "product-price": ctp.StandalonePrice; "product-projection": ctp.ProductProjection; "product-selection": ctp.ProductSelection; "product-tailoring": ctp.ProductTailoring; "product-type": ctp.ProductType; product: ctp.Product; "quote-request": ctp.QuoteRequest; quote: ctp.Quote; review: ctp.Review; "shipping-method": ctp.ShippingMethod; "shopping-list": ctp.ShoppingList; "staged-quote": ctp.StagedQuote; "standalone-price": ctp.StandalonePrice; state: ctp.State; store: ctp.Store; subscription: ctp.Subscription; "recurring-order": ctp.RecurringOrder; "recurrence-policy": ctp.RecurrencePolicy; "tax-category": ctp.TaxCategory; type: ctp.Type; zone: ctp.Zone; }; type PagedQueryResponseMap = { "approval-flow": ctp.ApprovalFlowPagedQueryResponse; "approval-rule": ctp.ApprovalRulePagedQueryResponse; "attribute-group": ctp.AttributeGroupPagedQueryResponse; "associate-role": ctp.AssociateRolePagedQueryResponse; "business-unit": ctp.BusinessUnitPagedQueryResponse; "cart-discount": ctp.CartDiscountPagedQueryResponse; cart: ctp.CartPagedQueryResponse; category: ctp.CategoryPagedQueryResponse; channel: ctp.ChannelPagedQueryResponse; "customer-email-token": never; "customer-group": ctp.CustomerGroupPagedQueryResponse; "customer-password-token": never; customer: ctp.CustomerPagedQueryResponse; "discount-code": ctp.DiscountCodePagedQueryResponse; "discount-group": ctp.DiscountGroupPagedQueryResponse; extension: ctp.ExtensionPagedQueryResponse; "inventory-entry": ctp.InventoryPagedQueryResponse; "key-value-document": ctp.CustomObjectPagedQueryResponse; "order-edit": ctp.OrderEditPagedQueryResponse; order: ctp.OrderPagedQueryResponse; payment: ctp.PaymentPagedQueryResponse; "product-discount": ctp.ProductDiscountPagedQueryResponse; "product-price": ctp.StandalonePricePagedQueryResponse; "product-projection": ctp.ProductProjectionPagedQueryResponse; "product-selection": ctp.ProductSelectionPagedQueryResponse; "product-tailoring": ctp.ProductTailoringPagedQueryResponse; "product-type": ctp.ProductTypePagedQueryResponse; product: ctp.ProductPagedQueryResponse; "quote-request": ctp.QuoteRequestPagedQueryResponse; quote: ctp.QuotePagedQueryResponse; review: ctp.ReviewPagedQueryResponse; "shipping-method": ctp.ShippingMethodPagedQueryResponse; "shopping-list": ctp.ShoppingListPagedQueryResponse; "staged-quote": ctp.StagedQuotePagedQueryResponse; "standalone-price": ctp.StandalonePricePagedQueryResponse; state: ctp.StatePagedQueryResponse; store: ctp.StorePagedQueryResponse; subscription: ctp.SubscriptionPagedQueryResponse; "recurring-order": ctp.RecurringOrderPagedQueryResponse; "recurrence-policy": ctp.RecurrencePolicyPagedQueryResponse; "tax-category": ctp.TaxCategoryPagedQueryResponse; type: ctp.TypePagedQueryResponse; zone: ctp.ZonePagedQueryResponse; }; //#endregion //#region src/storage/storage-map.d.ts /** * A Map wrapper that deep-clones values on insertion and retrieval. * * This ensures that the stored data is fully isolated from external * mutations: callers cannot accidentally corrupt the store by modifying * an object after inserting it, and retrieved objects are independent * copies that can be freely mutated without affecting the store. */ declare class StorageMap { private _map; constructor(); get size(): number; set(key: K, value: V): this; get(key: K): V | undefined; has(key: K): boolean; delete(key: K): boolean; clear(): void; /** * Returns cloned values. Each value is a deep copy. */ values(): IterableIterator; /** * Returns cloned entries. Each value is a deep copy, keys are returned as-is. */ entries(): IterableIterator<[K, V]>; [Symbol.iterator](): IterableIterator<[K, V]>; } //#endregion //#region src/storage/abstract.d.ts type GetParams = { expand?: string[]; }; type QueryParams = { expand?: string | string[]; sort?: string | string[]; limit?: number; offset?: number; withTotal?: boolean; where?: string | string[]; [key: string]: QueryParam; }; declare abstract class AbstractStorage { /** * Close the storage backend and release any resources. * Override this in subclasses that hold external resources (e.g. database connections). */ close(): void; abstract clear(): Promise; abstract all(projectKey: string, typeId: RT): Promise>; /** * Return the number of resources of the given type. * This is more efficient than loading all resources and counting them. */ abstract count(projectKey: string, typeId: ResourceType): Promise; abstract add(projectKey: string, typeId: RT, obj: ResourceMap[RT], params?: GetParams): Promise; abstract get(projectKey: string, typeId: RT, id: string, params?: GetParams): Promise; abstract getByKey(projectKey: string, typeId: RT, key: string, params?: GetParams): Promise; abstract addProject(projectKey: string): Promise; abstract getProject(projectKey: string): Promise; abstract saveProject(project: Project): Promise; abstract delete(projectKey: string, typeId: RT, id: string, params: GetParams): Promise; abstract query(projectKey: string, typeId: RT, params: QueryParams): Promise; /** * Look up a custom object by its container and key. * This is an O(1) operation for storage backends that maintain * a secondary index on (container, key). */ abstract getByContainerAndKey(projectKey: string, container: string, key: string): Promise; expand(projectKey: string, obj: T, clause: undefined | string | string[]): Promise; getByResourceIdentifier(projectKey: string, identifier: ResourceIdentifier): Promise; search(projectKey: string, typeId: ResourceType, params: QueryParams): Promise; private _resolveResource; private _resolveReference; private _resolveShoppingListLineItemVariant; } type ProjectStorage = { [index in ResourceType]: StorageMap; }; //#endregion //#region src/storage/in-memory.d.ts declare class InMemoryStorage extends AbstractStorage { protected resources: { [projectKey: string]: ProjectStorage; }; protected projects: { [projectKey: string]: Project; }; private _customObjectIndex; addProject(projectKey: string): Promise; saveProject(project: Project): Promise; getProject(projectKey: string): Promise; private forProjectKey; clear(): Promise; all(projectKey: string, typeId: RT): Promise; count(projectKey: string, typeId: ResourceType): Promise; add(projectKey: string, typeId: RT, obj: ResourceMap[RT], params?: GetParams): Promise; get(projectKey: string, typeId: RT, id: string, params?: GetParams): Promise; getByKey(projectKey: string, typeId: RT, key: string, params?: GetParams): Promise; delete(projectKey: string, typeId: RT, id: string, params?: GetParams): Promise; getByContainerAndKey(projectKey: string, container: string, key: string): Promise; query(projectKey: string, typeId: RT, params: QueryParams): Promise; } //#endregion //#region src/config.d.ts type Config = { strict: boolean; storage: AbstractStorage; }; //#endregion export { QueryParams as a, ResourceType as c, GetParams as i, RepositoryMap as l, InMemoryStorage as n, PagedQueryResponseMap as o, AbstractStorage as r, ResourceMap as s, Config as t, GetParams$1 as u }; //# sourceMappingURL=config-BqgYQFsl.d.mts.map