Skip to content

Commit

Permalink
Merge pull request #80 from jovotech/v4/dev
Browse files Browse the repository at this point in the history
🔖 Prepare latest release
  • Loading branch information
aswetlow authored Jun 15, 2022
2 parents 7f3d2e4 + bf5a9b8 commit b9d0cf9
Show file tree
Hide file tree
Showing 61 changed files with 18,848 additions and 68,124 deletions.
89 changes: 89 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: npm publish

on:
push:
# start workflow on releases named YYYY-MM-DD-(patch|minor)
# e.g. 2022-04-21-patch, 2022-04-21-2-patch, 2022-04-21-minor
tags:
- "20*"

jobs:
build:

runs-on: ${{ matrix.os }}
strategy:
matrix:
node-version: [14.x]
os: [ubuntu-latest]
steps:

- uses: actions/checkout@v2
with:
fetch-depth: '0'

- name: Prepare repository
run: git checkout v4/latest

# take RELEASE_VERSION from release and add to $GITHUB_ENV
- name: Set env
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV

# set RELEASE variable to 'patch' RELEASE_VERSION ends with 'patch'
- if: endsWith(env.RELEASE_VERSION, 'patch')
run: echo "RELEASE=patch" >> $GITHUB_ENV

# set RELEASE variable to 'minor' RELEASE_VERSION ends with 'minor'
- if: endsWith(env.RELEASE_VERSION, 'minor')
run: echo "RELEASE=minor" >> $GITHUB_ENV

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
registry-url: https://registry.npmjs.org/

- name: setup git config
run: |
git config user.name "GitHub Actions Bot"
git config user.email "<>"
- run: |
git checkout v4/latest
git push --set-upstream origin v4/latest
- run: npm install --ci
- run: npm run setup:dev
- run: npm run tslint
- run: npm run test

- name: npm version
uses: mathiasvr/command-output@v1
id: npmversion
with:
run: |
npm run updateVersions:${{env.RELEASE}}
env:
NODE_AUTH_TOKEN: ${{secrets.PUBLISH_PACKAGES}}

- run: |
git add .
git commit -m ":bookmark: Release ${{env.RELEASE_VERSION}}"
git push --set-upstream origin v4/latest
- run: npm run publishPackages
env:
NODE_AUTH_TOKEN: ${{secrets.PUBLISH_PACKAGES}}

# Push version bump to v4/dev
- run: |
git checkout v4/dev
git merge v4/latest -m ":twisted_rightwards_arrows: Merge v4/latest into v4/dev"
git push --set-upstream origin v4/dev
- name: Slack Notification
uses: rtCamp/action-slack-notify@v2
env:
SLACK_TITLE: ":rocket: New ${{env.RELEASE_VERSION}} release"
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_MESSAGE: ${{ steps.npmversion.outputs.stdout }}
MSG_MINIMAL: "actions url"
8 changes: 4 additions & 4 deletions jovo-model-util/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@jovotech/model-util",
"private": false,
"version": "4.0.0-beta.4",
"version": "4.0.0",
"description": "Jovo Model Util",
"main": "dist/index",
"types": "dist/index.d.ts",
Expand All @@ -27,10 +27,10 @@
"ts-jest": "^24.3.0",
"tslint": "^5.20.1",
"typescript": "^4.3.5",
"typescript-json-schema": "^0.42.0"
"typescript-json-schema": "^0.53.1"
},
"dependencies": {
"@jovotech/model": "^4.0.0-beta.4"
"@jovotech/model": "^4.0.0"
},
"jest": {
"transform": {
Expand All @@ -49,5 +49,5 @@
"json"
]
},
"gitHead": "f0e129be4a51123dcf3f47fc79db1f2a94794a99"
"gitHead": "e7a3560860e41654c07b5b07d1c6e11d9b9b6ba4"
}
4 changes: 2 additions & 2 deletions jovo-model/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@jovotech/model",
"private": false,
"version": "4.0.0-beta.4",
"version": "4.0.0",
"description": "Jovo Model",
"main": "dist/src/index",
"types": "dist/src/index.d.ts",
Expand Down Expand Up @@ -49,5 +49,5 @@
"json"
]
},
"gitHead": "f0e129be4a51123dcf3f47fc79db1f2a94794a99"
"gitHead": "e7a3560860e41654c07b5b07d1c6e11d9b9b6ba4"
}
2 changes: 1 addition & 1 deletion jovo-model/src/Interfaces.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export interface EntityType {
values?: EntityTypeValue[];
values: Array<string | EntityTypeValue>;
}

export interface EntityTypeValue {
Expand Down
6 changes: 3 additions & 3 deletions jovo-model/src/JovoModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
ModelEntityTypeValue,
NativeFileInformation,
} from '.';
import { IntentInput, IntentV3, JovoModelDataV3 } from './Interfaces';
import { InputType, IntentInput, IntentV3, JovoModelDataV3 } from './Interfaces';

export class JovoModel {
static MODEL_KEY = '';
Expand Down Expand Up @@ -259,15 +259,15 @@ export class JovoModel {
* See [[JovoModelHelper]]
* @param entityType EntityType-object or string
*/
getEntityTypeByName(entityType: string): EntityType | undefined {
getEntityTypeByName(entityType: string): EntityType | InputType | undefined {
return this.data ? JovoModelHelper.getEntityTypeByName(this.data, entityType) : undefined;
}

/**
* See [[JovoModelHelper]]
* @param entityType EntityType-object or string
*/
getEntityTypeValues(entityType: string): EntityTypeValue[] {
getEntityTypeValues(entityType: string): Array<string | EntityTypeValue> {
return this.data ? JovoModelHelper.getEntityTypeValues(this.data, entityType) : [];
}

Expand Down
14 changes: 12 additions & 2 deletions jovo-model/src/JovoModelBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export class JovoModelBuilder implements JovoModelBuilderInterface {

hasPhrase!: (phrase: string) => boolean;

prepareModel!: () => JovoModelBuilder;
prepareModel!: () => JovoModelData | JovoModelDataV3;

removeEntity!: (intent: string, entity: string) => JovoModelBuilder;

Expand All @@ -97,7 +97,7 @@ export class JovoModelBuilder implements JovoModelBuilderInterface {

getEntityTypes!: () => Record<string, EntityType | InputType>;

updateEntityType!: (entityType: string, entityTypeData: EntityType) => JovoModelBuilder;
updateEntityType!: (entityType: string, entityTypeData: EntityType | InputType) => JovoModelBuilder;

updateIntent!: (intent: string, intentData: Intent) => JovoModelBuilder;

Expand Down Expand Up @@ -131,6 +131,16 @@ export class JovoModelBuilder implements JovoModelBuilderInterface {
newSynonym: string,
) => JovoModelBuilder;

getIntentIndex!: (intentName: string) => number;

getInputIndex!: (intent: string, input: string) => number;

getInputTypeIndex!: (inputType: string) => number;

getInputTypeByName!: (inputType: string) => InputType | undefined;

getInputTypeValueIndex!: (inputType: string, inputTypeValue: string) => number;

isJovoModelV3!: () => boolean;

isIntentV3!: () => boolean;
Expand Down
Loading

0 comments on commit b9d0cf9

Please sign in to comment.