npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

oneentry

v1.0.102

Published

OneEntry Headless CMS SDK is an SDK that provides an easy way to interact with the OneEntry Headless CMS API.

Downloads

131

Readme

OneEntry SDK

OneEntry Headless CMS SDK is an SDK that provides an easy way to interact with the OneEntry Headless CMS API.

Official Site

Visit the official AsyncModules website at https://oneentry.cloud to learn more about the AsyncModules Headless CMS.

Sign Up

To get started with AsyncModules, sign up for an account at https://account.oneentry.cloud/authentication/register.

Installation

To install the AsyncModules Headless CMS SDK in your project, run the following command:

npm install oneentry

Get Started

To use the AsyncModules Headless CMS SDK in your project, import the defineOneEntry function:

import { defineOneEntry } from 'oneentry'

const {
        Admins,
        AttributesSets,
        AuthProvider,
        Blocks,
        Events,
        Forms,
        FormData,
        FileUploading,
        GeneralTypes,
        Locales,
        Menus,
        Orders,
        Pages,
        Products,
        ProductStatuses,
        System,
        Templates,
        TemplatePreviews,
        Users,
        WS
} = defineOneEntry('your-url');

Or

const api = defineOneEntry('your-url');

Config

The second parameter of the constructor takes the 'config'. It contains the following values:

  • 'token' - Set the token key if your project secure "Security API Token". If you are using certificate protection, do not pass this variable. You can read more about the security of your project here.

  • 'langCode' - Set the "langCode" to set the default language. By specifying this parameter once, you don't have to pass the langCode to the methods ONEENTRY API. If you have not passed the default language, it will be set "en_US".

  • 'traficLimit' - Some methods use more than one request to the CMS so that the data you receive is complete and easy to work with. Pass the value "true" for this parameter to save traffic and decide for yourself what data you need. The default value "false".

  • 'auth' - An object with authorization settings. By default, the SDK is configured to work with tokens inside the user's session and does not require any additional work from you. At the same time, the SDK does not store the session state between sessions. If you are satisfied with such settings, do not pass the variable 'auth' at all.

The 'auth' contains the following settings:

  • 'refreshToken' - The user's refresh token. Transfer it here from the repository to restore the user's session during initialization.

  • 'saveFunction' - A function that works with the update refresh token. If you want to store the token between sessions, for example in local storage, pass a function here that does this. The function must accept a parameter to which the string with the token will be passed.

  • 'customAuth' - If you want to configure authorization and work with tokens yourself, set this flag to true. If you want to use the sdk settings, set it to false or do not transfer it at all.

An example of a configuration with token protection and automatic authentication that stores state between sessions

const tokenFunction = (token) => {
    localStorage.setItem('refreshToken', token)
}

const api = defineOneEntry('https://my-project.oneentry.cloud', {
    token:'my-token',
    langCode:'en_US',
    auth: {
        refreshToken: localStorage.getItem('refreshToken'),
        saveFunction: tokenFunction
    }
})

An example of a configuration that is protected with a certificate allows you to configure the authorization system yourself and saves data on requests.

const api = defineOneEntry('https://my-project.oneentry.cloud', {
    langCode:'en_US',
    traficLimit: true,
    auth: {
        customAuth: true,
        refreshToken: localStorage.getItem('refreshToken')
    }
})

If you have chosen to configure tokens yourself, you can pass the token to the method as follows. The intermediate method allows you to pass an access token to the request. Then call the required method. This method (setAccessToken) should not be called if the method does not require user authorization.

const user = api.Users.setAccessToken('my.access.token').getUser()

If you chose token protection to ensure connection security, just pass your token to the function as an optional parameter.

You can get a token as follows

  1. Log in to your personal account
  2. Go to the "Projects" tab and select a project
  3. Go to the "Access" tab
  4. Set the switch to "Security API Token"
  5. Log in to the project, go to the settings section and open the token tab
  6. Get and copy the token of your project

You can also connect a tls certificate to protect your project. In this case, do not pass the "token" at all. When using the certificate, set up a proxy in your project. Pass an empty string as an url parameter. Learn more about security

const saveTokenFromLocalStorage = (token) => {
    localStorage.setItem('refreshToken', token)
}

const api = defineOneEntry('your-url', {
    token: 'my-token', 
    langCode:'my-langCode',
    auth: {
        customAuth: false,
        userToken: 'rerfesh.token',
        saveFunction: saveTokenFromLocalStorage
    }
})

Errors

If you want to escape errors inside the sc, leave the "errors" property by default. In this case, you will receive either the entity data or the error object. You need to do a type check. for example, by checking the statusCode property with ".hasOwnProperty"

However, if you want to use the construction "try {} catch(e) {}", set the property "isShell" to the value "false". In this case, you need to handle the error using "try {} catch(e) {}".

Also, you can pass custom functions that will be called inside the sdk with the appropriate error code. These functions receive an error object as an argument. You can process it yourself.

const api = defineOneEntry('your-url', {
    token: 'my-token',
    langCode:'my-langCode',
    errors: {
        isShell: false,
        customErrors: {
            400: (error) => console.error(error.message),
            404: (error) => console.error(error.message),
            500: (error) => console.error(error.message)
        }
    }
})

Now you can use the following links to jump to specific entries:

Admins

const { Admins } = defineOneEntry('your-url');

Admins.getAdminsInfo(langCode, offset, limit)

const value = await Admins.getAdminsInfo('en_US', 0, 30)

This method retrieves all user objects of type admin from the API. It returns a Promise that resolves to an array of AdminEntity objects.

Example return:

[
  {
    "id": 1764,
    "identifier": "admin1",
    "attributeSetId": 7,
    "isSync": false,
    "attributeValues": {
      "marker": {
        "value": "",
        "type": "string"
      }
    },
    "position": 192
  }
]

id: number object identifier example: 1764

identifier: string textual identifier for the record field example: admin1 default: admin1

attributeSetId: number Attribute set identifier example: 7

isSync boolean Page indexing flag (true or false) example: false

attributeValues: Record<string, string> Array of attribute values from the index (presented as a pair of user attribute identifier: attribute value) example: OrderedMap { "en_US": OrderedMap { "marker": OrderedMap { "value": "", "type": "string" } } }

position: number Position number (for sorting) example: 192


AttributesSets

const { AttributesSets } = defineOneEntry('your-url');

AttributesSets.getAttributesByMarker(marker, langCode)

const value = await AttributesSets.getAttributesByMarker('my-marker', 'en_US')

This method return all attributes with data from the attribute sets.

Example return:

