Skip to content

Commit

Permalink
Merge pull request #74 from kuzzleio/0.2.0-proposal
Browse files Browse the repository at this point in the history
Release 0.2.0
  • Loading branch information
Yoann-Abbes authored May 11, 2021
2 parents ef4dc2c + 26da407 commit 252945c
Show file tree
Hide file tree
Showing 40 changed files with 2,375 additions and 1,246 deletions.
62 changes: 20 additions & 42 deletions .github/workflows/pull_request.workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,6 @@ jobs:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- uses: actions/setup-node@v1.4.4
with:
node-version: "12"
Expand All @@ -30,39 +19,28 @@ jobs:
needs: [lint]
steps:
- uses: actions/checkout@v2
- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- uses: actions/setup-node@v1.4.4
with:
node-version: "12"
- uses: ./.github/actions/functional-test

documentation-dead-links:
name: Dead links
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- uses: actions/setup-node@v1.4.4
with:
node-version: "12"
- uses: ./.github/actions/dead-links
# documentation-dead-links:
# name: Dead links
# runs-on: ubuntu-18.04
# steps:
# - uses: actions/checkout@v2
# - name: Cache node modules
# uses: actions/cache@v2
# env:
# cache-name: cache-node-modules
# with:
# path: ~/.npm
# key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
# restore-keys: |
# ${{ runner.os }}-build-${{ env.cache-name }}-
# ${{ runner.os }}-build-
# ${{ runner.os }}-
# - uses: actions/setup-node@v1.4.4
# with:
# node-version: "12"
# - uses: ./.github/actions/dead-links
62 changes: 20 additions & 42 deletions .github/workflows/push_master.workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,6 @@ jobs:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- uses: actions/setup-node@v1.4.4
with:
node-version: "12"
Expand All @@ -33,42 +22,31 @@ jobs:
needs: [lint]
steps:
- uses: actions/checkout@v2
- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- uses: actions/setup-node@v1.4.4
with:
node-version: "12"
- uses: ./.github/actions/functional-test

documentation-dead-links:
name: Dead links
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- uses: actions/setup-node@v1.4.4
with:
node-version: "12"
- uses: ./.github/actions/dead-links
# documentation-dead-links:
# name: Dead links
# runs-on: ubuntu-18.04
# steps:
# - uses: actions/checkout@v2
# - name: Cache node modules
# uses: actions/cache@v2
# env:
# cache-name: cache-node-modules
# with:
# path: ~/.npm
# key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
# restore-keys: |
# ${{ runner.os }}-build-${{ env.cache-name }}-
# ${{ runner.os }}-build-
# ${{ runner.os }}-
# - uses: actions/setup-node@v1.4.4
# with:
# node-version: "12"
# - uses: ./.github/actions/dead-links

documentation-production:
name: Deployment Doc Prod
Expand Down
18 changes: 18 additions & 0 deletions doc/1/classes/assets-custom-properties/constructor/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
code: false
type: page
title: Constructor
description: AssetsCustomProperties class constructor
---

# AssetsCustomProperties

This class is used within the plugin in order to register custom properties definitions to the `assets` collection.
They are automatically loaded at application startup.
---

## Constructor

```ts
AssetsCustomProperties()
```
6 changes: 6 additions & 0 deletions doc/1/classes/assets-custom-properties/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
code: true
type: branch
title: AssetsCustomProperties
description: Kuzzle IoT Platform - AssetsCustomProperties class
---
44 changes: 44 additions & 0 deletions doc/1/classes/assets-custom-properties/register-metadata/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
code: true
type: page
title: registerMetadata
description: Add properties definition to the 'metadata' field
---

# registerMetadata

Add properties definition to the `metadata` field of the `assets` collection.


```ts
registerMetadata (mapping: JSONObject, options: JSONObject);
```

<br/>

| Arguments | Type | Description |
|-----------|-----------------------|---------------------------------------------|
| `mapping` | <pre>JSONObject</pre> | Mapping definiton of the `metadata` property |
| `options` | <pre>JSONObject</pre> | Additional options |

### options

