Skip to content

Commit

Permalink
Merge 32d1506 into 8f6c1b0
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaszjedrasik committed Mar 17, 2021
2 parents 8f6c1b0 + 32d1506 commit b7bf455
Show file tree
Hide file tree
Showing 13 changed files with 5,894 additions and 6,256 deletions.
11,993 changes: 5,841 additions & 6,152 deletions packages/core/docs/commercetools/api-client-reference.md

Large diffs are not rendered by default.

27 changes: 6 additions & 21 deletions packages/core/docs/commercetools/composables/use-cart.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,7 @@ type ProductVariant = {
attributeList: Array<Attribute>;
}

type CustomQuery = (query, variables) => {
query?;
variables?;
}
type CustomQuery = Record<string, string>
```
- `updateItemQty` - function for updating quantity of a product that is already in the cart. This method accepts a single `params` object. The `params` has the following options:
Expand Down Expand Up @@ -133,10 +130,7 @@ type LineItem = {
customFieldList?: Maybe<Array<CustomField>>;
}

type CustomQuery = (query, variables) => {
query?;
variables?;
}
type CustomQuery = Record<string, string>
```
- `removeItem` - function for removing a product that currently is in the cart. This method accepts a single `params` object. The `params` has the following options:
Expand Down Expand Up @@ -177,13 +171,10 @@ type LineItem = {
customFieldList?: Maybe<Array<CustomField>>;
}

type CustomQuery = (query, variables) => {
query?;
variables?;
}
type CustomQuery = Record<string, string>
```
- `isOnCart` - function for checking if a product is currently in the cart. This method accepts a single `params` object. The `params` has the following option:
- `isInCart` - function for checking if a product is currently in the cart. This method accepts a single `params` object. The `params` has the following option:
- `product: ProductVariant`
Expand Down Expand Up @@ -213,10 +204,7 @@ type ProductVariant = {
- `customQuery?: CustomQuery`
```ts
type CustomQuery = (query, variables) => {
query?;
variables?;
}
type CustomQuery = Record<string, string>
```
- `removeCoupon` - function for removing coupon applied to cart. This method accepts a single `params` object. The `params` has the following options:
Expand All @@ -233,10 +221,7 @@ interface AgnosticCoupon {
value: number;
}

type CustomQuery = (query, variables) => {
query?;
variables?;
}
type CustomQuery = Record<string, string>
```
- `loading: boolean` - a reactive object containing information about loading state of the cart.
Expand Down
5 changes: 1 addition & 4 deletions packages/core/docs/commercetools/composables/use-category.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,7 @@
- `customQuery?: CustomQuery`

```ts
type CustomQuery = (query, variables) => {
query?;
variables?;
}
type CustomQuery = Record<string, string>
```
- `categories: Category[]` - a main data object that contains an array of categories fetched by `search` method.
Expand Down
20 changes: 16 additions & 4 deletions packages/core/docs/commercetools/composables/use-product.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,7 @@ interface ProductsSearchParams {
id?: string;
}

type CustomQuery = (query, variables) => {
query?;
variables?;
}
type CustomQuery = Record<string, string>
```
- `products: ProductVariant[]` - a main data object that contains an array of products fetched by `search` method.
Expand Down Expand Up @@ -121,6 +118,21 @@ interface AgnosticAttribute {
label: string;
}

type ProductVariant = {
__typename?: "ProductVariant";
id: Scalars["Int"];
key?: Maybe<Scalars["String"]>;
sku?: Maybe<Scalars["String"]>;
prices?: Maybe<Array<ProductPrice>>;
price?: Maybe<ProductPrice>;
images: Array<Image>;
assets: Array<Asset>;
availability?: Maybe<ProductVariantAvailabilityWithChannels>;
attributesRaw: Array<RawProductAttribute>;
attributes: ProductType;
attributeList: Array<Attribute>;
}

interface ProductVariantFilters {
master?: boolean;
attributes?: Record<string, string>;
Expand Down
11 changes: 6 additions & 5 deletions packages/core/docs/commercetools/composables/use-review.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,23 @@

- `searchParams: ReviewSearchParams`

- `customQuery?: CustomQuery`

```typescript
interface ReviewSearchParams {
productId: string;
limit?: number;
offset?: number;
}

