@shopware-pwa/helpers-next
Advanced tools
+2298
-25
@@ -1,4 +0,2286 @@ | ||
| import { Product, CalculatedPrice, Category, CmsBlock, CmsSection, SearchCriteria, Aggregations } from '@shopware-pwa/commons'; | ||
| type CalculatedTax$1 = { | ||
| tax: number; | ||
| taxRate: number; | ||
| price: number; | ||
| }; | ||
| type TaxRule$1 = { | ||
| taxRate: number; | ||
| percentage: number; | ||
| }; | ||
| type ReferencePrice = { | ||
| price: number; | ||
| }; | ||
| /** | ||
| * @public | ||
| */ | ||
| type CalculatedPrice = { | ||
| unitPrice: number; | ||
| quantity: number; | ||
| totalPrice: number; | ||
| calculatedTaxes: CalculatedTax$1[]; | ||
| taxRules: TaxRule$1[]; | ||
| referencePrice: ReferencePrice; | ||
| listPrice: { | ||
| price: number; | ||
| discount: number; | ||
| percentage: number; | ||
| apiAlias: string; | ||
| }; | ||
| }; | ||
| type MediaType = unknown; | ||
| type MediaTranslation = unknown; | ||
| type CustomFields = { | ||
| [key: string]: boolean | string | number | Date; | ||
| }; | ||
| /** | ||
| * @public | ||
| */ | ||
| type CustomField = unknown; | ||
| /** | ||
| * @public | ||
| */ | ||
| type ProductMedia = { | ||
| productId: string; | ||
| mediaId: string; | ||
| position: number; | ||
| media: Media; | ||
| product: Product; | ||
| customFields: CustomField[]; | ||
| url: string; | ||
| }; | ||
| /** | ||
| * @public | ||
| */ | ||
| type Tax = { | ||
| taxRate: number; | ||
| name: string; | ||
| products: Product[] | null; | ||
| customFields: CustomField[]; | ||
| }; | ||
| /** | ||
| * @public | ||
| */ | ||
| type UnitTranslation = { | ||
| unitId: string; | ||
| shortCode: string | null; | ||
| name: string | null; | ||
| unit: Unit | null; | ||
| customFields: CustomField[]; | ||
| }; | ||
| /** | ||
| * @public | ||
| */ | ||
| type Unit = { | ||
| shortCode: string | null; | ||
| name: string | null; | ||
| translations: UnitTranslation[] | null; | ||
| customFields: CustomField[]; | ||
| }; | ||
| /** | ||
| * @public | ||
| */ | ||
| type CountryStateTranslation = { | ||
| countryStateId: string; | ||
| name: string | null; | ||
| countryState: CountryState | null; | ||
| customFields: CustomField[]; | ||
| }; | ||
| type OrderAddress = unknown; | ||
| /** | ||
| * @public | ||
| */ | ||
| type CountryState = { | ||
| countryId: string; | ||
| shortCode: string; | ||
| name: string | null; | ||
| position: number; | ||
| active: boolean; | ||
| country: Country | null; | ||
| translations: CountryStateTranslation[] | null; | ||
| customerAddresses: CustomerAddress[] | null; | ||
| orderAddresses: OrderAddress[] | null; | ||
| customFields: CustomField[]; | ||
| }; | ||
| /** | ||
| * @public | ||
| */ | ||
| type CountryTranslation = { | ||
| countryId: string; | ||
| name: string | null; | ||
| country: Country | null; | ||
| customFields: CustomField[]; | ||
| }; | ||
| /** | ||
| * @public | ||
| */ | ||
| type Country = { | ||
| active: boolean; | ||
| createdAt: string; | ||
| customFields: object | null; | ||
| name: string | null; | ||
| iso: string | null; | ||
| translated: any; | ||
| updatedAt: string | null; | ||
| versionId: string | null; | ||
| id: string; | ||
| position: number; | ||
| taxFree: boolean; | ||
| shippingAvailable: boolean; | ||
| iso3: string | null; | ||
| displayStateInRegistration: boolean; | ||
| forceStateInRegistration: boolean; | ||
| states: CountryState[] | null; | ||
| translations: CountryTranslation[] | null; | ||
| orderAddresses: OrderAddress[] | null; | ||
| customerAddress: CustomerAddress[] | null; | ||
| salesChannelDefaultAssignments: SalesChannel[] | null; | ||
| salesChannels: SalesChannel[] | null; | ||
| }; | ||
| /** | ||
| * @public | ||
| */ | ||
| type CustomerAddress = { | ||
| customerId?: string; | ||
| countryId: string; | ||
| countryStateId?: string | null; | ||
| salutationId: string; | ||
| firstName: string; | ||
| lastName: string; | ||
| zipcode: string; | ||
| city: string; | ||
| company?: string | null; | ||
| department?: string | null; | ||
| title?: string | null; | ||
| street: string; | ||
| vatId?: string | null; | ||
| phoneNumber?: string | null; | ||
| additionalAddressLine1?: string; | ||
| additionalAddressLine2?: string; | ||
| country?: Country; | ||
| countryState?: string; | ||
| salutation: string | null; | ||
| customer?: string; | ||
| customFields?: CustomField; | ||
| id?: string; | ||
| }; | ||
| type PriceDefinitionInterface = unknown; | ||
| type OrderDeliveryPosition = unknown; | ||
| /** | ||
| * @public | ||
| */ | ||
| type OrderLineItem = { | ||
| orderId: string; | ||
| identifier: string; | ||
| referenceId: string | null; | ||
| quantity: number; | ||
| unitPrice: number; | ||
| totalPrice: number; | ||
| label: string; | ||
| description: string | null; | ||
| good: boolean; | ||
| removable: boolean; | ||
| coverId: string | null; | ||
| stackable: boolean; | ||
| price: CalculatedPrice | null; | ||
| priceDefinition: PriceDefinitionInterface | null; | ||
| payload: string[] | null; | ||
| parentId: string | null; | ||
| type: string | null; | ||
| order: Order | null; | ||
| orderDeliveryPosition: OrderDeliveryPosition[] | null; | ||
| customFields: CustomField[]; | ||
| cover: Media | null; | ||
| children: OrderLineItem[] | null; | ||
| }; | ||
| /** | ||
| * @public | ||
| */ | ||
| type StateMachineTransition = { | ||
| actionName: string; | ||
| stateMachineId: string; | ||
| stateMachine: StateMachineState | null; | ||
| fromStateId: string; | ||
| fromStateMachineState: StateMachineState | null; | ||
| toStateId: string; | ||
| toStateMachineState: StateMachineState | null; | ||
| customFields: CustomField[]; | ||
| }; | ||
| /** | ||
| * @public | ||
| */ | ||
| type StateMachineStateTranslation = { | ||
| name: string | null; | ||
| stateMachineStateId: string; | ||
| stateMachineState: StateMachineState | null; | ||
| customFields: CustomField[]; | ||
| }; | ||
| /** | ||
| * @public | ||
| */ | ||
| type ShippingAddress = CustomerAddress; | ||
| /** | ||
| * @public | ||
| */ | ||
| type BillingAddress = CustomerAddress; | ||
| type User = { | ||
| activeBillingAddress?: BillingAddress; | ||
| activeShippingAddress?: ShippingAddress; | ||
| }; | ||
| /** | ||
| * @public | ||
| */ | ||
| type StateMachineHistory = { | ||
| stateMachineId: string; | ||
| stateMachine: StateMachine | null; | ||
| entityName: string; | ||
| entityId: []; | ||
| fromStateId: string; | ||
| fromStateMachineState: StateMachineState | null; | ||
| toStateId: string; | ||
| toStateMachineState: StateMachineState | null; | ||
| userId: string; | ||
| user: User | null; | ||
| }; | ||
| /** | ||
| * @public | ||
| */ | ||
| type StateMachine = { | ||
| technicalName: string; | ||
| name: string; | ||
| transitions: StateMachineTransition[] | null; | ||
| states: StateMachineState[] | null; | ||
| initialStateId: string | null; | ||
| translations: StateMachineStateTranslation[]; | ||
| historiEntries: StateMachineHistory[] | null; | ||
| customFields: CustomField[]; | ||
| }; | ||
| /** | ||
| * @public | ||
| */ | ||
| type PluginTranslation = { | ||
| pluginId: string; | ||
| label: string | null; | ||
| description: string | null; | ||
| manufacturerLink: string | null; | ||
| supportLink: string | null; | ||
| changelog: [] | null; | ||
| plugin: Plugin | null; | ||
| customFields: CustomField[]; | ||
| }; | ||
| /** | ||
| * @public | ||
| */ | ||
| type Plugin = { | ||
| baseClass: string; | ||
| name: string; | ||
| composerName: string | null; | ||
| active: boolean; | ||
| managedByComposer: boolean; | ||
| path: string | null; | ||
| author: string | null; | ||
| copyright: string | null; | ||
| license: string | null; | ||
| version: string; | ||
| upgradeVersion: string | null; | ||
| installedAt: Date; | ||
| upgradedAt: Date; | ||
| iconRaw: string | null; | ||
| icon: string | null; | ||
| label: string; | ||
| description: string | null; | ||
| manufacturerLink: string | null; | ||
| supportLink: string | null; | ||
| changelog: [] | null; | ||
| translations: PluginTranslation[] | null; | ||
| paymentMethods: PaymentMethod[] | null; | ||
| customFields: CustomField[]; | ||
| autoload: []; | ||
| }; | ||
| /** | ||
| * @public | ||
| */ | ||
| type CustomerGroup = { | ||
| id: string; | ||
| name: string; | ||
| displayGross: boolean; | ||
| customFields: CustomField[]; | ||
| }; | ||
| /** | ||
| * Parent interface of all the interfaces for Shopware model entities. | ||
| * | ||
| * It provides the following fields: _uniqueIdentifier:string, versionId:string, translated[], createdAt:Date|null, updatedat:Date|null. | ||
| */ | ||
| /** | ||
| * @beta | ||
| */ | ||
| type Entity = { | ||
| _uniqueIdentifier: string; | ||
| versionId: string; | ||
| translated: unknown; | ||
| createdAt: Date | null; | ||
| updatedAt: Date | null; | ||
| }; | ||
| /** | ||
| * @public | ||
| */ | ||
| type DeliveryTime = { | ||
| name: string | null; | ||
| min: number; | ||
| max: number; | ||
| unit: string; | ||
| shippingMethods: ShippingMethod[] | null; | ||
| translations: Entity[]; | ||
| customFields: CustomField[]; | ||
| }; | ||
| /** | ||
| * @public | ||
| */ | ||
| type ProductPrice = { | ||
| productId: number; | ||
| quantityStart: number; | ||
| quantityEnd: number | null; | ||
| product: Product | null; | ||
| rule: Rule | null; | ||
| customFields: CustomField[]; | ||
| }; | ||
| /** | ||
| * @public | ||
| */ | ||
| type PromotionSalesChannel = { | ||
| promotionId: string; | ||
| salesChannelId: string; | ||
| priority: number; | ||
| promotion: Promotion | null; | ||
| salesChannel: SalesChannel | null; | ||
| }; | ||
| /** | ||
| * @public | ||
| */ | ||
| type PromotionIndividualCode = { | ||
| promotionId: string; | ||
| code: string; | ||
| promotion: Promotion | null; | ||
| payload: string[] | null; | ||
| }; | ||
| type PromotionSetGroup = unknown; | ||
| type PromotionTranslation = { | ||
| promotionId: string; | ||
| name: string | null; | ||
| }; | ||
| /** | ||
| * @public | ||
| */ | ||
| type Promotion = { | ||
| name: string | null; | ||
| active: boolean; | ||
| validFrom: Date; | ||
| validUntil: Date; | ||
| maxRedemptionsGlobal: number; | ||
| maxRedemptionsPerCustomer: number; | ||
| exclusive: boolean; | ||
| useCodes: boolean; | ||
| useSetGroups: boolean; | ||
| customerRestriction: boolean; | ||
| useIndividualCodes: boolean; | ||
| individualCodePattern: string; | ||
| salesChannels: PromotionSalesChannel[] | null; | ||
| code: string | null; | ||
| discounts: PromotionDiscount[] | null; | ||
| individualCodes: PromotionIndividualCode[] | null; | ||
| setgroups: PromotionSetGroup[] | null; | ||
| orderRules: Rule[] | null; | ||
| personaRules: Rule[] | null; | ||
| personaCustomers: Customer[] | null; | ||
| cartRules: TaxRule$1[]; | ||
| translations: PromotionTranslation[] | null; | ||
| orderCount: number; | ||
| ordersPerCustomerCount: [] | null; | ||
| exclusionIds: string[]; | ||
| }; | ||
| /** | ||
| * @public | ||
| */ | ||
| type PromotionDiscount = { | ||
| promotionId: string; | ||
| scope: string; | ||
| type: string; | ||
| value: number; | ||
| promotion: Promotion | null; | ||
| discountRules: Rule[] | null; | ||
| considerAdvancedRules: boolean; | ||
| maxValue: number | null; | ||
| promotionDiscountPrices: number | null; | ||
| }; | ||
| /** | ||
| * @public | ||
| */ | ||
| type RuleCondition = { | ||
| type: string; | ||
| ruleId: string; | ||
| parentId: string | null; | ||
| value: [] | null; | ||
| rule: Rule | null; | ||
| children: RuleCondition | null; | ||
| parent: RuleCondition | null; | ||
| position: number; | ||
| customFields: CustomField[]; | ||
| }; | ||
| /** | ||
| * @public | ||
| */ | ||
| type Rule = { | ||
| name: string; | ||
| description: string | null; | ||
| payload: string | Rule | null; | ||
| moduleTypes: [] | null; | ||
| productPrices: ProductPrice[]; | ||
| shippingMethods: ShippingMethod[]; | ||
| paymentMethods: PaymentMethod[]; | ||
| conditions: RuleCondition[]; | ||
| invalid: boolean; | ||
| customFields: CustomField[]; | ||
| shippingMethodPrices: ShippingMethodPrice[] | null; | ||
| promotionDiscounts: PromotionDiscount[] | null; | ||
| promotionSetGroups: PromotionSetGroup[] | null; | ||
| ShippingMethodPriceCalculations: ShippingMethodPrice[] | null; | ||
| personaPromotions: Promotion[] | null; | ||
| orderPromotions: Promotion[] | null; | ||
| cartPromotions: Promotion[] | null; | ||
| }; | ||
| /** | ||
| * @public | ||
| */ | ||
| type ShippingMethodPrice = { | ||
| shippingMethodId: string; | ||
| currencyId: string; | ||
| calculation: number | null; | ||
| quantityStart: number | null; | ||
| quantityEnd: number | null; | ||
| price: number; | ||
| shippingMethod: ShippingMethodPrice | null; | ||
| customFields: CustomField[]; | ||
| rule: Rule | null; | ||
| currency: Currency | null; | ||
| calculationRuleId: string | null; | ||
| }; | ||
| /** | ||
| * @public | ||
| */ | ||
| type OrderDelivery = { | ||
| orderId: string; | ||
| shippingOrderAddressId: string; | ||
| shippingMethodId: string; | ||
| trackingCode: string | null; | ||
| shippingDateEarliest: Date; | ||
| shippingDateLatest: Date; | ||
| shippingCosts: CalculatedPrice; | ||
| shippingOrderAddress: OrderAddress | null; | ||
| stateId: string; | ||
| stateMachineState: StateMachineState | null; | ||
| shippingMethod: ShippingMethodPrice | null; | ||
| order: Order | null; | ||
| positions: OrderDeliveryPosition[] | null; | ||
| }; | ||
| /** | ||
| * @public | ||
| */ | ||
| type LocaleTranslation = { | ||
| localeId: string; | ||
| name: string | null; | ||
| territory: string | null; | ||
| locale: Locale | null; | ||
| customFields: CustomField | null; | ||
| }; | ||
| /** | ||
| * @public | ||
| */ | ||
| type Locale = { | ||
| code: string; | ||
| name: string | null; | ||
| territory: string | null; | ||
| translations: LocaleTranslation[] | null; | ||
| users: User[] | null; | ||
| languages: Language[] | null; | ||
| customFields: CustomField | null; | ||
| }; | ||
| type CategoryTranslation = unknown; | ||
| /** | ||
| * @public | ||
| */ | ||
| type CustomerGroupTranslation = { | ||
| customerGroupId: string; | ||
| name: string | null; | ||
| customerGroup: CustomerGroup | null; | ||
| customFields: CustomField[]; | ||
| }; | ||
| /** | ||
| * @public | ||
| */ | ||
| type PaymentMethodTranslation = { | ||
| paymentMethodId: string; | ||
| name: string | null; | ||
| description: string | null; | ||
| paymentMethod: PaymentMethod | null; | ||
| customFields: CustomField[]; | ||
| }; | ||
| /** | ||
| * @public | ||
| */ | ||
| type ProductManufacturer = { | ||
| mediaId: string | null; | ||
| name: string | null; | ||
| link: string | null; | ||
| description: string | null; | ||
| translations: ProductManufacturerTranslation | null; | ||
| products: Product[]; | ||
| customFields: CustomField[]; | ||
| }; | ||
| /** | ||
| * @public | ||
| */ | ||
| type ProductManufacturerTranslation = { | ||
| productManufacturerId: number; | ||
| name: string | null; | ||
| description: string | null; | ||
| productManufacturer: ProductManufacturer | null; | ||
| customFields: CustomField[]; | ||
| }; | ||
| /** | ||
| * @public | ||
| */ | ||
| type ProductTranslation = { | ||
| productId: string; | ||
| additionalText: string | null; | ||
| name: string | null; | ||
| keywords: string | null; | ||
| description: string | null; | ||
| metaTitle: string | null; | ||
| packUnit: string | null; | ||
| product: Product; | ||
| customFields: CustomField | null; | ||
| }; | ||
| /** | ||
| * @public | ||
| */ | ||
| type ShippingMethodTranslation = { | ||
| shippingMethodId: string; | ||
| name: string | null; | ||
| description: string | null; | ||
| shippingMethod: ShippingMethod | null; | ||
| customFields: CustomField[]; | ||
| }; | ||
| /** | ||
| * @public | ||
| */ | ||
| type PropertyGroupTranslation = { | ||
| shippingMethodId: string; | ||
| name: string | null; | ||
| description: string | null; | ||
| shippingMethod: ShippingMethod | null; | ||
| customFields: CustomField[]; | ||
| }; | ||
| /** | ||
| * @public | ||
| */ | ||
| type ProductStreamFilter = { | ||
| type: string; | ||
| field: string | null; | ||
| operator: string | null; | ||
| value: string | null; | ||
| productStreamId: string; | ||
| parentId: string | null; | ||
| productStream: ProductStream | null; | ||
| queries: ProductStreamFilter[] | null; | ||
| parent: ProductStreamFilter | null; | ||
| position: number; | ||
| parameters: [] | null; | ||
| customFields: CustomField[]; | ||
| }; | ||
| /** | ||
| * @public | ||
| */ | ||
| type ProductStream = { | ||
| name: string; | ||
| description: string | null; | ||
| apiFilter: [] | null; | ||
| filters: ProductStreamFilter[] | null; | ||
| invalid: boolean; | ||
| translations: ProductStreamTranslation[] | null; | ||
| customFields: CustomField[]; | ||
| }; | ||
| /** | ||
| * @public | ||
| */ | ||
| type ProductStreamTranslation = { | ||
| productStreamId: string; | ||
| name: string | null; | ||
| description: string | null; | ||
| productStream: ProductStream | null; | ||
| customFields: CustomField; | ||
| }; | ||
| type MailTemplateMedia = unknown; | ||
| /** | ||
| * @public | ||
| */ | ||
| type MailTemplateTypeTranslation = { | ||
| mailTemplateTypeId: string; | ||
| mailTemplateType: MailTemplateType | null; | ||
| name: string | null; | ||
| }; | ||
| /** | ||
| * @public | ||
| */ | ||
| type MailTemplateType = { | ||
| name: string; | ||
| technicalName: string; | ||
| availableEntities: [] | null; | ||
| translations: MailTemplateTypeTranslation[] | null; | ||
| mailTemplates: MailTemplateType[] | null; | ||
| customFields: CustomField[]; | ||
| salesChannels: MailTemplateSalesChannel[] | null; | ||
| createdAt: Date; | ||
| updatedAt: Date; | ||
| }; | ||
| /** | ||
| * @public | ||
| */ | ||
| type MailTemplateSalesChannel = { | ||
| mailTemplateId: string; | ||
| salesChannelId: string | null; | ||
| mailTemplateTypeId: string; | ||
| mailTemplateType: MailTemplateType | null; | ||
| mailTemplate: MailTemplateSalesChannel | null; | ||
| salesChannel: SalesChannel | null; | ||
| }; | ||
| /** | ||
| * @public | ||
| */ | ||
| type MailTemplateTranslation = { | ||
| mailTemplateId: string; | ||
| senderName: string | null; | ||
| description: string | null; | ||
| subject: string | null; | ||
| contentHtml: string | null; | ||
| contentPlain: string | null; | ||
| mailTemplate: MailTemplate | null; | ||
| }; | ||
| /** | ||
| * @public | ||
| */ | ||
| type MailTemplate = { | ||
| mailTemplateTypeId: string | null; | ||
| mailTemplateType: MailTemplateType | null; | ||
| systemDefault: boolean; | ||
| senderName: string | null; | ||
| description: string | null; | ||
| subject: string | null; | ||
| contentHtml: string | null; | ||
| contentPlain: string | null; | ||
| salesChannels: MailTemplateSalesChannel[] | null; | ||
| translations: MailTemplateTranslation[] | null; | ||
| media: MailTemplateMedia[] | null; | ||
| }; | ||
| /** | ||
| * @public | ||
| */ | ||
| type MailHeaderFooterTranslation = { | ||
| name: string | null; | ||
| description: string | null; | ||
| headerHtml: string | null; | ||
| headerPlain: string | null; | ||
| footerHtml: string | null; | ||
| footerPlain: string | null; | ||
| mailHeaderFooter: MailHeaderFooter | null; | ||
| mailHeaderFooterId: string; | ||
| }; | ||
| /** | ||
| * @public | ||
| */ | ||
| type MailHeaderFooter = { | ||
| name: string | null; | ||
| systemDefault: boolean; | ||
| description: string | null; | ||
| headerHtml: string | null; | ||
| headerPlain: string | null; | ||
| footerHtml: string | null; | ||
| footerPlain: string | null; | ||
| salesChannels: SalesChannel[] | null; | ||
| translations: MailHeaderFooterTranslation[] | null; | ||
| }; | ||
| /** | ||
| * @public | ||
| */ | ||
| type DocumentTypeTranslation = { | ||
| documentTypeId: string; | ||
| documentType: DocumentType | null; | ||
| name: string | null; | ||
| customFields: CustomField[]; | ||
| }; | ||
| /** | ||
| * @public | ||
| */ | ||
| type ProductSearchKeyword = { | ||
| languageId: string; | ||
| productId: string; | ||
| keyword: string; | ||
| ranking: number; | ||
| product: Product | null; | ||
| language: Language | null; | ||
| }; | ||
| /** | ||
| * @public | ||
| */ | ||
| type ProductKeywordDictionary = { | ||
| id: string; | ||
| languageId: string; | ||
| keyword: string; | ||
| reserved: string; | ||
| language: Language | null; | ||
| }; | ||
| /** | ||
| * @public | ||
| */ | ||
| type NumberRangeSalesChannel = { | ||
| numberRangeId: string; | ||
| salesChannelId: string; | ||
| numberRange: NumberRange | null; | ||
| salesChannel: SalesChannel | null; | ||
| numberRangeType: NumberRangeType | null; | ||
| }; | ||
| /** | ||
| * @public | ||
| */ | ||
| type NumberRangeTypeTranslation = { | ||
| numberRangeTypeId: string; | ||
| typeName: string | null; | ||
| numberRangeType: NumberRangeType | null; | ||
| customFields: CustomField[]; | ||
| }; | ||
| /** | ||
| * @public | ||
| */ | ||
| type NumberRangeType = { | ||
| typeName: string; | ||
| technicalName: string; | ||
| global: boolean; | ||
| numberRanges: NumberRange[] | null; | ||
| numberRangeSalesChannels: NumberRangeSalesChannel | null; | ||
| customFields: CustomField[]; | ||
| translations: NumberRangeTypeTranslation[] | null; | ||
| }; | ||
| /** | ||
| * @public | ||
| */ | ||
| type NumberRangeState = { | ||
| numberRangeId: string; | ||
| lastValue: number; | ||
| numberRange: NumberRange | null; | ||
| }; | ||
| /** | ||
| * @public | ||
| */ | ||
| type NumberRange = { | ||
| typeId: string | null; | ||
| global: boolean; | ||
| name: string | null; | ||
| description: string | null; | ||
| pattern: string | null; | ||
| start: number | null; | ||
| type: NumberRangeType | null; | ||
| numberRangeSalesChannels: NumberRangeSalesChannel[] | null; | ||
| state: NumberRangeState | null; | ||
| customFields: CustomField[]; | ||
| translations: NumberRangeTranslation[] | null; | ||
| }; | ||
| /** | ||
| * @public | ||
| */ | ||
| type NumberRangeTranslation = { | ||
| numberRangeId: string; | ||
| name: string | null; | ||
| description: string | null; | ||
| numberRange: NumberRange | null; | ||
| customFields: CustomField[]; | ||
| }; | ||
| /** | ||
| * @public | ||
| */ | ||
| type PropertyGroup = { | ||
| name: string; | ||
| displayType: string; | ||
| sortingType: string; | ||
| description: string | null; | ||
| options: PropertyGroupOption[] | null; | ||
| translations: PropertyGroupOptionTranslation[] | null; | ||
| customFields: CustomField[]; | ||
| translated: { | ||
| [key: string]: unknown; | ||
| }; | ||
| }; | ||
| /** | ||
| * @public | ||
| */ | ||
| type ProductConfiguratorSetting = { | ||
| productId: number; | ||
| optionId: number; | ||
| mediaId: number; | ||
| position: number; | ||
| price: [] | null; | ||
| option: PropertyGroupOption | null; | ||
| media: Media | null; | ||
| selected: boolean; | ||
| product: Product | null; | ||
| customFields: CustomField[]; | ||
| }; | ||
| /** | ||
| * @public | ||
| */ | ||
| type PropertyGroupOption = { | ||
| id: string; | ||
| groupId: string; | ||
| name: string | null; | ||
| position: number; | ||
| colorHexCode: string | null; | ||
| mediaId: string | null; | ||
| group: PropertyGroup; | ||
| translations: PropertyGroupOptionTranslation[] | null; | ||
| productConfiguratorSettings: ProductConfiguratorSetting[] | null; | ||
| productProperties: Product[] | null; | ||
| productOptions: Product[] | null; | ||
| media: Media | null; | ||
| customFields: CustomField[]; | ||
| translated: { | ||
| [key: string]: unknown; | ||
| }; | ||
| }; | ||
| /** | ||
| * @public | ||
| */ | ||
| type PropertyGroupOptionTranslation = { | ||
| propertyGroupOptionId: string; | ||
| name: string | null; | ||
| position: number | null; | ||
| propertyGroupOption: PropertyGroupOption | null; | ||
| customFields: CustomField[]; | ||
| }; | ||
| /** | ||
| * @public | ||
| */ | ||
| type SalesChannelTranslation = { | ||
| salesChannelId: string; | ||
| name: string | null; | ||
| salesChannel: SalesChannel | null; | ||
| customFields: CustomField[]; | ||
| }; | ||
| /** | ||
| * @public | ||
| */ | ||
| type SalesChannelType = { | ||
| name: string | null; | ||
| manufacturer: string | null; | ||
| description: string | null; | ||
| descriptionLong: string | null; | ||
| coverUrl: string | null; | ||
| iconName: string | null; | ||
| screenshotUrls: [] | null; | ||
| salesChannels: SalesChannel[] | null; | ||
| translations: SalesChannelTypeTranslation[] | null; | ||
| customFields: CustomField[]; | ||
| }; | ||
| /** | ||
| * @public | ||
| */ | ||
| type SalesChannelTypeTranslation = { | ||
| salesChannelTypeId: string; | ||
| name: string | null; | ||
| manufacturer: string | null; | ||
| description: string | null; | ||
| descriptionLong: string | null; | ||
| salesChannelType: SalesChannelType | null; | ||
| customFields: CustomField[]; | ||
| }; | ||
| /** | ||
| * @public | ||
| */ | ||
| type Snippet = { | ||
| setId: string; | ||
| translationKey: string; | ||
| value: string; | ||
| author: string; | ||
| set: SnippetSet | null; | ||
| customFields: CustomField | null; | ||
| }; | ||
| /** | ||
| * @public | ||
| */ | ||
| type SnippetSet = { | ||
| name: string; | ||
| baseFile: string; | ||
| iso: string; | ||
| snippets: Snippet[] | null; | ||
| salesChannelDomains: SalesChannelDomain[] | null; | ||
| customFields: CustomField | null; | ||
| }; | ||
| /** | ||
| * @public | ||
| */ | ||
| type SalesChannelDomain = { | ||
| url: string; | ||
| currencyId: string | null; | ||
| currency: Currency | null; | ||
| snippetSetId: string | null; | ||
| snippetSet: SnippetSet | null; | ||
| salesChannelId: string; | ||
| salesChannel: SalesChannel | null; | ||
| languageId: string; | ||
| language: Language | null; | ||
| customFields: CustomField[]; | ||
| }; | ||
| /** | ||
| * Interface that is being used for just a few fields in Shopware models. It contains elements[] only. | ||
| */ | ||
| /** | ||
| * @public | ||
| */ | ||
| type Collection = { | ||
| elements: []; | ||
| }; | ||
| /** | ||
| * @public | ||
| */ | ||
| type Language = { | ||
| parentId: string | null; | ||
| localeId: string; | ||
| translationCodeId: string | null; | ||
| translationCode: Locale | null; | ||
| name: string; | ||
| locale: Locale | null; | ||
| parent: Language | null; | ||
| children: Language[] | null; | ||
| salesChannels: SalesChannel[] | null; | ||
| customers: Customer[] | null; | ||
| salesChannelDefaultAssignments: SalesChannel[] | null; | ||
| customFields: CustomField[]; | ||
| categoryTranslations: CategoryTranslation[] | null; | ||
| countryStateTranslations: CountryStateTranslation[] | null; | ||
| countryTranslations: CategoryTranslation[] | null; | ||
| currencyTranslations: CurrencyTranslation[] | null; | ||
| customerGroupTranslations: CustomerGroupTranslation[] | null; | ||
| localeTranslations: LocaleTranslation[] | null; | ||
| mediaTranslations: MediaTranslation[] | null; | ||
| paymentMethodTranslations: PaymentMethodTranslation[] | null; | ||
| productManufacturerTranslations: ProductManufacturerTranslation[] | null; | ||
| productTranslations: ProductTranslation[] | null; | ||
| shippingMethodTranslations: ShippingMethodTranslation[] | null; | ||
| unitTranslations: UnitTranslation[] | null; | ||
| propertyGroupTranslations: PropertyGroupTranslation[] | null; | ||
| propertyGroupOptionTranslations: PropertyGroupOptionTranslation[] | null; | ||
| salesChannelTranslations: SalesChannelTranslation[] | null; | ||
| salesChannelTypeTranslations: SalesChannelTypeTranslation[] | null; | ||
| salutationTranslations: SalutationTranslation[] | null; | ||
| salesChannelDomains: SalesChannelDomain[] | null; | ||
| pluginTranslations: PluginTranslation[] | null; | ||
| productStreamTranslations: ProductStreamTranslation[] | null; | ||
| stateMachineTranslations: Collection[] | null; | ||
| stateMachineStateTranslations: Collection[] | null; | ||
| cmsPageTranslations: Collection[] | null; | ||
| cmsSlotTranslations: Collection[] | null; | ||
| mailTemplateTranslations: MailTemplate[] | null; | ||
| mailHeaderFooterTranslation: MailHeaderFooter[] | null; | ||
| documentTypeTranslations: DocumentTypeTranslation[] | null; | ||
| deliveryTimeTranslations: DeliveryTime[] | null; | ||
| newsletterRecipients: NewsletterRecipient[] | null; | ||
| orders: Order[] | null; | ||
| numberRangeTypeTranslations: NumberRangeTypeTranslation[] | null; | ||
| productSearchKeywords: ProductSearchKeyword[] | null; | ||
| productKeywordDictionaries: ProductKeywordDictionary[] | null; | ||
| mailTemplateTypeTranslations: MailTemplateTypeTranslation[] | null; | ||
| promotionTranslations: PromotionTranslation[] | null; | ||
| numberRangeTranslations: NumberRangeTranslation[] | null; | ||
| productReviews: ProductReview[] | null; | ||
| }; | ||
| /** | ||
| * @public | ||
| */ | ||
| type NewsletterRecipient = { | ||
| email: string; | ||
| title: string | null; | ||
| firstName: string | null; | ||
| lastName: string | null; | ||
| zipCode: string | null; | ||
| city: string | null; | ||
| street: string | null; | ||
| status: string | null; | ||
| hash: string; | ||
| salutationId: string | null; | ||
| salutation: Salutation | null; | ||
| languageId: string; | ||
| language: Language | null; | ||
| salesChannelId: string; | ||
| salesChannel: SalesChannel | null; | ||
| customFields: CustomField[]; | ||
| confirmedAt: Date | null; | ||
| createdAt: Date; | ||
| updatedAt: Date | null; | ||
| tags: Tag[] | null; | ||
| }; | ||
| /** | ||
| * @public | ||
| */ | ||
| type Tag = { | ||
| name: string; | ||
| products: Product[] | null; | ||
| media: Media[] | null; | ||
| categories: Category[] | null; | ||
| orders: Order[] | null; | ||
| shippingMethods: ShippingMethod[] | null; | ||
| newsletterRecipients: NewsletterRecipient[] | null; | ||
| }; | ||
| /** | ||
| * @public | ||
| */ | ||
| type ShippingMethod = { | ||
| id: string; | ||
| name: string | null; | ||
| active: boolean; | ||
| description: string | null; | ||
| deliveryTimeId: string; | ||
| deliveryTime: DeliveryTime | null; | ||
| translations: ShippingMethodTranslation[] | null; | ||
| orderDeliveries: OrderDelivery[] | null; | ||
| salesChannelDefaultAssignments: SalesChannel[] | null; | ||
| salesChannels: SalesChannel[] | null; | ||
| customFields: CustomField[]; | ||
| availabilityRule: Rule | null; | ||
| availabilityRuleId: string; | ||
| prices: ShippingMethodPrice[]; | ||
| mediaId: string | null; | ||
| media: Media | null; | ||
| tags: Tag[] | null; | ||
| }; | ||
| /** | ||
| * @public | ||
| */ | ||
| type SalutationTranslation = { | ||
| shippingMethodId: string; | ||
| name: string | null; | ||
| description: string | null; | ||
| shippingMethod: ShippingMethod | null; | ||
| }; | ||
| /** | ||
| * @public | ||
| */ | ||
| type Salutation = { | ||
| salutationKey: string; | ||
| id: string; | ||
| displayName: string | null; | ||
| letterName: string | null; | ||
| createdAt: string; | ||
| translations: SalutationTranslation[] | null; | ||
| translated: object; | ||
| updatedAt: string | null; | ||
| extenstions: object; | ||
| }; | ||
| /** | ||
| * @public | ||
| */ | ||
| type OrderCustomer$1 = { | ||
| email: string; | ||
| orderId: string; | ||
| salutationId: string; | ||
| firstName: string; | ||
| lastName: string; | ||
| title: string | null; | ||
| company: string | null; | ||
| customerNumber: string | null; | ||
| customerId: string; | ||
| customer: Customer | null; | ||
| salutation: Salutation | null; | ||
| order: Order | null; | ||
| }; | ||
| /** | ||
| * @beta | ||
| */ | ||
| type Customer = { | ||
| id: string; | ||
| groupId: string; | ||
| defaultPaymentMethodId: string; | ||
| salesChannelId: string; | ||
| languageId: string; | ||
| lastPaymentMethodId: string | null; | ||
| defaultBillingAddressId: string | null; | ||
| defaultShippingAddressId: string | null; | ||
| customerNumber: number; | ||
| salutationId: string | null; | ||
| firstName: string; | ||
| lastName: string; | ||
| company: string | null; | ||
| email: string; | ||
| title: string | null; | ||
| active: boolean; | ||
| guest: boolean; | ||
| firstLogin: Date | null; | ||
| lastLogin: Date | null; | ||
| newsletter: boolean; | ||
| birthday: Date; | ||
| lastOrderDate: Date; | ||
| orderCount: number; | ||
| createdAt: Date; | ||
| updatedAt: Date; | ||
| group: CustomerGroup; | ||
| defaultPaymentMethod: PaymentMethod; | ||
| defaultBillingAddress: BillingAddress; | ||
| defaultShippingAddress: ShippingAddress; | ||
| activeBillingAddress: BillingAddress; | ||
| activeShippingAddress: ShippingAddress; | ||
| addresses: Array<CustomerAddress>; | ||
| orderCustomers: Array<OrderCustomer$1> | null; | ||
| autoIncrement: number; | ||
| tags: Tag[] | null; | ||
| promotions: Promotion[] | null; | ||
| customFields: CustomField[]; | ||
| productReviews: ProductReview[]; | ||
| doubleOptInConfirmDate: null | string; | ||
| doubleOptInEmailSentDate: string; | ||
| doubleOptInRegistration: boolean; | ||
| }; | ||
| /** | ||
| * @beta | ||
| */ | ||
| type PaymentMethod = { | ||
| id: string; | ||
| pluginId: string | null; | ||
| handlerIdentifier: string; | ||
| name: string | null; | ||
| description: string | null; | ||
| position: number; | ||
| active: boolean; | ||
| plugin: Plugin | null; | ||
| translations: PaymentMethodTranslation[] | null; | ||
| orderTransactions: OrderTransaction[] | null; | ||
| customers: Customer[] | null; | ||
| salesChannelDefaultAssignments: SalesChannel[] | null; | ||
| availabilityRule: Rule | null; | ||
| availabilityRuleId: string; | ||
| mediaId: string | null; | ||
| media: Media | null; | ||
| customFields: CustomField[]; | ||
| formattedHandlerIDentifier: string; | ||
| }; | ||
| /** | ||
| * @public | ||
| */ | ||
| type OrderTransaction = { | ||
| orderId: string; | ||
| paymentMethodId: string; | ||
| amount: CalculatedPrice; | ||
| paymentMethod: PaymentMethod | null; | ||
| order: Order | null; | ||
| stateMachineState: StateMachineState | null; | ||
| stateId: string; | ||
| customFields: CustomField[]; | ||
| }; | ||
| /** | ||
| * @public | ||
| */ | ||
| type StateMachineState = { | ||
| name: string; | ||
| technicalName: string; | ||
| stateMachine: StateMachine | null; | ||
| fromStateMachineTransitions: StateMachineTransition[] | null; | ||
| toStateMachineTransitions: StateMachineTransition[] | null; | ||
| translations: StateMachineStateTranslation[]; | ||
| orders: Order[] | null; | ||
| orderTransactions: OrderTransaction[] | null; | ||
| orderDeliveries: OrderDelivery[] | null; | ||
| fromStateMachineHistoryEntries: StateMachineHistory[] | null; | ||
| toStateMachineHistoryEntries: StateMachineHistory[] | null; | ||
| customFields: CustomField[]; | ||
| }; | ||
| /** | ||
| * @public | ||
| */ | ||
| type Delivery = { | ||
| apiAlias: string; | ||
| createdAt: string; | ||
| customFields: unknown | null; | ||
| extensions: unknown; | ||
| id: string; | ||
| orderId: string; | ||
| orderVersionId: string; | ||
| positions: unknown | null; | ||
| shippingCosts: { | ||
| unitPrice: number; | ||
| quantity: number; | ||
| listPrice: number | null; | ||
| apiAlias: string; | ||
| }; | ||
| shippingDateEarliest: string; | ||
| shippingDateLatest: string; | ||
| shippingMethod: ShippingMethod; | ||
| shippingMethodId: string; | ||
| shippingOrderAddress: ShippingAddress; | ||
| shippingOrderAddressId: string; | ||
| shippingOrderAddressVersionId: string; | ||
| stateId: string; | ||
| stateMachineState: StateMachineState; | ||
| trackingCodes: unknown[]; | ||
| translated: unknown[]; | ||
| updatedAt: string | null; | ||
| versionId: string; | ||
| _uniqueIdentifier: string; | ||
| }; | ||
| interface CalculatedTax { | ||
| tax: number; | ||
| taxRate: number; | ||
| price: number; | ||
| extensions: any[]; | ||
| } | ||
| interface TaxRule { | ||
| taxRate: number; | ||
| percentage: number; | ||
| extensions: any[]; | ||
| } | ||
| interface Price$1 { | ||
| netPrice: number; | ||
| totalPrice: number; | ||
| calculatedTaxes: CalculatedTax[]; | ||
| taxRules: TaxRule[]; | ||
| positionPrice: number; | ||
| taxStatus: string; | ||
| extensions: any[]; | ||
| } | ||
| interface ShippingCost { | ||
| unitPrice: number; | ||
| quantity: number; | ||
| calculatedTaxes: CalculatedTax[]; | ||
| taxRules: TaxRule[]; | ||
| referencePrice: number | null; | ||
| listPrice: number | null; | ||
| extensions: any[]; | ||
| } | ||
| interface OrderCustomer { | ||
| email: string; | ||
| orderId: string; | ||
| salutationId: string; | ||
| firstName: string; | ||
| lastName: string; | ||
| title: null; | ||
| company: null; | ||
| customerNumber: number; | ||
| customerId: string; | ||
| customer: null; | ||
| salutation: null; | ||
| order: null; | ||
| customFields: null; | ||
| remoteAddress: string; | ||
| _uniqueIdentifier: string; | ||
| versionId: string; | ||
| translated: []; | ||
| createdAt: Date; | ||
| updatedAt: null; | ||
| extensions: unknown; | ||
| id: string; | ||
| orderVersionId: string; | ||
| } | ||
| type Order = { | ||
| orderNumber: number; | ||
| currencyId: string; | ||
| currencyFactor: number; | ||
| salesChannelId: string; | ||
| billingAddressId: string; | ||
| orderDateTime: Date; | ||
| orderDate: Date; | ||
| price: Price$1; | ||
| amountTotal: number; | ||
| amountNet: number; | ||
| positionPrice: number; | ||
| taxStatus: string; | ||
| shippingCosts: ShippingCost; | ||
| shippingTotal: number; | ||
| orderCustomer: OrderCustomer; | ||
| currency: Currency | null; | ||
| languageId: string; | ||
| language: Language | null; | ||
| salesChannel: SalesChannel | null; | ||
| addresses: CustomerAddress[]; | ||
| deliveries: Delivery[]; | ||
| lineItems: OrderLineItem[] | null; | ||
| transactions: OrderTransaction[] | null; | ||
| deepLinkCode: string; | ||
| stateMachineState: StateMachineState; | ||
| stateId: string; | ||
| customFields: CustomFields; | ||
| documents: null; | ||
| tags: Tag[] | null; | ||
| affiliateCode: string | null; | ||
| campaignCode: string | null; | ||
| _uniqueIdentifier: string; | ||
| versionId: string; | ||
| translated: any[]; | ||
| createdAt: Date; | ||
| updatedAt: Date | null; | ||
| extensions: unknown; | ||
| id: string; | ||
| billingAddressVersionId: string; | ||
| }; | ||
| /** | ||
| * @public | ||
| */ | ||
| type PromotionDiscountPrice = { | ||
| currencyId: string; | ||
| discountId: string; | ||
| price: number; | ||
| promotionDiscount: PromotionDiscount; | ||
| currency: Currency; | ||
| }; | ||
| /** | ||
| * @public | ||
| */ | ||
| type Currency = { | ||
| id: string; | ||
| isoCode: string; | ||
| factor: number; | ||
| symbol: string; | ||
| shortName: string | null; | ||
| name: string | null; | ||
| position: number; | ||
| decimalPrecision: number; | ||
| translations: CurrencyTranslation[] | null; | ||
| orders: Order[] | null; | ||
| salesChannels: SalesChannel[] | null; | ||
| salesChannelDefaultAssignments: SalesChannel[] | null; | ||
| salesChannelDomains: SalesChannelDomain[] | null; | ||
| customFields: CustomField[]; | ||
| shippingMethodPrices: ShippingMethodPrice[] | null; | ||
| promotionDiscountPrices: PromotionDiscountPrice[]; | ||
| isSystemDefault: boolean | null; | ||
| }; | ||
| /** | ||
| * @public | ||
| */ | ||
| type CurrencyTranslation = { | ||
| currencyId: string; | ||
| shortName: string | null; | ||
| name: string | null; | ||
| currency: Currency | null; | ||
| customFields: CustomField[]; | ||
| }; | ||
| /** | ||
| * @public | ||
| */ | ||
| type ProductVisibility = { | ||
| visibility: number; | ||
| productId: string; | ||
| salesChannelId: string; | ||
| product: Product | null; | ||
| salesChannel: SalesChannel | null; | ||
| }; | ||
| type DocumentBaseConfigDefinition = unknown; | ||
| /** | ||
| * @public | ||
| */ | ||
| type SystemConfig = { | ||
| configurationKey: string; | ||
| configurationValue: unknown; | ||
| salesChannelId: string | null; | ||
| salesChannel: SalesChannel | null; | ||
| }; | ||
| /** | ||
| * @public | ||
| */ | ||
| type SalesChannel = { | ||
| typeId: string; | ||
| languageId: string; | ||
| currencyId: string; | ||
| paymentMethodId: string; | ||
| shippingMethodId: string; | ||
| countryId: string; | ||
| navigationCategoryId: string; | ||
| footerCategoryId: string | null; | ||
| serviceCategoryId: string | null; | ||
| name: string | null; | ||
| shortName: string | null; | ||
| accessKey: string; | ||
| currencies: CurrencyTranslation[] | null; | ||
| languages: Language[] | null; | ||
| configuration: [] | null; | ||
| active: boolean; | ||
| type: SalesChannelType | null; | ||
| currency: Currency | null; | ||
| language: Language | null; | ||
| paymentMethod: PaymentMethod | null; | ||
| shippingMethod: ShippingMethodPrice | null; | ||
| country: Country | null; | ||
| orders: Order[] | null; | ||
| customers: Customer[] | null; | ||
| countries: Country[] | null; | ||
| paymentMethods: PaymentMethod[] | null; | ||
| shippingMethods: ShippingMethod[] | null; | ||
| translations: SalesChannelTranslation[] | null; | ||
| domains: SalesChannelDomain[] | null; | ||
| systemConfigs: SystemConfig[] | null; | ||
| customFields: CustomField[]; | ||
| naigationCategory: Category | null; | ||
| footerCategory: Category | null; | ||
| serviceCategory: Category | null; | ||
| productVisibilities: ProductVisibility[] | null; | ||
| mailTemplates: MailTemplateSalesChannel[] | null; | ||
| mailHeaderFooterId: string | null; | ||
| numberRangeSalesChannels: NumberRangeSalesChannel[] | null; | ||
| mailHeaderFooter: MailHeaderFooter | null; | ||
| customerGroupId: string | null; | ||
| customerGroup: CustomerGroup | null; | ||
| newsletterRecipients: NewsletterRecipient[] | null; | ||
| promotionSalesChannels: PromotionSalesChannel[] | null; | ||
| documentBaseConfigSalesChannels: DocumentBaseConfigDefinition | null; | ||
| productReviews: ProductReview[] | null; | ||
| }; | ||
| /** | ||
| * @public | ||
| */ | ||
| type ProductReview = { | ||
| id: string; | ||
| productId: string; | ||
| customerId: string; | ||
| salesChannelId: string; | ||
| languageId: string; | ||
| externalUser: string | null; | ||
| externalEmail: string | null; | ||
| points: number | null; | ||
| status: boolean; | ||
| comment: string | null; | ||
| salesChannel: SalesChannel | null; | ||
| language: Language | null; | ||
| customer: Customer | null; | ||
| product: Product | null; | ||
| content: string | null; | ||
| title: string | null; | ||
| createdAt: Date; | ||
| }; | ||
| type ListingPrice = { | ||
| from: unknown; | ||
| to: unknown; | ||
| extensions: any[]; | ||
| }; | ||
| type Price = { | ||
| currencyId: number; | ||
| net: number; | ||
| gross: number; | ||
| linked: boolean; | ||
| }; | ||
| /** | ||
| * @public | ||
| */ | ||
| type SeoUrl = { | ||
| salesChannelId: string; | ||
| languageId: string; | ||
| routeName: string; | ||
| foreignKey: string; | ||
| pathInfo: string; | ||
| seoPathInfo: string; | ||
| isCanonical: boolean; | ||
| isModified: boolean; | ||
| isDeleted: boolean; | ||
| isValid: null | boolean; | ||
| language: null | boolean; | ||
| url: null | string; | ||
| customFields: null | any; | ||
| error: null | any; | ||
| _uniqueIdentifier: string; | ||
| versionId: null | string; | ||
| translated: []; | ||
| createdAt: Date; | ||
| updatedAt: null | Date; | ||
| extensions: unknown; | ||
| id: string; | ||
| apiAlias: string; | ||
| }; | ||
| type CrossSelling = { | ||
| name: String; | ||
| position: number; | ||
| sortBy: string; | ||
| sortDirection: string; | ||
| limit: number; | ||
| active: boolean; | ||
| productId: string; | ||
| product: null | Product; | ||
| productStreamId: null | string; | ||
| type: string; | ||
| assignedProducts: Product[]; | ||
| translations: unknown; | ||
| _uniqueIdentifier: string; | ||
| versionId: null | string; | ||
| translated: unknown; | ||
| createdAt: Date; | ||
| updatedAt: null | Date; | ||
| extensions: unknown; | ||
| id: string; | ||
| productVersionId: string; | ||
| apiAlias: string; | ||
| }; | ||
| /** | ||
| * @public | ||
| */ | ||
| type Product = { | ||
| calculatedCheapestPrice: CalculatedPrice; | ||
| calculatedListingPrice: ListingPrice; | ||
| calculatedPrices: CalculatedPrice[]; | ||
| calculatedPrice: CalculatedPrice; | ||
| sortedProperties: PropertyGroup[] | null; | ||
| isNew: boolean; | ||
| parentId: string | null; | ||
| childCount: number; | ||
| autoIncrement: number; | ||
| taxId: string | null; | ||
| manufacturerId: string | null; | ||
| unitId: string | null; | ||
| active: boolean; | ||
| displayGroup: string; | ||
| price: Price[] | null; | ||
| manufacturerNumber: string | null; | ||
| ean: string | null; | ||
| productNumber: string; | ||
| stock: number; | ||
| availableStock: number | null; | ||
| available: boolean; | ||
| deliveryTimeId: string | null; | ||
| deliveryTime: DeliveryTime; | ||
| restockTime: number; | ||
| isCloseout: boolean | null; | ||
| purchaseSteps: number | null; | ||
| maxPurchase: number | null; | ||
| minPurchase: number | null; | ||
| purchaseUnit: number | null; | ||
| referenceUnit: number | null; | ||
| shippingFree: boolean | null; | ||
| purchasePrice: number | null; | ||
| markAsTopseller: boolean | null; | ||
| weight: number | null; | ||
| width: number | null; | ||
| height: number | null; | ||
| length: number | null; | ||
| releaseDate: Date; | ||
| categoryTree: [] | null; | ||
| optionIds?: string[]; | ||
| propertyIds: [] | null; | ||
| additionalText?: string | null; | ||
| name: string | null; | ||
| keywords: string | null; | ||
| description: string | null; | ||
| metaTitle: string | null; | ||
| packUnit: string | null; | ||
| tax: Tax; | ||
| manufacturer: ProductManufacturer | null; | ||
| unit: Unit | null; | ||
| prices: ProductPrice[]; | ||
| listingPrices: ListingPrice[] | null; | ||
| cover: ProductMedia; | ||
| parent: Product; | ||
| children: Product[]; | ||
| media: ProductMedia[]; | ||
| translations: ProductTranslation[]; | ||
| categories: Category[]; | ||
| tags: Tag[]; | ||
| properties: PropertyGroupOption[] | null; | ||
| options: PropertyGroupOption[] | null; | ||
| categoriesRo: Category[] | null; | ||
| coverId: string | null; | ||
| customFields: CustomField[]; | ||
| tagIds: [] | null; | ||
| productReviews: ProductReview[] | null; | ||
| ratingAverage: number | null; | ||
| extensions: []; | ||
| id: string; | ||
| parentVersionId: string; | ||
| productManufacturerVersionId: string; | ||
| seoUrls: SeoUrl[] | null; | ||
| translated: { | ||
| name: string | null; | ||
| }; | ||
| productMediaVersiond?: null; | ||
| crossSellings: CrossSelling[]; | ||
| cmsPage: null | CmsPage; | ||
| }; | ||
| type Aggregation = { | ||
| /** | ||
| * name of the aggregation | ||
| */ | ||
| name: string; | ||
| /** | ||
| * types: count , avg, max, min, stats, sum, filter, entity, terms, histogram | ||
| */ | ||
| type: string; | ||
| field: string; | ||
| }; | ||
| /** | ||
| * @public | ||
| */ | ||
| type CmsBlock = { | ||
| apiAlias: string; | ||
| createdAt: string; | ||
| customFields: null | unknown; | ||
| extensions: unknown; | ||
| id: string; | ||
| locked: true; | ||
| marginBottom: string | null; | ||
| marginLeft: string | null; | ||
| marginRight: string | null; | ||
| marginTop: string | null; | ||
| name: string; | ||
| position: number; | ||
| section: CmsSection | null; | ||
| sectionId: string; | ||
| sectionPosition: string; | ||
| slots: CmsSlot[]; | ||
| translated: unknown; | ||
| type: string; | ||
| updatedAt: Date | null; | ||
| versionId: string | null; | ||
| _uniqueIdentifier: string; | ||
| sizingMode: SizingMode; | ||
| mobileBehavior: MobileBehavior; | ||
| backgroundColor: string | null; | ||
| backgroundMediaId: string | null; | ||
| backgroundMedia: Media | null; | ||
| backgroundMediaMode: BackgroundMediaMode; | ||
| cssClass: string | null; | ||
| }; | ||
| /** | ||
| * Cms page type | ||
| * | ||
| * @public | ||
| */ | ||
| type CmsPageType = "product_list" | "landingpage" | "product_detail"; | ||
| /** | ||
| * @public | ||
| */ | ||
| type CmsPage = { | ||
| category: Category; | ||
| type: CmsPageType; | ||
| name: string; | ||
| customFields: CustomField[] | null; | ||
| locked: boolean; | ||
| _uniqueIdentifier: string; | ||
| versionId: string | null; | ||
| translated: unknown; | ||
| createdAt: Date; | ||
| updatedAt: Date; | ||
| extensions: [any]; | ||
| id: string; | ||
| entity: any | null; | ||
| sections: CmsSection[]; | ||
| translations: [any] | null; | ||
| categories: [Category] | null; | ||
| config: any | null; | ||
| previewMediaId: any | null; | ||
| previewMedia: any | null; | ||
| }; | ||
| /** | ||
| * @public | ||
| */ | ||
| type CmsSlotType = | ||
| | "image" | ||
| | "product-slider" | ||
| | "product-listing" | ||
| | "product-box" | ||
| | "slot" | ||
| | "text"; | ||
| /** | ||
| * @public | ||
| */ | ||
| type CmsFieldConfig = { | ||
| name: string; | ||
| source: string; | ||
| value: string; | ||
| }; | ||
| /** | ||
| * @public | ||
| */ | ||
| type CmsSlot = { | ||
| type: CmsSlotType; | ||
| customFields: CustomField[] | null; | ||
| locked: boolean; | ||
| _uniqueIdentifier: string; | ||
| versionId: string; | ||
| translated: unknown; | ||
| createdAt: Date; | ||
| updatedAt: Date | null; | ||
| extensions: [any]; | ||
| id: string; | ||
| translations: any | null; | ||
| config: unknown; | ||
| slot: string; | ||
| block: CmsBlock | null; | ||
| blockId: string; | ||
| fieldConfig: CmsFieldConfig[]; | ||
| data?: unknown; | ||
| apiAlias: string; | ||
| }; | ||
| /** | ||
| * @public | ||
| */ | ||
| type SectionType = "default" | "sidebar"; | ||
| /** | ||
| * @public | ||
| */ | ||
| type SizingMode = "boxed"; | ||
| /** | ||
| * @public | ||
| */ | ||
| type MobileBehavior = "boxed" | "wrap"; | ||
| /** | ||
| * @public | ||
| */ | ||
| type BackgroundMediaMode = "cover"; | ||
| /** | ||
| * @public | ||
| */ | ||
| type CmsSection = { | ||
| type: SectionType; | ||
| pageId: string; | ||
| page: null; | ||
| position: number; | ||
| name: string | null; | ||
| sizingMode: SizingMode; | ||
| mobileBehavior: MobileBehavior; | ||
| backgroundColor: string | null; | ||
| backgroundMediaId: string | null; | ||
| backgroundMedia: null; | ||
| backgroundMediaMode: BackgroundMediaMode; | ||
| cssClass: string | null; | ||
| customFields: CustomField[] | null; | ||
| locked: false; | ||
| _uniqueIdentifier: string; | ||
| versionId: string | null; | ||
| translated: [any]; | ||
| createdAt: Date; | ||
| updatedAt: Date; | ||
| extensions: [any]; | ||
| id: string; | ||
| blocks: CmsBlock[]; | ||
| }; | ||
| /** | ||
| * Source: https://github.com/shopware/platform/blob/master/src/Core/Content/Category/CategoryDefinition.php#L50 | ||
| * | ||
| * @beta | ||
| */ | ||
| type CategoryType = "page" | "link" | "folder"; | ||
| /** | ||
| * @beta | ||
| */ | ||
| type Category = Entity & { | ||
| parentId: string | null; | ||
| autoIncrement: number; | ||
| mediaId: string | null; | ||
| name: string | null; | ||
| breadcrumb: string[]; | ||
| level: number; | ||
| active: boolean; | ||
| childCount: number; | ||
| displayNestedProducts: boolean; | ||
| parent: Category | null; | ||
| children: Category[] | null; | ||
| translations: CategoryTranslation[] | null; | ||
| media: Media | null; | ||
| products: Product[] | null; | ||
| nestedProducts: Product[] | null; | ||
| afterCategoryId: string | null; | ||
| customFields: CustomField[]; | ||
| tags: Tag[] | null; | ||
| cmsPageId: string | null; | ||
| cmsPage: CmsPage | null; | ||
| slotConfig: [] | null; | ||
| externalLink: string | null; | ||
| linkNewTab: boolean; | ||
| visible: boolean; | ||
| type: CategoryType; | ||
| description: string; | ||
| id: string; | ||
| parentVersionId: string; | ||
| childrenCount: number; | ||
| afterCategoryVersionId: string; | ||
| route?: { | ||
| path?: string; | ||
| }; | ||
| seoUrls: { | ||
| apiAlias: string; | ||
| pathInfo: string; | ||
| seoPathInfo: string; | ||
| }[]; | ||
| translated: { | ||
| breadcrumb: string[]; | ||
| description: string; | ||
| externalLink: string; | ||
| }; | ||
| }; | ||
| type MediaThumbnail = { | ||
| width: string; | ||
| height: string; | ||
| [x: string]: any; | ||
| }; | ||
| type MediaFolder = unknown; | ||
| type DocumentBaseConfig = unknown; | ||
| type Document = unknown; | ||
| /** | ||
| * @public | ||
| */ | ||
| type Media = { | ||
| userId: string | null; | ||
| mimeType: string | null; | ||
| fileExtension: string | null; | ||
| fileSize: number | null; | ||
| title: string | null; | ||
| metaDataRaw: string | null; | ||
| metaData: [] | null; | ||
| mediaType: MediaType; | ||
| uploadedAt: Date | null; | ||
| alt: string | null; | ||
| url: string; | ||
| fileName: string; | ||
| user: User; | ||
| translations: MediaTranslation[] | null; | ||
| categories: Category[] | null; | ||
| productManufacturers: ProductManufacturer[] | null; | ||
| productMedia: ProductMedia | null; | ||
| avatarUser: User | null; | ||
| thumbnails: MediaThumbnail[] | null; | ||
| mediaFolderId: string | null; | ||
| mediaFolder: MediaFolder | null; | ||
| hasFile: boolean; | ||
| private: boolean; | ||
| propertyGroupOptions: PropertyGroupOption[] | null; | ||
| mailTemplateMedia: MailTemplateMedia[] | null; | ||
| customFields: CustomField[]; | ||
| tags: Tag | null; | ||
| thumbnailsRo: string | null; | ||
| documentBaseConfigs: DocumentBaseConfig[] | null; | ||
| shippingMethods: ShippingMethod[] | null; | ||
| paymentMethods: PaymentMethod[] | null; | ||
| orderLineItems: OrderLineItem[] | null; | ||
| cmsBlocks: CmsBlock[] | null; | ||
| documents: Document[] | null; | ||
| }; | ||
| /** | ||
| * @public | ||
| */ | ||
| type Pagination = { | ||
| limit?: number; | ||
| page?: number; | ||
| }; | ||
| type LtRangeFilter = { | ||
| lt: string | number; | ||
| }; | ||
| /** | ||
| * @alpha | ||
| */ | ||
| type GtRangeFilter = { | ||
| gt: string | number; | ||
| }; | ||
| /** | ||
| * @alpha | ||
| */ | ||
| type LteRangeFilter = { | ||
| lte: string | number; | ||
| }; | ||
| /** | ||
| * @alpha | ||
| */ | ||
| type GteRangeFilter = { | ||
| gte: string | number; | ||
| }; | ||
| /** | ||
| * @alpha | ||
| */ | ||
| type LtGtRangeFilter = { | ||
| lt: string | number; | ||
| gt: string | number; | ||
| }; | ||
| /** | ||
| * @alpha | ||
| */ | ||
| type LtGteRangeFilter = { | ||
| lt: string | number; | ||
| gte: string | number; | ||
| }; | ||
| /** | ||
| * @alpha | ||
| */ | ||
| type LteGtRangeFilter = { | ||
| lte: string | number; | ||
| gt: string | number; | ||
| }; | ||
| /** | ||
| * @alpha | ||
| */ | ||
| type LteGteRangeFilter = { | ||
| lte: string | number; | ||
| gte: string | number; | ||
| }; | ||
| /** | ||
| * @beta | ||
| */ | ||
| enum SearchFilterType { | ||
| EQUALS = "equals", | ||
| CONTAINS = "contains", | ||
| EQUALS_ANY = "equalsAny", | ||
| NOT = "not", | ||
| MULTI = "multi", | ||
| RANGE = "range", | ||
| MAX = "max", | ||
| } | ||
| /** | ||
| * @beta | ||
| */ | ||
| type SearchFilter = { | ||
| type: SearchFilterType; | ||
| }; | ||
| /** | ||
| * @beta | ||
| */ | ||
| type EqualsFilter = SearchFilter & { | ||
| value: string | null; | ||
| field: string; | ||
| }; | ||
| /** | ||
| * @beta | ||
| */ | ||
| type EqualsAnyFilter = SearchFilter & { | ||
| value: string[]; | ||
| field: string; | ||
| }; | ||
| /** | ||
| * @beta | ||
| */ | ||
| type ContainsFilter = SearchFilter & { | ||
| value: string[]; | ||
| field: string; | ||
| }; | ||
| /** | ||
| * @public | ||
| */ | ||
| type RangeFilter = SearchFilter & { | ||
| field: string; | ||
| parameters: | ||
| | LtRangeFilter | ||
| | GtRangeFilter | ||
| | LteRangeFilter | ||
| | GteRangeFilter | ||
| | LtGtRangeFilter | ||
| | LtGteRangeFilter | ||
| | LteGtRangeFilter | ||
| | LteGteRangeFilter; | ||
| }; | ||
| /** | ||
| * @beta | ||
| */ | ||
| type MultiFilter = SearchFilter & { | ||
| operator: string; | ||
| queries: Array< | ||
| EqualsAnyFilter | RangeFilter | ContainsFilter | EqualsFilter | MultiFilter | ||
| >; | ||
| }; | ||
| type TotalCountMode = { | ||
| /** | ||
| * values exact, next_pages, none (default) | ||
| */ | ||
| mode?: string; | ||
| }; | ||
| /** | ||
| * @beta | ||
| */ | ||
| type ShopwareAssociation = { | ||
| [name: string]: { | ||
| associations?: ShopwareAssociation; | ||
| sort?: | ||
| | { | ||
| field: string; | ||
| order: string; | ||
| naturalSorting: boolean; | ||
| }[] | ||
| | string; | ||
| }; | ||
| }; | ||
| /** | ||
| * @public | ||
| */ | ||
| type Grouping = { | ||
| field: string; | ||
| }; | ||
| /** | ||
| * @public | ||
| */ | ||
| type Sort = { | ||
| key: string; | ||
| priority: number; | ||
| label: string; | ||
| }; | ||
| /** | ||
| * @beta | ||
| */ | ||
| type Includes = { | ||
| [key: string]: string[]; | ||
| }; | ||
| /** | ||
| * configutarion.displayParents: true - if you want to show all the products | ||
| * @beta | ||
| */ | ||
| type SearchCriteria = { | ||
| filters?: Array<EqualsFilter | EqualsAnyFilter | RangeFilter | MultiFilter>; | ||
| pagination?: Pagination; | ||
| sort?: Sort | Sort[]; | ||
| term?: string; | ||
| manufacturer?: string[]; | ||
| properties?: string[]; | ||
| configuration?: { | ||
| displayParents?: boolean; | ||
| grouping?: Grouping; | ||
| associations?: ShopwareAssociation; | ||
| aggregations?: Aggregation[]; | ||
| totalCountMode?: TotalCountMode; | ||
| includes?: Includes; | ||
| ids?: string[]; | ||
| }; | ||
| }; | ||
| /** | ||
| * @beta | ||
| */ | ||
| type AggregationFilterEntity = { | ||
| name: string; | ||
| displayType: string; | ||
| sortingType: string; | ||
| description: string | null; | ||
| position: number; | ||
| options: AggregationFilterEntityOption[]; | ||
| }; | ||
| /** | ||
| * @beta | ||
| */ | ||
| type AggregationFilterEntityOption = { | ||
| groupId: string; | ||
| name: string; | ||
| position: number; | ||
| colorHexCode: string | null; | ||
| mediaId: string | null; | ||
| group: string; | ||
| translations: any | null; | ||
| productConfiguratorSettings: any | null; | ||
| productProperties: any | null; | ||
| productOptions: any | null; | ||
| media: any | null; | ||
| customFields: any | null; | ||
| _uniqueIdentifier: string; | ||
| versionId: null; | ||
| translated: { | ||
| name: string; | ||
| position: number; | ||
| customFields: []; | ||
| }; | ||
| createdAt: Date; | ||
| updatedAt: null; | ||
| extensions: { | ||
| foreignKeys: { | ||
| apiAlias: string; | ||
| }; | ||
| }; | ||
| id: string; | ||
| apiAlias: string; | ||
| }; | ||
| type EntitiesAggregation<ENTITY_TYPE> = { | ||
| entities: ENTITY_TYPE[]; | ||
| }; | ||
| type MaxAggregation = { | ||
| max: number; | ||
| apiAlias: string; | ||
| }; | ||
| type PriceAggregation = { | ||
| min: number; | ||
| max: number; | ||
| avg: number; | ||
| sum: number; | ||
| apiAlias: string; | ||
| }; | ||
| /** | ||
| * @public | ||
| */ | ||
| type Aggregations = { | ||
| manufacturer: EntitiesAggregation<AggregationFilterEntity>; | ||
| price: PriceAggregation; | ||
| "shipping-free": MaxAggregation; | ||
| rating: MaxAggregation; | ||
| properties: EntitiesAggregation<AggregationFilterEntity>; | ||
| }; | ||
| /** | ||
| * @public | ||
| */ | ||
| type ListingFilter = { | ||
| label: string; | ||
| code: string; | ||
| type?: "range" | "max"; | ||
| [key: string]: any; | ||
| }; | ||
| /** | ||
| * Get product free shipping property | ||
@@ -20,17 +2302,17 @@ * | ||
| */ | ||
| interface UiMediaGalleryItemUrl { | ||
| declare type UiMediaGalleryItemUrl = { | ||
| url: string; | ||
| } | ||
| }; | ||
| /** | ||
| * @public | ||
| */ | ||
| interface UiMediaGalleryItem { | ||
| declare type UiMediaGalleryItem = { | ||
| icon: UiMediaGalleryItemUrl; | ||
| mobile: UiMediaGalleryItemUrl; | ||
| desktop: UiMediaGalleryItemUrl; | ||
| } | ||
| }; | ||
| /** | ||
| * @public | ||
| */ | ||
| interface UiProductOption { | ||
| declare type UiProductOption = { | ||
| label: string; | ||
@@ -40,14 +2322,14 @@ value: string; | ||
| color: string | null; | ||
| } | ||
| }; | ||
| /** | ||
| * @public | ||
| */ | ||
| interface UiProductProperty { | ||
| declare type UiProductProperty = { | ||
| name: string; | ||
| value: string | null; | ||
| } | ||
| }; | ||
| /** | ||
| * @public | ||
| */ | ||
| interface UiProductReview { | ||
| declare type UiProductReview = { | ||
| id: string; | ||
@@ -58,3 +2340,3 @@ author: string; | ||
| rating: number | null; | ||
| } | ||
| }; | ||
@@ -107,7 +2389,7 @@ /** | ||
| */ | ||
| interface TierPrice { | ||
| declare type TierPrice = { | ||
| label: string; | ||
| quantity: number; | ||
| unitPrice: number; | ||
| } | ||
| }; | ||
| /** | ||
@@ -209,3 +2491,3 @@ * Get the prices depending on quantity added to cart. | ||
| */ | ||
| interface LayoutConfiguration { | ||
| declare type LayoutConfiguration = { | ||
| layoutStyles: { | ||
@@ -220,3 +2502,3 @@ backgroundColor: string | null; | ||
| cssClasses: string | null; | ||
| } | ||
| }; | ||
| /** | ||
@@ -247,11 +2529,2 @@ * @beta | ||
| /** | ||
| * @public | ||
| */ | ||
| interface ListingFilter { | ||
| label: string; | ||
| code: string; | ||
| type?: "range" | "max"; | ||
| [key: string]: any; | ||
| } | ||
| /** | ||
| * @beta | ||
@@ -261,2 +2534,2 @@ */ | ||
| export { LayoutConfiguration, ListingFilter, TierPrice, UiMediaGalleryItem, UiMediaGalleryItemUrl, UiProductOption, UiProductProperty, UiProductReview, _parseUrlQuery, debounce, getCategoryUrl, getCmsLayoutConfiguration, getListingFilters, getProductCalculatedListingPrice, getProductCalculatedPrice, getProductFreeShipping, getProductFromPrice, getProductMainImageUrl, getProductMediaGallery, getProductName, getProductOptions, getProductPriceDiscount, getProductPriceDiscountPercentage, getProductProperties, getProductRatingAverage, getProductRealPrice, getProductReviews, getProductThumbnailUrl, getProductTierPrices, getProductUrl, getProductVariantsFromPrice, getTranslatedProperty, isLinkCategory }; | ||
| export { LayoutConfiguration, TierPrice, UiMediaGalleryItem, UiMediaGalleryItemUrl, UiProductOption, UiProductProperty, UiProductReview, _parseUrlQuery, debounce, getCategoryUrl, getCmsLayoutConfiguration, getListingFilters, getProductCalculatedListingPrice, getProductCalculatedPrice, getProductFreeShipping, getProductFromPrice, getProductMainImageUrl, getProductMediaGallery, getProductName, getProductOptions, getProductPriceDiscount, getProductPriceDiscountPercentage, getProductProperties, getProductRatingAverage, getProductRealPrice, getProductReviews, getProductThumbnailUrl, getProductTierPrices, getProductUrl, getProductVariantsFromPrice, getTranslatedProperty, isLinkCategory }; |
+8
-5
@@ -12,3 +12,3 @@ function getProductFreeShipping(product) { | ||
| } = {}) { | ||
| return product && product.media ? product.media.map((media) => { | ||
| return product?.media?.map((media) => { | ||
| const smallThumb = media.media && media.media.thumbnails && media.media.thumbnails.find((thumb) => thumb.width == "400"); | ||
@@ -23,3 +23,3 @@ const normalThumb = media.media && media.media.thumbnails && media.media.thumbnails.find((thumb) => thumb.width == "800"); | ||
| }; | ||
| }) : []; | ||
| }) || []; | ||
| } | ||
@@ -222,2 +222,5 @@ | ||
| }; | ||
| function isEntitiesAggregation(aggregation) { | ||
| return aggregation.entities !== void 0; | ||
| } | ||
| function getListingFilters(aggregations) { | ||
@@ -229,5 +232,5 @@ if (!aggregations) { | ||
| for (const [aggregationName, aggregation] of Object.entries(aggregations)) { | ||
| if (aggregationName === "properties" && aggregation.entities) { | ||
| for (const property of aggregation.entities) { | ||
| transformedFilters.push(getFilter(aggregationName, property)); | ||
| if (aggregationName === "properties" && isEntitiesAggregation(aggregation)) { | ||
| for (const filterEntity of aggregation.entities) { | ||
| transformedFilters.push(getFilter(aggregationName, filterEntity)); | ||
| } | ||
@@ -234,0 +237,0 @@ } else if (!["properties", "options"].includes(aggregationName)) { |
+3
-6
| { | ||
| "name": "@shopware-pwa/helpers-next", | ||
| "version": "0.1.0", | ||
| "version": "0.1.1", | ||
| "module": "./dist/index.mjs", | ||
@@ -22,3 +22,3 @@ "types": "./dist/index.d.ts", | ||
| "devDependencies": { | ||
| "@shopware-pwa/commons": "canary", | ||
| "@shopware-pwa/types": "workspace:*", | ||
| "eslint-config-shopware": "workspace:*", | ||
@@ -30,6 +30,3 @@ "query-string": "^7.1.1", | ||
| }, | ||
| "dependencies": {}, | ||
| "publishConfig": { | ||
| "access": "public" | ||
| } | ||
| "dependencies": {} | ||
| } |
-265
| 'use strict'; | ||
| Object.defineProperty(exports, '__esModule', { value: true }); | ||
| function getProductFreeShipping(product) { | ||
| return product?.shippingFree || false; | ||
| } | ||
| function getProductMainImageUrl(product) { | ||
| return product?.cover?.media?.url || product?.cover?.url || ""; | ||
| } | ||
| function getProductMediaGallery({ | ||
| product | ||
| } = {}) { | ||
| return product && product.media ? product.media.map((media) => { | ||
| const smallThumb = media.media && media.media.thumbnails && media.media.thumbnails.find((thumb) => thumb.width == "400"); | ||
| const normalThumb = media.media && media.media.thumbnails && media.media.thumbnails.find((thumb) => thumb.width == "800"); | ||
| const bigThumb = media.media && media.media.thumbnails && media.media.thumbnails.find((thumb) => thumb.width == "1920"); | ||
| return { | ||
| icon: { url: smallThumb ? smallThumb.url : media.media.url }, | ||
| mobile: { url: normalThumb ? normalThumb.url : media.media.url }, | ||
| desktop: { url: bigThumb ? bigThumb.url : media.media.url }, | ||
| alt: product.name || " " | ||
| }; | ||
| }) : []; | ||
| } | ||
| function getTranslatedProperty(element, property) { | ||
| return element?.translated?.[property] || element?.[property] || ""; | ||
| } | ||
| function getProductName({ product } = {}) { | ||
| if (!product) { | ||
| return null; | ||
| } | ||
| return getTranslatedProperty(product, "name"); | ||
| } | ||
| function getProductOptions({ | ||
| product | ||
| } = {}) { | ||
| return product?.options?.map((option) => ({ | ||
| label: getTranslatedProperty(option, "name"), | ||
| code: option.id, | ||
| value: getTranslatedProperty(option, "name"), | ||
| color: option.colorHexCode | ||
| })) || []; | ||
| } | ||
| function getProductProperties({ | ||
| product | ||
| } = {}) { | ||
| const propertyList = product?.properties?.map((property) => ({ | ||
| name: getTranslatedProperty(property.group, "name"), | ||
| value: getTranslatedProperty(property, "name") | ||
| })); | ||
| return propertyList || []; | ||
| } | ||
| function getProductReviews({ | ||
| product | ||
| } = {}) { | ||
| if (!product || !product.productReviews) { | ||
| return []; | ||
| } | ||
| return product.productReviews.map(({ id, externalUser, customerId, createdAt, content, points }) => ({ | ||
| id, | ||
| author: externalUser ? externalUser : customerId, | ||
| date: createdAt, | ||
| message: content, | ||
| rating: points | ||
| })); | ||
| } | ||
| function getProductTierPrices(product) { | ||
| if (!product || !product.calculatedPrices?.length) { | ||
| return []; | ||
| } | ||
| const size = product.calculatedPrices.length; | ||
| return product.calculatedPrices.map(({ unitPrice, quantity }, index) => ({ | ||
| label: index === size - 1 ? `from ${quantity}` : `to ${quantity}`, | ||
| quantity, | ||
| unitPrice | ||
| })); | ||
| } | ||
| function getProductUrl(product) { | ||
| if (!product) | ||
| return "/"; | ||
| const seoUrl = product.seoUrls?.[0]?.seoPathInfo; | ||
| return seoUrl ? `/${seoUrl}` : `/detail/${product.id}`; | ||
| } | ||
| function getProductRatingAverage(product) { | ||
| return product?.ratingAverage; | ||
| } | ||
| function getProductThumbnailUrl(product) { | ||
| const coverImageUrlFallback = product?.cover?.media?.url || ""; | ||
| const thumbnailImage = product?.cover?.media?.thumbnails?.length && product.cover.media.thumbnails.reduce(function(res, thumb) { | ||
| return thumb.width < res.width ? thumb : res; | ||
| }) || null; | ||
| return thumbnailImage?.url || coverImageUrlFallback; | ||
| } | ||
| function getProductPriceDiscount(product) { | ||
| return product?.calculatedPrice?.listPrice?.discount; | ||
| } | ||
| function getProductPriceDiscountPercentage(product) { | ||
| return product?.calculatedPrice?.listPrice?.percentage; | ||
| } | ||
| function getProductCalculatedPrice(product) { | ||
| return product?.calculatedPrice?.unitPrice; | ||
| } | ||
| function getProductCalculatedListingPrice(product) { | ||
| return product?.calculatedPrice?.listPrice?.price || product?.calculatedPrice?.unitPrice; | ||
| } | ||
| function getProductRealPrice(product) { | ||
| if (!product) { | ||
| return; | ||
| } | ||
| const real = product.calculatedPrice; | ||
| if (product.calculatedPrices?.length > 1) { | ||
| return product.calculatedPrices[product.calculatedPrices.length - 1]; | ||
| } | ||
| return real; | ||
| } | ||
| function getProductVariantsFromPrice(product) { | ||
| if (!product) { | ||
| return; | ||
| } | ||
| const realPrice = getProductRealPrice(product); | ||
| const cheapestPrice = product.calculatedCheapestPrice; | ||
| if (cheapestPrice?.unitPrice != realPrice?.unitPrice) { | ||
| return cheapestPrice.unitPrice; | ||
| } | ||
| } | ||
| function getProductFromPrice(product) { | ||
| if (!product) { | ||
| return; | ||
| } | ||
| const realPrice = getProductRealPrice(product); | ||
| const displayFromPriceLabel = product.calculatedPrices?.length > 0; | ||
| if (displayFromPriceLabel) | ||
| return realPrice?.unitPrice; | ||
| } | ||
| const getCategoryUrl = (category) => { | ||
| if (!category) | ||
| return "/"; | ||
| switch (category.type) { | ||
| case "link": | ||
| return getTranslatedProperty(category, "externalLink") || "/"; | ||
| case "folder": | ||
| return "/"; | ||
| default: | ||
| return category.seoUrls?.[0]?.seoPathInfo ? `/${category.seoUrls[0].seoPathInfo}` : category.id ? `/navigation/${category.id}` : "/"; | ||
| } | ||
| }; | ||
| const isLinkCategory = (category) => category?.type === "link"; | ||
| function getCmsLayoutConfiguration(content) { | ||
| if (!content) { | ||
| return { | ||
| cssClasses: null, | ||
| layoutStyles: {} | ||
| }; | ||
| } | ||
| return { | ||
| cssClasses: content.cssClass, | ||
| layoutStyles: { | ||
| backgroundColor: content.backgroundColor, | ||
| backgroundImage: content.backgroundMedia ? `url(${content.backgroundMedia.url})` : null, | ||
| marginBottom: content.marginBottom, | ||
| marginLeft: content.marginLeft, | ||
| marginRight: content.marginRight, | ||
| marginTop: content.marginTop | ||
| } | ||
| }; | ||
| } | ||
| function _parseUrlQuery(query) { | ||
| const searchCriteria = {}; | ||
| if (!query || typeof query !== "object") { | ||
| return searchCriteria; | ||
| } | ||
| Object.keys(query).forEach((key) => { | ||
| try { | ||
| searchCriteria[key] = typeof query[key] === "string" && ["{", "["].includes(query[key].charAt(0)) ? JSON.parse(query[key]) : query[key]; | ||
| } catch (e) { | ||
| console.error("[helpers][parseUrlQuery] Problem with resolving url param: " + key); | ||
| } | ||
| }); | ||
| return searchCriteria; | ||
| } | ||
| function debounce(fn, delay = 300) { | ||
| let prevTimer = null; | ||
| return (...args) => { | ||
| if (prevTimer) { | ||
| clearTimeout(prevTimer); | ||
| } | ||
| prevTimer = window.setTimeout(() => { | ||
| fn(...args); | ||
| prevTimer = null; | ||
| }, delay); | ||
| }; | ||
| } | ||
| const getFilter = (code, aggregation) => { | ||
| return { | ||
| label: getTranslatedProperty(aggregation, "name") || code, | ||
| code, | ||
| ...aggregation | ||
| }; | ||
| }; | ||
| function getListingFilters(aggregations) { | ||
| if (!aggregations) { | ||
| return []; | ||
| } | ||
| const transformedFilters = []; | ||
| for (const [aggregationName, aggregation] of Object.entries(aggregations)) { | ||
| if (aggregationName === "properties" && aggregation.entities) { | ||
| for (const property of aggregation.entities) { | ||
| transformedFilters.push(getFilter(aggregationName, property)); | ||
| } | ||
| } else if (!["properties", "options"].includes(aggregationName)) { | ||
| transformedFilters.push(getFilter(aggregationName, aggregation)); | ||
| } | ||
| } | ||
| return transformedFilters; | ||
| } | ||
| exports._parseUrlQuery = _parseUrlQuery; | ||
| exports.debounce = debounce; | ||
| exports.getCategoryUrl = getCategoryUrl; | ||
| exports.getCmsLayoutConfiguration = getCmsLayoutConfiguration; | ||
| exports.getListingFilters = getListingFilters; | ||
| exports.getProductCalculatedListingPrice = getProductCalculatedListingPrice; | ||
| exports.getProductCalculatedPrice = getProductCalculatedPrice; | ||
| exports.getProductFreeShipping = getProductFreeShipping; | ||
| exports.getProductFromPrice = getProductFromPrice; | ||
| exports.getProductMainImageUrl = getProductMainImageUrl; | ||
| exports.getProductMediaGallery = getProductMediaGallery; | ||
| exports.getProductName = getProductName; | ||
| exports.getProductOptions = getProductOptions; | ||
| exports.getProductPriceDiscount = getProductPriceDiscount; | ||
| exports.getProductPriceDiscountPercentage = getProductPriceDiscountPercentage; | ||
| exports.getProductProperties = getProductProperties; | ||
| exports.getProductRatingAverage = getProductRatingAverage; | ||
| exports.getProductRealPrice = getProductRealPrice; | ||
| exports.getProductReviews = getProductReviews; | ||
| exports.getProductThumbnailUrl = getProductThumbnailUrl; | ||
| exports.getProductTierPrices = getProductTierPrices; | ||
| exports.getProductUrl = getProductUrl; | ||
| exports.getProductVariantsFromPrice = getProductVariantsFromPrice; | ||
| exports.getTranslatedProperty = getTranslatedProperty; | ||
| exports.isLinkCategory = isLinkCategory; |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
61466
181.05%2559
274.12%3
-25%1
Infinity%