[
  {
    "type": "list",
    "marker": "list1",
    "position": 192,
    "validators": {
      "requiredValidator": {
        "strict": true
      },
      "defaultValueValidator": {
        "fieldDefaultValue": 11
      }
    },
    "localizeInfos": {
      "title": "My attribute"
    },
    "listTitles": [
      {
        "title": "red",
        "value": 1,
        "position": 1,
        "extended": {
          "value": null,
          "type": null
        }
      },
      {
        "title": "yellow",
        "value": 2,
        "position": 2,
        "extended": {
          "value": null,
          "type": null
        }
      }
    ]
  }
]

type: string attribute type example: list

marker: string textual identifier of the attribute (marker) Enum: [ string, text, textWithHeader, integer, real, float, dateTime, date, time, file, image, groupOfImages, radioButton, list, button ] example: list1

position: number position number for sorting example: 192

validators: Record<string, any> set of validators for validation example: OrderedMap { "requiredValidator": OrderedMap { "strict": true }, "defaultValueValidator": OrderedMap { "fieldDefaultValue": 11 } }

localizeInfos: Record<string, any> localization data for the set (name) example: OrderedMap { "title": "My attribute" }

listTitles Record<string, any> array of values (with extended data) for list and radioButton attributes example: List [ OrderedMap { "title": "red", "value": 1, "position": 1, "extendedValue": null, "extendedValueType": null }, OrderedMap { "title": "yellow", "value": 2, "position": 2, "extendedValue": null, "extendedValueType": null } ]

AttributesSets.getSingleAttributeByMarkerSet(attributeMarker, setMarker, langCode)

const value = await AttributesSets.getSingleAttributeByMarkerSet('list1', 'list1', 'en_US')

This method return a single attribute with data from the attribute sets.

Example return:

{
  "type": "list",
  "marker": "list1",
  "position": 192,
  "validators": {
    "requiredValidator": {
      "strict": true
    },
    "defaultValueValidator": {
      "fieldDefaultValue": 11
    }
  },
  "localizeInfos": {
    "title": "My attribute"
  },
  "listTitles": [
    {
      "title": "red",
      "value": 1,
      "position": 1,
      "extended": {
        "value": null,
        "type": null
      }
    },
    {
      "title": "yellow",
      "value": 2,
      "position": 2,
      "extended": {
        "value": null,
        "type": null
      }
    }
  ]
}

type: string attribute type example: list

marker: string textual identifier of the attribute (marker) example: list1

position: number position number for sorting example: 192

validators: Record<string, any> set of validators for validation example: OrderedMap { "requiredValidator": OrderedMap { "strict": true }, "defaultValueValidator": OrderedMap { "fieldDefaultValue": 11 } }

localizeInfos: Record<string, any> localization data for the set (name) example: OrderedMap { "title": "My attribute" }

listTitles Record<string, any> array of values (with extended data) for list and radioButton attributes example: List [ OrderedMap { "title": "red", "value": 1, "position": 1, "extendedValue": null, "extendedValueType": null }, OrderedMap { "title": "yellow", "value": 2, "position": 2, "extendedValue": null, "extendedValueType": null } ]


User Auth Provider

const { AuthProvider } = defineOneEntry('your-url');

AuthProvider.signUp(marker, data, langCode)


const data = {
    "formIdentifier": "reg",
    "authData": [
        {
            "marker": "login",
            "value": "test"
        },
        {
            "marker": "password",
            "value": "12345"
        }
    ],
    "formData": [
        {
            "marker": "last_name",
            "type": "string",
            "value": "Username"
        }
    ],
    "notificationData": {
        "email": "[email protected]",
        "phonePush": [],
        "phoneSMS": "+99999999999"
    }
}

const value = await AuthProvider.signUp('email', data)

formIdentifier: string textual identifier of the authorization provider's form example: reg_form

formData: form data attached to the authorization provider

authData: authorization data taken from the form attached to the authorization provider example: List [ OrderedMap { "marker": "login", "value": "test" }, OrderedMap { "marker": "password", "value": "12345" } ]

notificationData: user notification data

attributeSetId: number identifier for the used attribute set example: 7

formData: FormDataLangType Data submitted by the form example: OrderedMap { "en_US": List [ OrderedMap { "marker": "naimenovanie_1", "value": "Name" } ] }

notificationData: UserNotificationDataType data for notifying the user example: OrderedMap { "email": "[email protected]", "phonePush": "", "phoneSMS": "+79991234567" }

systemCode: string system code for performing official actions (password reset, activation) example: OrderedMap { "value": "90BDCX", "expiredDate": "2024-05-07T21:02:00.000Z" }

formIdentifier: string the text identifier of the authorization provider's form example: reg_form

authData: FormAuthDataType authorization data taken from the form linked to the authorization provider example: List [ OrderedMap { "marker": "login", "value": "test" }, OrderedMap { "marker": "password", "value": "12345" } ]

authProviderId: number ID of the authorization provider example: 1

This method will register a new user. Returns the registered user's object.

Example return:

{
  "id": 1764,
  "updatedDate": "2024-05-23T12:43:00.169Z",
  "version": 10,
  "identifier": "catalog",
  "isActive": false,
  "authProviderId": 1,
  "formData": [
      {
        "marker": "login",
        "value": "test"
      },
      {
        "marker": "f-name",
        "value": "Second name"
      }
  ],
  "notificationData": {
    "email": "[email protected]",
    "phonePush": ["+999999999"],
    "phoneSMS": "+9999999999"
  },
  "systemCode": {
    "value": "90BDCX",
    "expiredDate": "2024-05-07T21:02:00.000Z"
  }
}

id: number object identifier example: 1764

updatedDate: string object modification date

version: number object version number example: 10

identifier: string textual identifier for the field record example: catalog default: marker

attributeSetId: number identifier for the used attribute set example: 7

formData: FormDataLangType Data submitted by the form example: OrderedMap { "en_US": List [ OrderedMap { "marker": "naimenovanie_1", "value": "Name" } ] }

notificationData: UserNotificationDataType data for notifying the user example: OrderedMap { "email": "[email protected]", "phonePush": "", "phoneSMS": "+79991234567" }

systemCode: string system code for performing official actions (password reset, activation) example: OrderedMap { "value": "90BDCX", "expiredDate": "2024-05-07T21:02:00.000Z" }

formIdentifier: string the text identifier of the authorization provider's form example: reg_form

authData: FormAuthDataType authorization data taken from the form linked to the authorization provider example: List [ OrderedMap { "marker": "login", "value": "test" }, OrderedMap { "marker": "password", "value": "12345" } ]

