Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

runtime actions #144

Merged
merged 14 commits into from
Feb 23, 2024
10 changes: 10 additions & 0 deletions src/data/navigation/sections/app-development.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,16 @@ module.exports = [
}
]
},
{
title: "Starter kit",
path: "/app-development/starter-kit/index.md",
pages: [
{
title: "Integrate runtime actions",
path: "/app-development/starter-kit/integration.md",
}
]
},
{
title: "Reference App",
path: "/app-development/amazon-sales-channel/index.md",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<CodeBlock slots="heading, code" repeat="3" languages="JSON, JSON, JSON" />

#### create

```json
{
"type": "object",
"properties": {
"name": { "type": "string" },
"taxClassId": { "type": "number" }
},
"required": ["name", "taxClassId"],
"additionalProperties": true
}
```

#### update

```json
{
"type": "object",
"properties": {
"sku": { "type": "string" },
"name": { "type": "string" },
"price": {"type": "number"},
"description": {"type": "string"}
},
"required": ["sku", "name", "price", "description"],
"additionalProperties": true
}
```

#### delete

```json
{
"customer_group_id": 6,
"customer_group_code": "Group name code",
"tax_class_id": 4,
"tax_class_name": "Tax class name",
"extension_attributes": {
"exclude_website_ids":[]
}
}
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<CodeBlock slots="heading, code" repeat="3" languages="JSON, JSON, JSON" />

#### create

```json
{
"type": "object",
"properties": {
"name": { "type": "string" },
"lastname": {"type": "string"},
"email": {"type": "string"}
},
"required": ["name", "lastname", "email"],
"additionalProperties": true
}
```

#### update

```json
{
"type": "object",
"properties": {
"id": {"type": "number"},
"name": { "type": "string" },
"lastname": {"type": "string"},
"email": {"type": "string"}
},
"required": ["id", "name", "lastname", "email"],
"additionalProperties": true
}
```

#### delete

```json
{
"type": "object",
"properties": {
"id": { "type": "number" }
},
"required": ["id"],
"additionalProperties": false
}
```
16 changes: 16 additions & 0 deletions src/pages/app-development/starter-kit/code-samples/data-order.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<CodeBlock slots="heading, code" repeat="1" languages="JSON" />

#### update

```json
{
"type": "object",
"properties": {
"id": { "type": "integer" },
"status": { "type": "string" },
"notifyCustomer": { "type": "boolean"}
},
"required": ["id", "status"],
"additionalProperties": true
}
```
46 changes: 46 additions & 0 deletions src/pages/app-development/starter-kit/code-samples/data-product.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<CodeBlock slots="heading, code" repeat="3" languages="JSON, JSON, JSON" />

#### create

```json
{
"type": "object",
"properties": {
"sku": { "type": "string" },
"name": { "type": "string" },
"price": {"type": "number"},
"description": {"type": "string"}
},
"required": ["sku", "name", "description"],
"additionalProperties": true
}
```

#### update

```json
{
"type": "object",
"properties": {
"sku": { "type": "string" },
"name": { "type": "string" },
"price": {"type": "number"},
"description": {"type": "string"}
},
"required": ["sku", "name", "price", "description"],
"additionalProperties": true
}
```

#### delete

```json
{
"type": "object",
"properties": {
"sku": { "type": "string" }
},
"required": ["sku"],
"additionalProperties": false
}
```
109 changes: 109 additions & 0 deletions src/pages/app-development/starter-kit/code-samples/data-shipment.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
<CodeBlock slots="heading, code" repeat="2" languages="JSON, JSON" />

#### create

```json
{
"type": "object",
"properties": {
"orderId": { "type": "string" },
"items": {
"type": "array",
"items": {
"type": "object",
"properties": {
"orderItemId": { "type": "number" },
"qty": { "type": "number" }
},
"required": ["orderItemId", "qty"],
"additionalProperties": false
}
},
"tracks": {
"type": "array",
"items": {
"type": "object",
"properties": {
"trackNumber": { "type": "string" },
"title": { "type": "string" },
"carrierCode": { "type": "string" }
},
"required": ["trackNumber", "title", "carrierCode"],
"additionalProperties": false
}
},
"comments" : {
"type": "array",
"items": {
"type": "object",
"properties": {
"notifyCustomer": { "type": "boolean" },
"comment": { "type": "string" },
"visibleOnFront": { "type": "boolean" }
},
"required": ["notifyCustomer", "comment", "visibleOnFront"],
"additionalProperties": false
}
},
"stockSourceCode": { "type": "string" }
},
"required": ["orderId", "items", "tracks", "comments", "stockSourceCode"],
"additionalProperties": false
}
```

#### update

```json
{
"type": "object",
"properties": {
"id": { "type": "number" },
"orderId": { "type": "number" },
"items": {
"type": "array",
"items": {
"type": "object",
"properties": {
"entityId": { "type": "number" },
"orderItemId": { "type": "number" },
"qty": { "type": "number" }
},
"required": ["entityId", "orderItemId", "qty"],
"additionalProperties": false
}
},
"tracks": {
"type": "array",
"items": {
"type": "object",
"properties": {
"entityId": { "type": "number" },
"trackNumber": { "type": "string" },
"title": { "type": "string" },
"carrierCode": { "type": "string" }
},
"required": ["entityId", "trackNumber", "title", "carrierCode"],
"additionalProperties": false
}
},
"comments" : {
"type": "array",
"items": {
"type": "object",
"properties": {
"entityId": { "type": "number" },
"notifyCustomer": { "type": "boolean" },
"comment": { "type": "string" },
"visibleOnFront": { "type": "boolean" }
},
"required": ["entityId", "notifyCustomer", "comment", "visibleOnFront"],
"additionalProperties": false
}
},
"stockSourceCode": { "type": "string" }
},
"required": ["id", "orderId", "items", "tracks", "comments", "stockSourceCode"],
"additionalProperties": false
}
```
19 changes: 19 additions & 0 deletions src/pages/app-development/starter-kit/code-samples/data-stock.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<CodeBlock slots="heading, code" repeat="1" languages="JSON" />

#### update

```json
{
"type": "array",
"items": {
"properties": {
"sku": { "type": "string" },
"source": { "type": "string" },
"quantity": { "type": "number" },
"outOfStock": { "type": "boolean" }
},
"required": [ "sku", "source", "quantity", "outOfStock" ],
"additionalProperties": true
}
}
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<CodeBlock slots="heading, code" repeat="3" languages="JSON, JSON, JSON" />

#### create

```json
{
"name": "A Group Name",
"taxClassId": 25
}
```

#### update

```json
{
"id": 8,
"name": "A Group Name",
"taxClassId": 25
}
```

#### delete

```json
{
"id": 8
}
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<CodeBlock slots="heading, code" repeat="3" languages="JSON, JSON, JSON" />

#### create

```json
{
"email": "sample@email.com",
"name": "John",
"lastname": "Doe"
}
```

#### update

```json
{
"id": 1234,
"email": "sample@email.com",
"name": "John",
"lastname": "Doe"
}
```

#### delete

```json
{
"id": 1234
}
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<CodeBlock slots="heading, code" repeat="1" languages="JSON" />

#### update

```json
{
"id": 99,
"status": "shipped",
"notifyCustomer": false
}
```
Loading
Loading