| Properties | Type | Description |
|-----------|-----------------------|---------------------------------------------|
| `tenantGroup` | <pre>string</pre> | Name of the group for which the mapping should apply. If unspecified, mappings will apply to every group who does not have specific definition. |

## Usage

```ts
import { DeviceManagerPlugin } from 'kuzzle-plugin-device-manager';

const deviceManagerPlugin = new DeviceManagerPlugin();

deviceManagerPlugin.assets.registerMetadata({
serial: {
type: 'keyword',
fields: {
text: { type: 'text' } }
}
}, { tenantGroup: 'water_management' });
```
18 changes: 18 additions & 0 deletions doc/1/classes/devices-custom-properties/constructor/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
code: false
type: page
title: Constructor
description: DevicesCustomProperties class constructor
---

# DevicesCustomProperties

This class is used within the plugin in order to register custom properties definitions to the `devices` collection.
They are automatically loaded at application startup.
---

## Constructor

```ts
DeviceCustomProperties()
```
6 changes: 6 additions & 0 deletions doc/1/classes/devices-custom-properties/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
code: true
type: branch
title: DevicesCustomProperties
description: Kuzzle IoT Platform - DevicesCustomProperties class
---
62 changes: 62 additions & 0 deletions doc/1/classes/devices-custom-properties/register-measure/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
---
code: true
type: page
title: registerMeasure
description: Add properties definition to the 'measures' field
---

# registerMeasure

Add properties definition to the `measures` field of the `devices` collection.


```ts
registerMeasure (measureName: string, mapping: JSONObject, options: JSONObject);
```

<br/>

| Arguments | Type | Description |
|-----------|-----------------------|---------------------------------------------|
| `measureName` | <pre>string</pre> | Name of the measure you are willing to add to the `measures` field |
| `mapping` | <pre>JSONObject</pre> | Mapping definiton of the custom measure property |
| `options` | <pre>JSONObject</pre> | Additional options |

### options

| Properties | Type | Description |
|-----------|-----------------------|---------------------------------------------|
| `tenantGroup` | <pre>string</pre> | Name of the group for which the mapping should apply. If unspecified, mappings will apply to every group who does not have specific definition |

## Usage

```ts
import { DeviceManagerPlugin } from 'kuzzle-plugin-device-manager';

const deviceManagerPlugin = new DeviceManagerPlugin();

deviceManagerPlugin.devices.registerMeasure(
'temperature',
{
dynamic: 'false',
properties: {
fahrenheit: { type: 'float' },
celsius: { type: 'float' }
}
},
{ tenantGroup: 'water_management' });

deviceManagerPlugin.devices.registerMeasure(
'humidity',
{
dynamic: 'false',
properties: {
percentage: {
type: 'keyword',
fields: {
text: { type: 'text' } }
}
}
},
{ tenantGroup: 'air_quality' });
```
44 changes: 44 additions & 0 deletions doc/1/classes/devices-custom-properties/register-metadata/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
code: true
type: page
title: registerMetadata
description: Add properties definition to the 'metadata' field
---

# registerMetadata

Add properties definition to the `metadata` field of the `devices` collection.


```ts
registerMetadata (mapping: JSONObject, options: JSONObject);
```

<br/>

| Arguments | Type | Description |
|-----------|-----------------------|---------------------------------------------|
| `mapping` | <pre>JSONObject</pre> | Mapping definiton of the `metadata` property |
| `options` | <pre>JSONObject</pre> | Additional options |

### options

| Properties | Type | Description |
|-----------|-----------------------|---------------------------------------------|
| `tenantGroup` | <pre>string</pre> | Name of the group for which the mapping should apply. If unspecified, mappings will apply to every group who does not have specific definition. |

## Usage

```ts
import { DeviceManagerPlugin } from 'kuzzle-plugin-device-manager';

const deviceManagerPlugin = new DeviceManagerPlugin();

deviceManagerPlugin.devices.registerMetadata({
serial: {
type: 'keyword',
fields: {
text: { type: 'text' } }
}
}, { tenantGroup: 'water_management' });
```
Loading

0 comments on commit 252945c

Please sign in to comment.