authProviderId: number ID of the authorization provider example: 1

AuthProvider.generateCode(marker, userIdentifier, eventIdentifier)

const value = await AuthProvider.generateCode('email', '[email protected]', 'auth')

This method receives a code to activate the user. Code is returned through the corresponding user notification method

AuthProvider.checkCode(marker, userIdentifier, code)

const value = await AuthProvider.checkCode('email', '[email protected]', 'WTGC9E')

This method checks the user's code. Returns true (if the code is correct) or false (if it is incorrect).

Example return:

true

AuthProvider.activateUser(marker, userIdentifier, code)

const value = await AuthProvider.activateUser('email', '[email protected]', 'WTGC9E')

This method activates the user by code. If successful, it will return true.

Example return:

true

AuthProvider.auth(marker, data)

const data = {
    authData: [
        {
            marker: "login",
            value: "[email protected]"
        },
        {
            marker: "password",
            value: "12345"
        }
    ]
}

const value = await AuthProvider.auth('email', data)

authData: string Authorization data taken from the form attached to the authorization provider example: List [ OrderedMap { "marker": "login", "value": "test" }, OrderedMap { "marker": "password", "value": "12345" } ]

This method performs user authorization. Returns an object with a set of tokens.

Example return:

{
  "userIdentifier": "[email protected]",
  "authProviderIdentifier": "email",
  "accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MywiYXV0aFByb3ZpZGVySWRlbnRpZmllciI6ImVtYWlsIiwidXNlcklkZW50aWZpZXIiOiJ0ZXN0QHRlc3QucnUiLCJ1c2VyQWdlbnQiOiJQb3N0bWFuUnVudGltZS83LjM3LjMiLCJpYXQiOjE3MTQ1NTc2NzAsImV4cCI6MTcxNDU2MTI3MH0.vm74Ha-S37462CAF3QiDpO9b0OhlJFNDMKq4eEyoaB8",
  "refreshToken": "1714557670334-cb85112d-618d-4b2a-bad5-137b19c135b9"
}

userIdentifier: string user identifier example: [email protected]

authProviderIdentifier: string auth provider identifier example: email

accessToken: string access token example:eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MywiYXV0aFByb3ZpZGVySWRlbnRpZmllciI6ImVtYWlsIiwidXNlcklkZW50aWZpZXIiOiJ0ZXN0QHRlc3QucnUiLCJ1c2VyQWdlbnQiOiJQb3N0bWFuUnVudGltZS83LjM3LjMiLCJpYXQiOjE3MTQ1NTc2NzAsImV4cCI6MTcxNDU2MTI3MH0.vm74Ha-S37462CAF3QiDpO9b0OhlJFNDMKq4eEyoaB8

refreshToken: string refresh token example: 1714557670334-cb85112d-618d-4b2a-bad5-137b19c135b9

AuthProvider.refresh(marker, token)

const value = await AuthProvider.refresh('email', '1714557670334-cb85112d-618d-4b2a-bad5-137b19c135b9')

This method updates the user's token. Returns an object with a set of tokens.

Example return:

{
  "userIdentifier": "[email protected]",
  "authProviderIdentifier": "email",
  "accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MywiYXV0aFByb3ZpZGVySWRlbnRpZmllciI6ImVtYWlsIiwidXNlcklkZW50aWZpZXIiOiJ0ZXN0QHRlc3QucnUiLCJ1c2VyQWdlbnQiOiJQb3N0bWFuUnVudGltZS83LjM3LjMiLCJpYXQiOjE3MTQ1NTc2NzAsImV4cCI6MTcxNDU2MTI3MH0.vm74Ha-S37462CAF3QiDpO9b0OhlJFNDMKq4eEyoaB8",
  "refreshToken": "1714557670334-cb85112d-618d-4b2a-bad5-137b19c135b9"
}

userIdentifier: string user identifier example: [email protected]

authProviderIdentifier: string auth provider identifier example: email

accessToken: string access token example:eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MywiYXV0aFByb3ZpZGVySWRlbnRpZmllciI6ImVtYWlsIiwidXNlcklkZW50aWZpZXIiOiJ0ZXN0QHRlc3QucnUiLCJ1c2VyQWdlbnQiOiJQb3N0bWFuUnVudGltZS83LjM3LjMiLCJpYXQiOjE3MTQ1NTc2NzAsImV4cCI6MTcxNDU2MTI3MH0.vm74Ha-S37462CAF3QiDpO9b0OhlJFNDMKq4eEyoaB8

refreshToken: string refresh token example: 1714557670334-cb85112d-618d-4b2a-bad5-137b19c135b9

AuthProvider.logout(marker, token)

const value = await AuthProvider.logout('email', '1714557670334-cb85112d-618d-4b2a-bad5-137b19c135b9')

This method performs a user logout. If successful, it will return true.

Example return:

true

AuthProvider.changePassword(marker, userIdentifier, type, code, newPassword, repeatPassword)

const value = await AuthProvider.changePassword('email', '[email protected]', 1, 'EW32RF', 654321, 654321)

This method changes the password of an authorized user. If successful, it will return true.

Example return:

true

AuthProvider.getAuthProviders(langCode, offset, limit)

const value = await AuthProvider.getAuthProviders()

This method gets all the objects of the authorization providers.

Example return:

[
  {
    "id": 1,
    "localizeInfos": {
      "title": "email"
    },
    "config": {
      "deleteNoneActiveUsersAfterDays": 2,
      "systemCodeTlsSec": 120,
      "systemCodeLength": 8,
      "systemCodeOnlyNumbers": null
    },
    "version": 0,
    "identifier": "email",
    "type": "email",
    "formIdentifier": "reg",
    "isActive": true,
    "isCheckCode": false
  }
]

id: number object identifier example: 1764

localizeInfos: CommonLocalizeInfos block name with localization example: OrderedMap { "en_US": OrderedMap { "title": "My block" } }

version: number object version number example: 10

identifier: string textual identifier for the field record example: catalog default: marker

isActive: boolean Flag of usage example: false

isCheckCode: boolean a sign of user activation via a code example: false

type: string type of providere example: email

formIdentifier: string the marker of the form used by the provider (may be null) example: email

AuthProvider.getMarker(marker, langCode)

const value = await AuthProvider.getMarker('email')

Getting a single token authorization provider object.

Example return:

[
  {
    "id": 1,
    "localizeInfos": {
      "title": "email"
    },
    "version": 0,
    "identifier": "email",
    "type": "email",
    "formIdentifier": "reg",
    "isActive": true,
    "isCheckCode": false,
    "config": {
      "deleteNoneActiveUsersAfterDays": 2,
      "systemCodeLength": 8,
      "systemCodeOnlyNumbers": null,
      "systemCodeTlsSec": 120
    }
  }
]

