Skip to content

Commit

Permalink
Added new keywords, updated attribute definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
ankraft committed Mar 8, 2022
1 parent 456cf9e commit 7210486
Show file tree
Hide file tree
Showing 13 changed files with 7,994 additions and 3,251 deletions.
16 changes: 14 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,27 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.3.0] - 2022-03-08

### Added
- Keyword **sn**: Added action to copy only the attribute's short name to the clipboard (```Shift-return```).
- Keyword **ty**: Added new keyword search for oneM2M resource types (keyword: ```ty```).
- Keyword **acop**: Added new keyword search to resolve or create oneM2M Access Control Operation numbers (keyword: ```acop```).
- Keyword **rsc**: Added new keyword search to resolve Response Status Codes (keyword: ```rsc```).

### Changed
- Updated to the latest version of the attributes file.


## [1.2.2] - 2021-09-20

### Added
- Added copying only the long name to the clipboard (by pressing ```Ctrl-return```).
- Added copying only the attribute name to the clipboard (by pressing ```Ctrl-return```).

### Fixed
- Corrected missing http/coap for UPDATED RSC.

## Changed
### Changed
- Updated to the latest version of the attributes file.


Expand Down
87 changes: 67 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Alfred Workflow - Find oneM2M Short Names
# Alfred Workflow - oneM2M attribute and resource finder

This [Alfred][alfred] workflow provides a search for [oneM2M][onem2m] attribute long and short names, resource types, response status codes, and more.

This [Alfred][alfred] workflow provides a search for oneM2M attribute long and short names, and response status codes.

![][workflow-gif]
## Installation

### Installation
### Workflow Installation

- Clone the repository or download the file [aw-oneM2M-short-names.alfredworkflow][workflow]
- Install the workflow in Alfred by double-clicking on it.
Expand All @@ -20,43 +20,84 @@ The workflow requires the [jq][jq] command line JSON processor. You need to inst
The workflow by default expects ```jq``` in the directory ```/usr/local/bin```, but this can be configured in the workflow.


## Usage
## Usage and Keywords

### onem2m : List available workflow keywords
This keyword trigger just lists the available workflow keywords in the sub-title.


### acop : Access Control Operations

![][workflow-acop-gif]

This workflow will return the allowed operations for the integer bitfield that is an access control operation.

- Alfred keyword trigger: ```acop```
- Argument: either an integer number between 1 and 63 that represents the bitfield of allowed operations, or any combination of the characters c(reate), r(etrieve), u(pdate), d(elete), d(i)scovery to calculate the *acop* number
- Pressing ```return``` copies the list of allowed operations for the given *acop* integer value, or the calculated number


### rsc : Response Status Codes

![][workflow-rsc-gif]

- Alfred keyword trigger: ```rsc```
- Argument: integer value that is a oneM2M Response Status Code
- Pressing ```return``` copies the oneM2M Response Status Code and the description to the clipboard
- Modifier keys for the search result:
- ```Cmd```: show detailed CoAP response code
- ```Alt```: show detailed http status code


### sn : Attributes and short names
- Alfred keyword trigger in Alfred: ```sn```
- Pressing ```return``` copies both the long and the short name to the clipboard.
- Pressing ```Ctrl-return``` copies only the long name to the clipboard.

![][workflow-sn-gif]

- Alfred keyword trigger: ```sn```
- Argument: oneM2M attribute name or short name
- Pressing ```return``` copies both the long and the short name to the clipboard
- Modifier keys for the search result:
- Alt: show attribute categories
- Cmd: show documents where an attribute is defined
- ```Cmd```: show documents where an attribute is defined
- ```Alt```: show attribute categories
- ```Ctrl```: copy attribute name to clipboard
- ```Shift```: copy short name to clipboard

### rsc : Response Status Codes
- Alfred keyword trigger in Alfred: ```rsc```
- Pressing ```return``` copies the oneM2M Response Status Code and the description to the clipboard.

### ty : Resource Types

![][workflow-ty-gif]

- Alfred keyword trigger: ```ty```
- Argument: oneM2M resource name or short name
- Pressing ```return``` copies the oneM2M Resource Name, its short name, and the resource type to the clipboard
- Modifier keys for the search result:
- Alt: show detailed http status code
- Cmd: show detailed CoAP response code
- ```Cmd```: copy resource type name to clipboard
- ```Alt```: copy resource type to clipboard
- ```Shift```: copy short name to clipboard


### Alfred Universal Actions

This workflow supports *Alfred's Universal Actions*. Just mark a short name, attribute, or result status code in your text and hit the Alfred's *selection hotkey*.


## Updating Attribute Mappings and Response Status Codes
## Updating Attribute Mappings, Resource Types Response Status Codes

The attribute mappings and information are located in the file [attributes.json][attributes] in the workflow directory. An updated version of this file can always be generated by using the script from the [ankraft/onem2m-extract-attributes][onem2m-extract-attributes] project. It then needs to be copied to the workflow's installation directory.
The attribute mappings are defined in the file [attributes.json][attributes] in the workflow directory. An updated version of this file can always be generated by using the script from the [ankraft/onem2m-extract-attributes][onem2m-extract-attributes] project. It then needs to be copied to the workflow's installation directory.

The response status codes and the mappings are located in the file [responseStatusCodes.json][responseStatusCodes] in the workflow directory.
The response status codes and mappings are defined in the file [responseStatusCodes.json][responseStatusCodes], and the resource type mappings are defined in [resourceTypes.json][resourceTypes] in the same directory.


## Changes

See the [CHANGELOG.md][changelog] file.
See the [CHANGELOG.md][changelog] file for a detailed list of additions and changes.


## License
This project is licensed under the terms of the [BSD 3-Clause License][bsd-3-clause].

oneM2M Partners Type 1 (ARIB, ATIS, CCSA, ETSI, TIA, TSDSI, TTA, TTC) jointly own all copyright on the Technical Specifications and Technical Reports developed and approved within oneM2M. See [oneM2M IPRs][onem2m-license] for further details.


[bsd-3-clause]: https://opensource.org/licenses/BSD-3-Clause

Expand All @@ -65,7 +106,13 @@ This project is licensed under the terms of the [BSD 3-Clause License][bsd-3-cla
[changelog]: CHANGELOG.md
[jq]: https://stedolan.github.io/jq/
[jq-brew]: https://formulae.brew.sh/formula/jq
[onem2m]: https://onem2m.org
[onem2m-license]: https://www.onem2m.org/harmonization-m2m/iprs
[onem2m-extract-attributes]:https://github.com/ankraft/onem2m-extract-attributes
[responseStatusCodes]: src/responseStatusCodes.json
[resourceTypes]: src/resourceTypes.json
[workflow]: aw-oneM2M-short-names.alfredworkflow
[workflow-gif]: workflow.gif
[workflow-acop-gif]: images/workflow-acop.gif
[workflow-sn-gif]: images/workflow-sn.gif
[workflow-rsc-gif]: images/workflow-rsc.gif
[workflow-ty-gif]: images/workflow-ty.gif
Binary file modified aw-oneM2M-short-names.alfredworkflow
Binary file not shown.
Binary file added images/workflow-acop.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/workflow-rsc.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/workflow-sn.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/workflow-ty.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 7210486

Please sign in to comment.