1.2.12 • Published 3 years ago

@brizy/sylius-sdk v1.2.12

Weekly downloads
-
License
ISC
Repository
-
Last release
3 years ago

BrizyCloud Sylius SDK

Development

Pre requests

  • You need to use the git@github.com:GheorgheP/openapi-typescript-codegen.git version of openapi-typescript-codegen. This is due to the fact that original package doesn't support ld+json. For this you need to clone openapi-typescript-codegen and link with brizy-cloud-sylius-js-sdk using npm link

  • Also make sur to replace everywhere from application/json to application/ld+json

Code generator

  1. Code generator should be run using APP_API_ENDPOINT=[SYLIUS API ENDPOINT] npm run generate.\ APP_API_ENDPOINT - Sylius API endpoint to the docs. URL should end with .json, so the documentation with be generated in JSON format.\ E.g. APP_API_ENDPOINT=https://my-sylius.com/api/v2/docs.json npm run generate.

  2. Current code generator has some bugs when comes to generate parameters with union types:\ state: string | Array<string>. It will generate 2 parameters with same name but different types.\ E.g.:

public static async adminGetShipmentCollection({
    state,
    state,
    orderChannelCode,
    orderChannelCode,
    methodCode,
    methodCode,
    page = 1,
    itemsPerPage = 30,
}: {
    state?: string,
    state?: Array<string>,
    orderChannelCode?: string,
    orderChannelCode?: Array<string>,
    methodCode?: string,
    methodCode?: Array<string>,
    /** The collection page number **/
    page?: number,
    /** The number of items per page **/
    itemsPerPage?: number,
})

At the moment we need to fic this manually. The fix is very simple, we need to remove one of the duplicate.

!Important: When it comes to choose from string and Array<string>, you need to pick Array<string>.

Here is the correct fix:

public static async adminGetShipmentCollection({
    state,
    orderChannelCode,
    methodCode,
    page = 1,
    itemsPerPage = 30,
}: {
    state?: Array<string>,
    orderChannelCode?: Array<string>,
    methodCode?: Array<string>,
    /** The collection page number **/
    page?: number,
    /** The number of items per page **/
    itemsPerPage?: number,
})
1.2.12

3 years ago

1.2.11

3 years ago

1.2.10

3 years ago

1.2.9

3 years ago

1.2.8

3 years ago

1.2.7

3 years ago

1.2.6

3 years ago

1.2.5

3 years ago

1.2.4

3 years ago

1.2.3

3 years ago

1.2.2

3 years ago

1.2.1

3 years ago

1.1.11

3 years ago

1.1.10

3 years ago

1.1.9

3 years ago

1.1.8

3 years ago

1.1.7

3 years ago

1.1.6

3 years ago

1.1.5

3 years ago

1.1.4

3 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.0

3 years ago