id: number object identifier example: 1764

localizeInfos: CommonLocalizeInfos block name with localization example: OrderedMap { "en_US": OrderedMap { "title": "My block" } }

version: number object version number example: 10

identifier: string textual identifier for the field record example: catalog default: marker

isActive: boolean Flag of usage example: false

isCheckCode: boolean a sign of user activation via a code example: false

type: string type of providere example: email

formIdentifier: string the marker of the form used by the provider (may be null) example: email


Blocks

const { Blocks } = defineOneEntry('your-url');

Blocks.getBlocks(type, langCode, offset, limit)

const value = await Blocks.getBlocks('forTextBlock')

This method return array of all blocks object. Available values of type : forCatalogProducts, forBasketPage, forErrorPage, forCatalogPages, forProductPreview, forProductPage, forSimilarProductBlock, forStatisticProductBlock, forProductBlock, forForm, forFormField, forNewsPage, forNewsBlock, forNewsPreview, forOneNewsPage, forUsualPage, forTextBlock, forSlider, forOrder, service

Example return:

{
  "total": 100,
  "items": [
    {
      "id": 1,
      "localizeInfos": {
        "title": "Block"
      },
      "version": 0,
      "position": 1,
      "identifier": "block",
      "type": "forTextBlock",
      "templateIdentifier": null,
      "isVisible": true,
      "attributeValues": {}
    }
  ]
}

total: number total number of found records example: 100

id: number object identifier example: 1764

attributeSetId: number identifier for the used attribute set example: 7

localizeInfos: CommonLocalizeInfos block name with localization example: OrderedMap { "en_US": OrderedMap { "title": "My block" } }

customSettings: BlockCustomSettings custom settings for different block types example: OrderedMap { "sliderDelay": 0, "sliderDelayType": "", "productQuantity": 4, "productSortType": "By_ID", "productSortOrder": "Descending", "productCountElementsPerRow": 10, "similarProductRules": List [ OrderedMap { "property": "Descending", "includes": "", "keywords": "", "strict": "" } ] }

version: number object version number example: 10

identifier: string textual identifier for the field record example: catalog default: marker

position: number position number (for sorting) example: 192

attributeValues: Record<string, string> array of attribute values from the index (presented as a pair of custom attribute identifier: attribute value) example: OrderedMap { "en_US": OrderedMap { "marker": OrderedMap { "value": "", "type": "string" } } }

type: string block type example: forNewsPage

templateIdentifier: string template marker used by the block (can be null) Enum: [ forCatalogProducts, forBasketPage, forErrorPage, forCatalogPages, forProductPreview, forProductPage, forSimilarProductBlock, forStatisticProductBlock, forProductBlock, forForm, forFormField, forNewsPage, forNewsBlock, forNewsPreview, forOneNewsPage, forUsualPage, forTextBlock, forSlider, service ] example: null


Blocks.getBlockByMarker(marker, langCode, offset, limit)

const value = await Blocks.getBlockByMarker('my-marker')

This method return one blocks object by marker.

Example return:

{
  "total": 1,
  "items": [
    {
      "id": 5,
      "localizeInfos": {
        "title": "Similar"
      },
      "version": 0,
      "position": 1,
      "identifier": "similar",
      "type": "forSimilarProductBlock",
      "templateIdentifier": "block-template",
      "isVisible": true,
      "attributeValues": {
        "block-text": {
          "type": "string",
          "value": "",
          "position": 0,
          "isProductPreview": false
        }
      },
      "countElementsPerRow": "1",
      "quantity": "2",
      "similarProducts": [
        {
          "id": 2,
          "localizeInfos": {
            "title": "Box"
          },
          "statusIdentifier": "sold",
          "statusLocalizeInfos": {
            "title": "Sold"
          },
          "attributeSetIdentifier": "products",
          "position": 2,
          "templateIdentifier": null,
          "shortDescTemplateIdentifier": null,
          "price": 148,
          "additional": {
            "prices": {
              "min": 120,
              "max": 150
            }
          },
          "sku": null,
          "isSync": true,
          "attributeValues": {
            "price": {
              "type": "integer",
              "value": 148,
              "position": 1,
              "isProductPreview": false
            },
            "product-name": {
              "type": "string",
              "value": "Box text",
              "position": 0,
              "isProductPreview": false
            },
            "currency_products": {
              "type": "string",
              "value": "$",
              "position": 2,
              "isProductPreview": false
            }
          },
          "isVisible": true
        }
      ]
    }
  ]
}

total: number total number of found records example: 100

id: number object identifier example: 1764

attributeSetId: number identifier for the used attribute set example: 7

localizeInfos: CommonLocalizeInfos block name with localization example: OrderedMap { "en_US": OrderedMap { "title": "My block" } }

customSettings: BlockCustomSettings custom settings for different block types example: OrderedMap { "sliderDelay": 0, "sliderDelayType": "", "productQuantity": 4, "productSortType": "By_ID", "productSortOrder": "Descending", "productCountElementsPerRow": 10, "similarProductRules": List [ OrderedMap { "property": "Descending", "includes": "", "keywords": "", "strict": "" } ] }

version: number object version number example: 10

identifier: string textual identifier for the field record example: catalog default: marker

position: number position number (for sorting) example: 192

attributeValues: Record<string, string> array of attribute values from the index (presented as a pair of custom attribute identifier: attribute value) example: OrderedMap { "en_US": OrderedMap { "marker": OrderedMap { "value": "", "type": "string" } } }

type: string block type example: forNewsPage

templateIdentifier: string template marker used by the block (can be null) Enum: [ forCatalogProducts, forBasketPage, forErrorPage, forCatalogPages, forProductPreview, forProductPage, forSimilarProductBlock, forStatisticProductBlock, forProductBlock, forForm, forFormField, forNewsPage, forNewsBlock, forNewsPreview, forOneNewsPage, forUsualPage, forTextBlock, forSlider, service ] example: null


Blocks.searchBlock(name, langCode)

const value = await Blocks.searchBlock('my-marker', 'en_US')

Quick search for block objects with limited output.

Example return:

[
  {
    "id": 1,
    "name": "my block",
    "identifier": "my-block"
  }
]

Events

const { Events } = defineOneEntry('your-url');

Events.getAllSubscriptions(limit, offset)

const value = await Events.getAllSubscriptions('test_event', 1, 1)

This method return all subscriptions to product.

