Skip to content

Commit

Permalink
docs: added entity reference (medusajs#2047)
Browse files Browse the repository at this point in the history
* added entity reference

* chore: added github action

* added link to reference
  • Loading branch information
shahednasser authored Aug 15, 2022
1 parent 4a89961 commit 4a416e7
Show file tree
Hide file tree
Showing 101 changed files with 12,704 additions and 4 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/generate-entity-reference.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Generate Entity Reference
on:
push:
branches:
- "master"
paths:
- packages/medusa/src/models/**
pull_request:
types:
- closed
branches:
- "master"
paths:
- packages/medusa/src/models/**
jobs:
services:
runs-on: ubuntu-latest
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.9.1
with:
access_token: ${{ github.token }}

- name: Checkout
uses: actions/checkout@v2.3.5
with:
fetch-depth: 0

- name: Setup Node.js environment
uses: actions/setup-node@v2.4.1
with:
node-version: "14"
cache: "yarn"

- name: Install dependencies
uses: ./.github/actions/cache-deps
with:
extension: reference

- name: Build Packages
run: yarn build

- name: Generate Entities Reference
run: yarn generate:entities

- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
with:
commit-message: 'chore(docs): Generated Entities Reference (automated)'
base: 'master'
title: 'chore(docs): Generated Entities Reference (automated)'
labels: 'type: chore'
add-paths: docs/content/references/entities/**
2 changes: 1 addition & 1 deletion .github/workflows/generate-reference.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Generate Reference
name: Generate Services Reference
on:
push:
branches:
Expand Down
4 changes: 2 additions & 2 deletions docs/content/advanced/backend/entities.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,6 @@ await postRepository.softDelete(post.id);

## What’s Next 🚀

- Check out Medusa's entities in the [Entities' reference](../../references/entities/classes/Address.md).
- Learn about [migrations](migrations.md).
- Learn more about [Services](services/create-service.md) and how to use them.
- Learn how to create an endpoint for [storefront](endpoints/add-storefront.md) and [admin](endpoints/add-admin.md).
- Learn about [migrations](migrations.md).
1 change: 1 addition & 0 deletions docs/content/references/entities/.nojekyll
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
TypeDoc added this file to prevent GitHub Pages from using Jekyll. You can turn off this behavior by setting the `githubPages` option to false.
231 changes: 231 additions & 0 deletions docs/content/references/entities/classes/Address.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,231 @@
---
displayed_sidebar: entitiesSidebar
---

# Class: Address

## Hierarchy

- `SoftDeletableEntity`

**`Address`**

## Constructors

### constructor

**new Address**()

#### Inherited from

SoftDeletableEntity.constructor

## Properties

### address\_1

**address\_1**: ``null`` \| `string`

#### Defined in

[models/address.ts:120](https://github.com/medusajs/medusa/blob/0703dd94e/packages/medusa/src/models/address.ts#L120)

___

### address\_2

**address\_2**: ``null`` \| `string`

#### Defined in

[models/address.ts:123](https://github.com/medusajs/medusa/blob/0703dd94e/packages/medusa/src/models/address.ts#L123)

___

### city

**city**: ``null`` \| `string`

#### Defined in

[models/address.ts:126](https://github.com/medusajs/medusa/blob/0703dd94e/packages/medusa/src/models/address.ts#L126)

___

### company

**company**: ``null`` \| `string`

#### Defined in

[models/address.ts:111](https://github.com/medusajs/medusa/blob/0703dd94e/packages/medusa/src/models/address.ts#L111)

___

### country

**country**: ``null`` \| [`Country`](Country.md)

#### Defined in

[models/address.ts:133](https://github.com/medusajs/medusa/blob/0703dd94e/packages/medusa/src/models/address.ts#L133)

___

### country\_code

**country\_code**: ``null`` \| `string`

#### Defined in

[models/address.ts:129](https://github.com/medusajs/medusa/blob/0703dd94e/packages/medusa/src/models/address.ts#L129)

___

### created\_at

**created\_at**: `Date`

#### Inherited from

SoftDeletableEntity.created\_at

#### Defined in

[interfaces/models/base-entity.ts:16](https://github.com/medusajs/medusa/blob/0703dd94e/packages/medusa/src/interfaces/models/base-entity.ts#L16)

___

### customer

**customer**: ``null`` \| [`Customer`](Customer.md)

#### Defined in

[models/address.ts:108](https://github.com/medusajs/medusa/blob/0703dd94e/packages/medusa/src/models/address.ts#L108)

___

### customer\_id

**customer\_id**: ``null`` \| `string`

#### Defined in

[models/address.ts:104](https://github.com/medusajs/medusa/blob/0703dd94e/packages/medusa/src/models/address.ts#L104)

___

### deleted\_at

**deleted\_at**: ``null`` \| `Date`

#### Inherited from

SoftDeletableEntity.deleted\_at

#### Defined in

[interfaces/models/soft-deletable-entity.ts:7](https://github.com/medusajs/medusa/blob/0703dd94e/packages/medusa/src/interfaces/models/soft-deletable-entity.ts#L7)

___

### first\_name

**first\_name**: ``null`` \| `string`

#### Defined in

[models/address.ts:114](https://github.com/medusajs/medusa/blob/0703dd94e/packages/medusa/src/models/address.ts#L114)

___

### id

**id**: `string`

#### Inherited from

SoftDeletableEntity.id

#### Defined in

[interfaces/models/base-entity.ts:13](https://github.com/medusajs/medusa/blob/0703dd94e/packages/medusa/src/interfaces/models/base-entity.ts#L13)

___

### last\_name

**last\_name**: ``null`` \| `string`

#### Defined in

[models/address.ts:117](https://github.com/medusajs/medusa/blob/0703dd94e/packages/medusa/src/models/address.ts#L117)

___

### metadata

**metadata**: `Record`<`string`, `unknown`\>

#### Defined in

[models/address.ts:145](https://github.com/medusajs/medusa/blob/0703dd94e/packages/medusa/src/models/address.ts#L145)

___

### phone

**phone**: ``null`` \| `string`

#### Defined in

[models/address.ts:142](https://github.com/medusajs/medusa/blob/0703dd94e/packages/medusa/src/models/address.ts#L142)

___

### postal\_code

**postal\_code**: ``null`` \| `string`

#### Defined in

[models/address.ts:139](https://github.com/medusajs/medusa/blob/0703dd94e/packages/medusa/src/models/address.ts#L139)

___

### province

**province**: ``null`` \| `string`

#### Defined in

[models/address.ts:136](https://github.com/medusajs/medusa/blob/0703dd94e/packages/medusa/src/models/address.ts#L136)

___

### updated\_at

**updated\_at**: `Date`

#### Inherited from

SoftDeletableEntity.updated\_at

#### Defined in

[interfaces/models/base-entity.ts:19](https://github.com/medusajs/medusa/blob/0703dd94e/packages/medusa/src/interfaces/models/base-entity.ts#L19)

## Methods

### beforeInsert

`Private` **beforeInsert**(): `void`

#### Returns

`void`

#### Defined in

[models/address.ts:147](https://github.com/medusajs/medusa/blob/0703dd94e/packages/medusa/src/models/address.ts#L147)
Loading

0 comments on commit 4a416e7

Please sign in to comment.