type CustomQuery = Record<string, string>
```
- `addReview` - function for posting new review. When invoked, it submits data to the API and populates `reviews` property with updated information. This method accepts a single params object. The `params` has the following options:
- `params: ReviewAddParams`
- `customQueryFn?: CustomQueryFn`
- `customQuery?: CustomQuery`
```typescript
interface ReviewAddParams {
Expand All @@ -46,10 +50,7 @@ interface ReviewDraft {
rating: number;
}

type CustomQueryFn = (query, variables) => {
query?;
variables?;
}
type CustomQuery = Record<string, string>
```
- `reviews: Review[]` - reactive data object containing the response from the backend.
Expand Down
28 changes: 4 additions & 24 deletions packages/core/docs/commercetools/composables/use-user-billing.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

- `address: BillingAddressAddParams`

- `customQueryFn?: CustomQueryFn`
- `customQuery?`

```typescript
interface BillingAddressAddParams {
Expand All @@ -35,37 +35,27 @@ interface BillingAddressAddParams {
isDefault?: boolean;
}
}

type CustomQueryFn = (query, variables) => {
query?;
variables?;
}
```

- `deleteAddress` - function for deleting existing billing address. This method accepts a single `params` object. The `params` has the following options:

- `address: BillingAddressDeleteParams`

- `customQueryFn?: CustomQueryFn`
- `customQuery?`

```typescript
interface BillingAddressDeleteParams {
address: {
id: string;
}
}

type CustomQueryFn = (query, variables) => {
query?;
variables?;
}
```

- `updateAddress` - function for updating existing billing address. This method accepts a single `params` object. The `params` has the following options:

- `address: BillingAddressUpdateParams`

- `customQueryFn?: CustomQueryFn`
- `customQuery?`

```typescript
interface BillingAddressUpdateParams {
Expand All @@ -83,30 +73,20 @@ interface BillingAddressUpdateParams {
isDefault?: boolean;
}
}

type CustomQueryFn = (query, variables) => {
query?;
variables?;
}
```

- `setDefaultAddress` - function for settings an existing billing address as default. This method accepts a single `params` object. The `params` has the following options:

- `address: BillingAddressSetDefaultParams`

- `customQueryFn?: CustomQueryFn`
- `customQuery?`

```typescript
interface BillingAddressSetDefaultParams {
address: {
id: string;
}
}

type CustomQueryFn = (query, variables) => {
query?;
variables?;
}
```
- `billing: User` - reactive data object containing response from the backend.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,7 @@ type OrderSearchParams = {
perPage?: number;
}

type CustomQuery = (query, variables) => {
query?;
variables?;
}
type CustomQuery = Record<string, string>
```
- `orders: Order[]` - a main data object that contains an array of orders fetched by `searchOrders` method.
Expand Down
28 changes: 4 additions & 24 deletions packages/core/docs/commercetools/composables/use-user-shipping.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

- `address: ShippingAddressAddParams`

- `customQueryFn?: CustomQueryFn`
- `customQuery?`

```typescript
interface ShippingAddressAddParams {
Expand All @@ -35,37 +35,27 @@ interface ShippingAddressAddParams {
isDefault?: boolean;
}
}

type CustomQueryFn = (query, variables) => {
query?;
variables?;
}
```

- `deleteAddress` - function for deleting existing shipping address. This method accepts a single `params` object. The `params` has the following options:

- `address: ShippingAddressDeleteParams`

- `customQueryFn?: CustomQueryFn`
- `customQuery?`

```typescript
interface ShippingAddressDeleteParams {
address: {
id: string;
}
}

type CustomQueryFn = (query, variables) => {
query?;
variables?;
}
```

- `updateAddress` - function for updating existing shipping address. This method accepts a single `params` object. The `params` has the following options:

- `address: ShippingAddressUpdateParams`

- `customQueryFn?: CustomQueryFn`
- `customQuery?`

```typescript
interface ShippingAddressUpdateParams {
Expand All @@ -83,30 +73,20 @@ interface ShippingAddressUpdateParams {
isDefault?: boolean;
}
}

type CustomQueryFn = (query, variables) => {
query?;
variables?;
}
```

- `setDefaultAddress` - function for settings an existing shipping address as default. This method accepts a single `params` object. The `params` has the following options:

- `address: ShippingAddressSetDefaultParams`

- `customQueryFn?: CustomQueryFn`
- `customQuery?

```typescript
interface ShippingAddressSetDefaultParams {
address: {
id: string;
}
}

type CustomQueryFn = (query, variables) => {
query?;
variables?;
}
```

- `shipping: User` - reactive data object containing response from the backend.
Expand Down
17 changes: 4 additions & 13 deletions packages/core/docs/commercetools/composables/use-wishlist.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,7 @@ type Wishlist = ShoppingList;
- `customQuery?: CustomQuery`

```ts
type CustomQuery = (query, variables) => {
query?;
variables?;
}
type CustomQuery = Record<string, string>
```
- `addItem` - function used to add new product to wishlist. When invoked, it submits data to the API and populates `wishlist` property with updated information. This method accepts a single `params` object. The `params` has the following options:
Expand All @@ -76,10 +73,7 @@ type ProductVariant = {
attributeList: Array<Attribute>;
}

type CustomQuery = (query, variables) => {
query?;
variables?;
}
type CustomQuery = Record<string, string>
```
- `removeItem` - function that removes products from the wishlist. It submits data to the API and populates updated `wishlist` property. This method accepts a single `params` object. The `params` has the following options:
Expand Down Expand Up @@ -120,15 +114,12 @@ type LineItem = {
customFieldList?: Maybe<Array<CustomField>>;
}

type CustomQuery = (query, variables) => {
query?;
variables?;
}
type CustomQuery = Record<string, string>
```
- `clear` - function that removes all products from the wishlist and populates clear `wishlist` property.
- `isOnWishlist` - function that checks if product is on the wishlist. It returns boolean value. This method accepts a single `params` object. The `params` has the following option:
- `isInWishlist` - function that checks if product is on the wishlist. It returns boolean value. This method accepts a single `params` object. The `params` has the following option:
- `product: ProductVariant`
Expand Down
4 changes: 2 additions & 2 deletions packages/core/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
"scripts": {
"dev": "vuepress dev",
"build": "vuepress build",
"ct-api-client-tdoc": "node ./scripts/generateCtApiRef",
"ct-api-client-gen": "concat-md --join-string '' ./commercetools/api-client-reference > ./commercetools/api-client-reference.md && rm -r ./commercetools/api-client-reference && node typedoc-vsf-theme/removeText"
"ct-api-client-tdoc": "node ./scripts/generateCtApiRef && rm -r ./commercetools/api-client-reference/enums && rm -r ./commercetools/api-client-reference/README.md && mv ./commercetools/api-client-reference/modules ./commercetools/api-client-reference/1modules",
"ct-api-client-gen": "concat-md --join-string '' ./commercetools/api-client-reference/ > ./commercetools/api-client-reference.md && node typedoc-vsf-theme/removeText && rm -r ./commercetools/api-client-reference"
},
"devDependencies": {
"@vue-storefront/commercetools-api": "^1.2.0-rc.1",
Expand Down
8 changes: 7 additions & 1 deletion packages/core/docs/typedoc-vsf-theme/helpers/helpers.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
const Handlebars = require('handlebars');

const re = /(api\/|types\/)/g;

Handlebars.registerHelper('split', (string) => {
const re = /(api\/|types\/)/g;
if (string.search(re) !== -1) return string.split('/')[1];
else return string;
});

Handlebars.registerHelper('heading', (string) => {
if (string.search(re) !== -1) return '##';
else return '###';
});
2 changes: 1 addition & 1 deletion packages/core/docs/typedoc-vsf-theme/partials/title.hbs
Original file line number Diff line number Diff line change
@@ -1 +1 @@
## `{{ model.name }}`
{{ heading model.name }} `{{ split model.name }}`

0 comments on commit b7bf455

Please sign in to comment.