Example return:

{
  "total": 100,
  "items": [
    {
      "eventMarker": "string",
      "productId": 0
    }
  ]
}

total: number Total number of records found

eventMarker: string Event marker

productId number Product identifier

Events.subscribeByMarker(marker, userId, productId)

const value = await Events.subscribeByMarker('test_event', 1, 1)

This method unsubscribes to the product event. Returns nothing if the unsubscription was successful.

Events.unsubscribeByMarker(marker, userId, productId)

const value = await Events.subscribeByMarker('test_event', 1, 1)

This method subscribes to the product event. Returns nothing if the subscription was successful.


FileUploading

const { FileUploading } = defineOneEntry('your-url');

FileUploading.upload(data, fileQuery)

const query = {
        type:"page",
        entity:"editor",
        id:3787,
        width:0,
        height:0,
        compress:true,
    }

const value = await FileUploading.upload(data, query)

This method uploads a file to a cloud file storage. Pass to the date the value obtained from input type "file". Data is file object (or array), learn more - File Object

Example return:

[
  {
    "filename": "string",
    "downloadLink": "string",
    "size": 0
  }
]

filename: string filename with relative path

downloadLink: string link for downloading the file

size number size of the file in bytes

FileUploading.delete(filename, fileQuery)

const query = {
        type:"page",
        entity:"editor",
        id:3787
    }


const value = await FileUploading.delete("file.png", query)

This void method delete a file from the cloud file storage.

FileUploading.getFile(id, type, entity, filename)

const value = await FileUploading.getFile(123, 'page', 'editor', 'file.png')

This method return file object by parameters.

Example return:

{
  "file": "string"
}

Forms

const { Forms } = defineOneEntry('your-url');

Forms.getAllForms(langCode, offset, limit)

const value = await Forms.getAllForms('en_US', 0, 30)

This method retrieves all form objects from the API. It returns a Promise that resolves to an array of FormEntity objects.

Example return:

[
  {
    "id": 1764,
    "attributeSetId": 0,
    "processingType": "email",
    "localizeInfos": {
      "title": "My Form",
      "titleForSite": "",
      "successMessage": "",
      "unsuccessMessage": "",
      "urlAddress": "",
      "database": "0",
      "script": "0"
    },
    "processingData": "Unknown Type: ProcessingData",
    "version": 10,
    "type": "data",
    "identifier": "catalog",
    "position": 192,
    "attributes": [
      {
        "type": "list",
        "marker": "l1",
        "position": 2,
        "settings": {},
        "listTitles": [
          {
            "title": "red",
            "value": 1,
            "position": 1,
            "extendedValue": null,
            "extendedValueType": null
          },
          {
            "title": "yellow",
            "value": 2,
            "position": 2,
            "extendedValue": null,
            "extendedValueType": null
          }
        ],
        "validators": {},
        "localizeInfos": {
          "title": "l1"
        }
      }
    ]
  }
]

id: number object identifier example: 1764

attributeSetId: number identifier of the attribute set used

processingType: string form processing type example: email

localizeInfos: FormLocalizeInfos form name with localization Enum: [ db, email, script ] example: OrderedMap { "en_US": OrderedMap { "title": "My Form", "titleForSite": "", "successMessage": "", "unsuccessMessage": "", "urlAddress": "", "database": "0", "script": "0" } }

processingData: ProcessingData form data

version: number object version number example: 10

identifier: string textual identifier for the record field example: catalog default: marker

position: number position number (for sorting) example: 192

position: string Form type example: 'data'

attributes: array of attribute values from the used attribute set for displaying the form (taking into account the specified language) example: List [ OrderedMap { "type": "list", "marker": "l1", "position": 2, "listTitles": List [ OrderedMap { "title": "red", "value": 1, "position": 1, "extendedValue": null, "extendedValueType": null }, OrderedMap { "title": "yellow", "value": 2, "position": 2, "extendedValue": null, "extendedValueType": null } ], "validators": OrderedMap {}, "localizeInfos": OrderedMap { "title": "l1" } } ]

Forms.getFormByMarker(marker, langCode)

const value = await Forms.getFormByMarker('My form', 'en_US')

This method retrieves a single form object based on its textual identifier (marker) from the API. It returns a Promise that resolves to a FormEntity object.

Example return:

{
  "id": 1764,
  "attributeSetId": 0,
  "processingType": "email",
  "localizeInfos": {
    "title": "My Form",
    "titleForSite": "",
    "successMessage": "",
    "unsuccessMessage": "",
    "urlAddress": "",
    "database": "0",
    "script": "0"
  },
  "processingData": "Unknown Type: ProcessingData",
  "version": 10,
  "type": "data",
  "identifier": "catalog",
  "position": 192,
  "attributes": [
    {
      "type": "list",
      "marker": "l1",
      "position": 2,
      "settings": {},
      "listTitles": [
        {
          "title": "red",
          "value": 1,
          "position": 1,
          "extendedValue": null,
          "extendedValueType": null
        },
        {
          "title": "yellow",
          "value": 2,
          "position": 2,
          "extendedValue": null,
          "extendedValueType": null
        }
      ],
      "validators": {},
      "localizeInfos": {
        "title": "l1"
      }
    }
  ]
}

id: number object identifier example: 1764

attributeSetId: number identifier of the attribute set used

processingType: string form processing type example: email

localizeInfos: FormLocalizeInfos form name with localization Enum: [ db, email, script ] example: OrderedMap { "en_US": OrderedMap { "title": "My Form", "titleForSite": "", "successMessage": "", "unsuccessMessage": "", "urlAddress": "", "database": "0", "script": "0" } }

processingData: ProcessingData form data

version: number object version number example: 10

identifier: string textual identifier for the record field example: catalog default: marker

position: number position number (for sorting) example: 192

position: string Form type example: 'data'

attributes: array of attribute values from the used attribute set for displaying the form (taking into account the specified language) example: List [ OrderedMap { "type": "list", "marker": "l1", "position": 2, "listTitles": List [ OrderedMap { "title": "red", "value": 1, "position": 1, "extendedValue": null, "extendedValueType": null }, OrderedMap { "title": "yellow", "value": 2, "position": 2, "extendedValue": null, "extendedValueType": null } ], "validators": OrderedMap {}, "localizeInfos": OrderedMap { "title": "l1" } } ]


FormData

const { FormData } = defineOneEntry('your-url');

Methods with a post request accept as the request body an object with the form data field, which corresponds to the type of information being sent. The following are examples of form data objects for different data types.


Example with a simple type attribute "string", "number", "float"

{
        "marker": "last_name",
        "type": "string",
        "value": "Username"
      }

Example with a simple type attribute "date", "dateTime", "time"

{
  "marker": "birthday",
  "type": "date",
  "value": {
    "fullDate": "2024-05-07T21:02:00.000Z",
    "formattedValue": "08-05-2024 00:02",
    "formatString": "DD-MM-YYYY HH:mm"
  }
}

Example with a simple type attribute "text"

{
  "marker": "about",
  "type": "text",
  "value": {
    "htmlValue": "<p>Hello world</p>",
    "plainValue": "",
    "params": {
      "isEditorDisabled": false,
      "isImageCompressed": true
    }
  }
}

Example with a simple type attribute "text"

{
  "marker": "about",
  "type": "text",
  "value": {
    "htmlValue": "<p>Hello world</p>",
    "plainValue": "",
    "params": {
      "isEditorDisabled": false,
      "isImageCompressed": true
    }
  }
}

Example with a simple type attribute "textWithHeader"

{
  "marker": "about",
  "type": "textWithHeader",
  "value": {
    "header": "Headline",
    "htmlValue": "<p>Hello World</p>",
    "plainValue": "",
    "params": {
      "isEditorDisabled": false,
      "isImageCompressed": true
    }
  }
}

Example with a simple type attribute "image" or "groupOfImages"

 {
  "marker": "avatar",
  "type": "image",
  "value": [
    {
      "filename": "files/project/page/10/image/Screenshot-from-2024-05-02-15-23-14.png",
      "downloadLink": "http://my-site.com/cloud-static/files/project/page/10/image/Screenshot-from-2024-05-02-15-23-14.png",
      "size": 392585,
      "previewLink": "",
      "params": {
        "isImageCompressed": true
      }
    }
  ]
}

Example with a simple type attribute "files"

 {
  "marker": "picture",
  "type": "file",
  "value": [
    {
      "filename": "files/project/page/10/image/Screenshot-from-2024-05-02-15-23-14.png",
      "downloadLink": "http://my-site.com/cloud-static/files/project/page/10/image/Screenshot-from-2024-05-02-15-23-14.png",
      "size": 392585
    }
  ]
}

Example with a simple type attribute "radioButton" or "list"

{
  "marker": "selector",
  "type": "list",
  "value": [
    {
      "title": "red",
      "value": "1",
      "extended": {
        "value": "red",
        "type": "string"
      }
    }
  ]
}

FormData.postFormsData(data, langCode)

const body = {
    formIdentifier: 'test',
    formData: {
        marker: 'test',
        value: 'Test',
        "type": "string"        
    },
}

const value = await FormData.postFormsData(body)

id: number object identifier example: 1764

formIdentifier: string text identifier of form object (marker) example: my-form

time: Date form change date and time example: 2023-02-12 10:56

formData: Data submitted by the form example: OrderedMap { "en_US": List [ OrderedMap { "marker": "naimenovanie_1", "type": "string", "value": "Name" } ] }

This method retrieves all form data objects from the API. It returns a Promise that resolves to an array of objects of type CreateFormData. The method will add the default language to the request body. If you want to change the language, just pass it with the second argument

Example return:

{
  "id": 1764,
  "formIdentifier": "my-form",
  "time": "2023-02-12 10:56",
  "formData": {
    "marker": "name_1",
    "value": "Name",
    "type": "string"
  }
}

id: number object identifier example: 1764

formIdentifier: string Text identifier of the form object (marker) example: my-form

time: Date Date and time of form modification example: 2023-02-12 10:56

formData: FormDataLangType Data submitted by the form example: OrderedMap { "en_US": List [ OrderedMap { "marker": "naimenovanie_1", "value": "Name" } ] }

FormData.getFormsData(langCode, offset, limit)

const value = await FormData.getFormsData('en_US', 0, 30)

This method creates form data objects by sending a request to the API. It accepts an array of objects of type IFormsPost as the request body to provide the necessary form data. It returns a Promise that resolves to the created CreateFormDataDto objects.

Example return:

{
  "total": 1,
  "items": [
    {
      "id": 1764,
      "formIdentifier": "my-form",
      "time": "2023-02-12 10:56",
      "formData": {
        "marker": "name_1",
        "value": "Name",
        "type": "string"
      },
      "attributeSetIdentifier": "test-form"
    }
  ]
}

total: number total number of found records example: 100

id: number object identifier example: 1764

formIdentifier: string Text identifier of the form object (marker) example: my-form

time: Date Date and time of form modification example: 2023-02-12 10:56

formData: FormDataLangType Data submitted by the form example: OrderedMap { "en_US": List [ OrderedMap { "marker": "naimenovanie_1", "value": "Name" } ] }

attributeSetIdentifier: string text identifier (marker) of the used attribute set example: test-form

FormData.getFormsDataByMarker(marker, langCode, offset, limit)

const value = await FormData.getFormsDataByMarker('my-marker', 'en_US', 0, 30)

This method retrieves a specific form data object by its marker from the API. It accepts a marker parameter as the marker of the form data. It returns a Promise that resolves to an array of objects of type FormDataEntity.

Example return:

{
  "total": 1,
  "items": [
    {
      "id": 1764,
      "formIdentifier": "my-form",
      "time": "2023-02-12 10:56",
      "formData": {
        "marker": "name_1",
        "value": "Name",
        "type": "string"
      },
      "attributeSetIdentifier": "test-form"
    }
  ]
}

total: number total number of found records example: 100

id: number object identifier example: 1764

formIdentifier: string Text identifier of the form object (marker) example: my-form

time: Date Date and time of form modification example: 2023-02-12 10:56

formData: FormDataLangType Data submitted by the form example: OrderedMap { "en_US": List [ OrderedMap { "marker": "naimenovanie_1", "value": "Name" } ] }

attributeSetIdentifier: string text identifier (marker) of the used attribute set example: test-form


GeneralTypes

const { GeneralTypes } = defineOneEntry('your-url');

GeneralTypes.getAllTypes()

const value = await GeneralTypes.getAllTypes()

This method retrieves all objects of type GeneralTypeEntity from the API. It returns a Promise that resolves to an array of GeneralTypeEntity objects.

Example return:

[
  {
    "id": 1,
    "type": "forNewsPage"
  }
]

id: number object identifier example: 1764

type: string type value example: forNewsPage Enum: [ forCatalogProducts, forBasketPage, forErrorPage, forCatalogPages, forProductPreview, forProductPage, forSimilarProductBlock, forStatisticProductBlock, forProductBlock, forForm, forFormField, forNewsPage, forNewsBlock, forNewsPreview, forOneNewsPage, forUsualPage, forTextBlock, forSlider, service ]


Locales

const { Locales } = defineOneEntry('your-url');

Locales.getLocales()

const value = await Locales.getLocales()

This method retrieves all active language localization objects from the API. It returns a Promise that resolves to an array of LocaleEntity objects.

Example return:

[
    {
      "id": 1764,
      "shortCode": "en",
      "code": "en_US",
      "name": "Bengali",
      "nativeName": "বাংলা",
      "isActive": false,
      "image": "🇦🇨",
      "position": 1
    }
]

id: number object identifier example: 1764

shortCode: string language code (short) example: en

code: string language code with country code example: en_US

name string Language name (in English) example: Bengali

nativeName string Language name (in native language) example: বাংলা

isActive: boolean Flag of usage example: false

image: string Graphic image of the language (under development) example: 🇦🇨

position: { description:position number }


Menus

const { Menus } = defineOneEntry('your-url')

Menus.getMenusByMarker(marker)

const value = await Menus.getMenusByMarker('my-marker')

This method retrieves a single menu object based on its marker (marker) from the API. It returns a Promise that resolves to a single menu object as a ContentMenuDto object with included pages.

Example return:

{
  "id": 1764,
  "identifier": "catalog",
  "localizeInfos": {
    "title": "Main Menu"
  },
  "pages": [
    {
      "id": 11,
      "pageUrl": "122",
      "localizeInfos": {
        "title": "12",
        "content": "",
        "menuTitle": "12"
      },
      "position": 0,
      "parentId": null
    }
  ]
}

id: number object identifier example: 1764

identifier: string textual identifier for a record field example: catalog

localizeInfos Record<string, any> json object description of the menu item with the language "en_US" (for example) example: OrderedMap { "en_US": OrderedMap { "title": "Main Menu" } }

pages: data of the pages included in the menu example: List [ OrderedMap { "id": 11, "pageUrl": "122", "localizeInfos": OrderedMap { "en_US": OrderedMap { "title": "12", "plainContent": "Content for catalog", "htmlContent": "Content for catalog", "menuTitle": "12" } }, "position": 0, "parentId": null } ]


Orders

const { Orders } = defineOneEntry('your-url');

Orders.getOrderByMarker(marker, langCode)

const value = await Orders.getOrderByMarker('my-order')

This method retrieves one order storage object by marker.

Example return:

{
  "id": 2,
  "localizeInfos": {
    "title": "My order"
  },
  "position": 1,
  "identifier": "my_order",
  "formIdentifier": "orderForm",
  "generalTypeId": 21,
  "paymentAccountIdentifiers": [
    {
      "identifier": "cash"
    }
  ]
}

id: number object identifier example: 1764

localizeInfos: Record<string, any> json description of the main page data object taking into account the language "en_US" (for example) example: OrderedMap { "en_US": OrderedMap { "title": "Catalog", "plainContent": "Content for catalog", "htmlContent": "Content for catalog", "menuTitle": "Catalog" } }

identifier string textual identifier for the record field example: catalog

generalTypeId number type identifier example: 4

formIdentifier string textual identifier for the form used by the order storage example: catalog-form

paymentAccountIdentifiers Array<{identifier:string} array of textual identifiers of payment accounts used by the order storage example: [{ "identifier": "p1" }]

Orders.createOrder(marker, data, langCode)

 const body = {
    "formIdentifier": "orderForm",
    "paymentAccountIdentifier": "cash",
    "formData": {
        "marker": "order_name",
        "value": "Ivan",
        "type": "string"
    },
    "products": [
        {
            "productId": 2,
            "quantity": 2
        }
    ]
}

const value = await Orders.createOrder('my-order', body)

formIdentifier: string text identifier of the form object linked to the order storage example: bars

paymentAccountIdentifier: string text identifier of the payment object linked to the order storage example: payment1

statusIdentifier string text identifier of the order status object (if not specified, the default status will be assigned) example: inprogress

formData FormDataType data submitted by the form linked to the order store example: [{ "marker": "name_1", "value": "Name" } ]

products Record<string, string | any>[] array of products added to order

productId number product identifier example: 12.00

quantity number quantity of the product example: 1

This method retrieves one order storage object by marker. The method will add the default language to the request body. If you want to change the language, just pass it with the second argument

Example return:

{
  "formIdentifier": "bars",
  "paymentAccountIdentifier": "payment1",
  "statusIdentifier": "inprogress",
  "formData": [
      {
        "marker": "naimenovanie_1",
        "type": "string",
        "value": "Name"
      }
  ],
  "products": [
    {
      "productId": 1,
      "quantity": 2
    },
    {
      "productId": 2,
      "quantity": 3
    }
  ],
  "createdDate": "2024-06-21T09:42:54.848Z",
  "currency": "USD",
  "totalSum": 345
}

statusIdentifier: string text identifier of the order status example: inprogress

formIdentifier: string text identifier of the form status example: order-form

paymentAccountIdentifier string text identifier of the order payment example: payment-1

formData FormDataType data submitted by the form linked to the order store example: [{ "marker": "name_1", "value": "Name" } ]

products Record<string, string | any>[] array of products added to order

totalSum string total order amount example: 12.00

currency string currency used to pay for the order example: USD

createdDate string date when the order was created example: 2023-01-01 12:12

Orders.updateOrderByMarkerAndId(marker, data, langCode)

const body = {
    "formIdentifier": "orderForm",
    "paymentAccountIdentifier": "cash",
    "formData": {
        "marker": "order_name",
        "value": "Ivan",
        "type": "string"
    },
    "products": [
        {
            "productId": 2,
            "quantity": 2
        }
    ]
}

const value = await Orders.updateOrderByMarkerAndId('my-order', body)

formIdentifier: string text identifier of the form object linked to the order storage example: bars

paymentAccountIdentifier: string text identifier of the payment object linked to the order storage example: payment1

statusIdentifier string text identifier of the order status object (if not specified, the default status will be assigned) example: inprogress

formData FormDataType data submitted by the form linked to the order store example: [{ "marker": "name_1", "value": "Name" } ]

products Record<string, string | any>[] array of products added to order

productId number product identifier example: 12.00

quantity number quantity of the product example: 1

This method update one order storage object by marker. The method will add the default language to the request body. If you want to change the language, just pass it with the second argument

Example return:

{
  "formIdentifier": "bars",
  "paymentAccountIdentifier": "payment1",
  "statusIdentifier": "inprogress",
  "formData": [
      {
        "marker": "naimenovanie_1",
        "type": "string",
        "value": "Name"
      }
  ],
  "products": [
    {
      "productId": 1,
      "quantity": 2
    },
    {
      "productId": 2,
      "quantity": 3
    }
  ],
  "createdDate": "2024-06-21T09:42:54.848Z",
  "currency": "USD",
  "totalSum": 345
}

statusIdentifier: string text identifier of the order status example: inprogress

formIdentifier: string text identifier of the form status example: order-form

paymentAccountIdentifier string text identifier of the order payment example: payment-1

formData FormDataType data submitted by the form linked to the order store example: [{ "marker": "name_1", "value": "Name" } ]

products Record<string, string | any>[] array of products added to order

totalSum string total order amount example: 12.00

currency string currency used to pay for the order example: USD

createdDate string date when the order was created example: 2023-01-01 12:12

Orders.getOrderByMarkerAndId(marker, id, langCode)

const value = await Orders.getOrderByMarkerAndId('my-order', 1764)

This method retrieves one order storage object by marker and id.

Example return:

{
  "id": 1764,
  "statusIdentifier": "inprogress",
  "formIdentifier": "order-form",
  "formData": [
    {
      "marker": "name_1",
      "type": "string",
      "value": "Name"
    }
  ],
  "products": [
    {
      "id": 1,
      "title": "Floorwood Maxima Laminate, 9811 Oak Mistral",
      "sku": null,
      "price": "1.00",
      "quantity": 10,
      "previewImage": [
        {
          "filename": "files/project/page/36/image/20240322_77c83b02-4c82-4bea-80eb-3763c469b00e.jpg",
          "downloadLink": "http://my-site.zone/files/project/page/36/image/20240322_77c83b02-4c82-4bea-80eb-3763c469b00e.jpg",
          "size": 296391,
          "previewLink": ""
        }
      ]
    }
  ],
  "totalSum": "12.00",
  "currency": "USD",
  "createdDate": "2023-01-01 12:12",
  "paymentAccountIdentifier": "payment-1",
  "paymentAccountLocalizeInfos": {
    "en_US": {
      "title": "Account 1"
    }
  },
  "isHistory": true
}

id: number object identifier example: 1764

localizeInfos: Record<string, any> json description of the main page data object taking into account the language "en_US" (for example) example: OrderedMap { "en_US": OrderedMap { "title": "Catalog", "plainContent": "Content for catalog", "htmlContent": "Content for catalog", "menuTitle": "Catalog" } }

identifier string textual identifier for the record field example: catalog

generalTypeId number type identifier example: 4

formIdentifier string textual identifier for the form used by the order storage example: catalog-form

paymentAccountIdentifiers Array<{identifier:string} array of textual identifiers of payment accounts used by the order storage example: [{ "identifier": "p1" }]

Orders.getAllOrdersStorage(langCode, limit, offset)

const value = await Orders.getAllOrdersStorage()

This method getting all the order storage objects. The method will add the default language to the request body. If you want to change the language, just pass it with the second argument

Example return:

[
  {
    "id": 1764,
    "localizeInfos": {
        "title": "Order 1"
    },
    "identifier": "catalog",
    "generalTypeId": 4,
    "formIdentifier": "catalog-form",
    "paymentAccountIdentifiers": [
      {
        "identifier": "p1"
      }
    ]
  }
]

id: number object identifier example: 1764

localizeInfos: Record<string, any> json description of the main page data object taking into account the language "en_US" (for example) example: OrderedMap { "en_US": OrderedMap { "title": "Catalog", "plainContent": "Content for catalog", "htmlContent": "Content for catalog", "menuTitle": "Catalog" } }

identifier string textual identifier for the record field example: catalog

generalTypeId number type identifier example: 4

formIdentifier string textual identifier for the form used by the order storage example: catalog-form

paymentAccountIdentifiers Array<{identifier:string} array of textual identifiers of payment accounts used by the order storage example: [{ "identifier": "p1" }]

Orders.getAllOrdersByMarker(marker, langCode, limit, offset)

const value = await Orders.getAllOrdersByMarker('my-order')

This method getting all order storage object by marker. The method will add the default language to the request body. If you want to change the language, just pass it with the second argument

Example return:

{
  "total": 100,
  "items": [
    {
      "id": 1764,
      "statusIdentifier": "inprogress",
      "formIdentifier": "order-form",
      "formData": [
        {
          "marker": "name_1",
          "type": "string",
          "value": "Name"
        }
      ],
      "products": [
        {
          "id": 1,
          "title": "Laminate Floorwood Maxima, 9811 Oak Mistral",
          "sku": null,
          "price": "1.00",
          "quantity": 10,
          "previewImage": [
            {
              "filename": "files/project/page/36/image/20240322_77c83b02-4c82-4bea-80eb-3763c469b00e.jpg",
              "downloadLink": "http://my-site.zone/files/project/page/36/image/20240322_77c83b02-4c82-4bea-80eb-3763c469b00e.jpg",
              "size": 296391,
              "previewLink": ""
            }
          ]
        }
      ],
      "totalSum": "12.00",
      "currency": "USD",
      "createdDate": "2023-01-01 12:12",
      "paymentAccountIdentifier": "payment-1",
      "paymentAccountLocalizeInfos": {"title": "Account 1"
      },
      "isHistory": true
    }
  ]

}

total: number total number of found records example: 100

statusIdentifier: string text identifier of the order status example: inprogress

formIdentifier: string text identifier of the form status example: order-form

formData FormDataType data submitted by the form linked to the order store example: [{ "marker": "name_1", "value": "Name" } ]

products Record<string, string | any>[] array of products added to order

totalSum string total order amount example: 12.00

currency string currency used to pay for the order example: USD

createdDate string date when the order was created example: 2023-01-01 12:12

price number price of the product per unit (at the time of ordering) example: 20.00

paymentAccountIdentifier string textual identifier for the order payment example: payment-1

paymentAccountLocalizeInfos CommonLocalizeInfos payment account name considering localization example: { "title": "Account 1" }

isHistory boolean indicates that the order has been saved in the order history example: true


Pages

const { Pages } = defineOneEntry('your-url');

Pages.getRootPages(langCode)

const value = await Pages.getRootPages('en_US')

This method retrieves all top-level page objects from the API. It returns a Promise that resolves to an array of ContentIndexedPageDto objects or an empty array [] if there is no data. Get required language parameter.

Example return:

[
  {
    "id": 1,
    "config": {},
    "depth": 0,
    "parentId": null,
    "pageUrl": "blog",
    "attributeSetIdentifier": "page",
    "localizeInfos": {