Skip to content

Commit

Permalink
Merge branch 'master' into TSS-1891-rest-api-show
Browse files Browse the repository at this point in the history
  • Loading branch information
anthonyshchang committed Nov 30, 2023
2 parents 398a2d0 + e03aa9f commit 9cfea71
Show file tree
Hide file tree
Showing 193 changed files with 9,065 additions and 3,072 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/test-go.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Run Go Tests
on: [push]
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: '1.19.6'
- name: Run Tests
run: |
npm install
npm run generate.go
cd ./clients/go/test
go test
21 changes: 21 additions & 0 deletions .github/workflows/test-java.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Run Java Tests
on: [push]
jobs:
gradle:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build
run: |
npm install
npm run generate.java
- uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 11
- name: Run gradle test
uses: gradle/gradle-build-action@v2
with:
gradle-version: 7.1.1
build-root-directory: ./clients/java
arguments: test --info
20 changes: 20 additions & 0 deletions .github/workflows/test-php.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Run PHP Tests
on: [push]
jobs:
phpunit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build
run: |
npm install
npm run generate.php
- uses: php-actions/composer@v6
with:
php_version: '7.4'
working_dir: ./clients/php
- uses: php-actions/phpunit@v3
with:
php_version: '7.4'
version: '7.4'
configuration: ./clients/php/phpunit.xml.dist
21 changes: 21 additions & 0 deletions .github/workflows/test-python.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Run Python Tests
on: [push]
jobs:
unittest:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build
run: |
npm install
npm run generate.python
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
working-directory: ./clients/python
- name: Run tests
run: |
cd ./clients/python
pip install -r requirements.txt -r test-requirements.txt
python -m unittest
22 changes: 22 additions & 0 deletions .github/workflows/test-ruby.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Run Ruby Tests
on: [push]
jobs:
rspec:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build
run: |
npm install
npm run generate.ruby
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.2.1
# runs 'bundle install' and caches installed gems automatically
bundler-cache: true
working-directory: ./clients/ruby
- name: Run tests
run: |
cd ./clients/ruby
bundle exec rspec
14 changes: 14 additions & 0 deletions .github/workflows/test-typescript.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Run Typescript Tests
on: [push]
jobs:
jest:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build
run: |
npm install
npm run generate.typescript
cd ./clients/typescript
npm install
npm test
63 changes: 60 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,63 @@
clients/
!clients/cli/
clients/cli/api_*.go
clients/go/

clients/python/*
!clients/python/test/test_locales_api.py
!clients/python/test/test_uploads_api.py

clients/ruby/.*
clients/ruby/Gemfile*
clients/ruby/Rakefile
clients/ruby/README.md
clients/ruby/git_push.sh
clients/ruby/openapitools.json
clients/ruby/*.gemspec
clients/ruby/spec/*.rb
clients/ruby/spec/api/*
clients/ruby/spec/models/
clients/ruby/docs
clients/ruby/lib
clients/ruby/spec/api/*
!clients/ruby/spec/api/locales_api_spec.rb
!clients/ruby/spec/api/uploads_api_spec.rb

clients/java/.*
clients/java/gradle*
clients/java/build*
clients/java/docs
clients/java/git_push.sh
clients/java/pom.xml
clients/java/README.md
clients/java/openapitools.json
clients/java/settings.gradle
clients/java/api
clients/java/src/main
clients/java/src/test/java/com/phrase/client/model
clients/java/src/test/java/com/phrase/client/api/*
!clients/java/src/test/java/com/phrase/client/api/LocalesApiTest.java
!clients/java/src/test/java/com/phrase/client/api/UploadsApiTest.java

clients/typescript/.*
clients/typescript/src
clients/typescript/package.json
clients/typescript/package-lock.json
clients/typescript/README.md
clients/typescript/tsconfig.json

clients/php/.*
clients/php/composer.*
clients/php/*.sh
clients/php/README.md
clients/php/phpunit.*
clients/php/docs
clients/php/lib
clients/php/vendor
clients/php/test/Model
clients/php/test/Api/*
!clients/php/test/Api/LocalesApiTest.php
!clients/php/test/Api/UploadsApiTest.php

clients/cli/cmd/api_*.go
clients/cli/phrase-cli

doc/*.css
doc/*.css.map
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ watch_scss:
watch_ts:
npx tsc --watch ./doc/main.ts --outFile ./doc/main.js
serve:
npx http-server doc
npx http-server doc -c-1 -p 8080
docs: lint bundle
npx sass -s compressed ./doc/main.scss:./doc/main.css ./doc/rapidoc.scss:./doc/rapidoc.css
npx tsc ./doc/main.ts --outFile ./doc/main.js
npx terser ./doc/main.js --compress --mangle -o ./doc/main.js
ruby:
openapi-generator-cli generate -i tmp/compiled.yaml -g ruby -o clients/ruby -c ./openapi-generator/ruby_lang.yaml
go:
openapi-generator-cli generate -i tmp/compiled.yaml -g go -o clients/go -c ./openapi-generator/go_lang.yaml
openapi-generator-cli generate -i tmp/compiled.yaml -g go -o clients/go -c ./openapi-generator/go_lang.yaml --global-property apiTests=false,modelTests=false
go install golang.org/x/tools/cmd/goimports@latest
goimports -w clients/go
cd clients/go && go mod tidy
Expand Down
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,16 @@ This project relies on [conventional commits](https://www.conventionalcommits.or

These changelogs and version bumps are generated as a separate pull requests (one for each client library) and currently need to be merged manually.

### Example

You added an endpoint in Phrase Strings. In this project you do the following:

1. Add newly added schema (if any) to `/schemas/` directory
2. Add new endpoints to `/paths/` directory and reference it in `paths.yaml`
3. `npm start` to re-build the clients
4. `npm run docs` to generate the documentation (and verify it in action using `npm run watch`)
5. Open a PR with an informative title (e.g. `feat(api): Add an API endpoint for cat pics`)

## Workflow

The following repositories are generated upon pushing to this one:
Expand Down
75 changes: 75 additions & 0 deletions clients/cli/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# Changelog

## [2.15.0](https://github.com/phrase/openapi/compare/cli-v2.14.0...cli-v2.15.0) (2023-11-03)


### Features

* [TSI-2083] enable format_options argument for java-client ([#426](https://github.com/phrase/openapi/issues/426)) ([faa8cb3](https://github.com/phrase/openapi/commit/faa8cb353ba9f1030b9f7cfd46b894b4d6d26e70))
* **CLI:** On pull error, print the API response ([#463](https://github.com/phrase/openapi/issues/463)) ([b0b6ed1](https://github.com/phrase/openapi/commit/b0b6ed1b928f2c64fb618de76d88742e5f0cee8c))
* Update openapi-generator to v7 ([#418](https://github.com/phrase/openapi/issues/418)) ([524626f](https://github.com/phrase/openapi/commit/524626f5e914bfef6025d0e1c2cbc7a728d08f56))

## [2.14.0](https://github.com/phrase/openapi/compare/cli-v2.13.0...cli-v2.14.0) (2023-10-23)


### Features

* **API:** Add order param to comment list endpoints ([#441](https://github.com/phrase/openapi/issues/441)) ([441c9c4](https://github.com/phrase/openapi/commit/441c9c46169f8c5ac4e71ade09a95dab136314ef))

## [2.13.0](https://github.com/phrase/openapi/compare/cli-v2.12.0...cli-v2.13.0) (2023-10-13)


### Features

* **API:** Implement figma attachments endpoints ([#415](https://github.com/phrase/openapi/issues/415)) ([970e612](https://github.com/phrase/openapi/commit/970e612fda620ca882a221ef541036b8d200b675))

## [2.12.0](https://github.com/phrase/openapi/compare/cli-v2.11.0...cli-v2.12.0) (2023-09-14)


### Features

* **CLI:** use phrase-go v2.14 ([#413](https://github.com/phrase/openapi/issues/413)) ([bf96057](https://github.com/phrase/openapi/commit/bf96057e8e0fffde405a65df5e2c993696080c58))
* Optionally tag only affected keys on upload [TSI-2041] ([#412](https://github.com/phrase/openapi/issues/412)) ([e8f958e](https://github.com/phrase/openapi/commit/e8f958e91469c2542f44ab68469c933688958383))
* **TSI-1946:** Add reviewed_at to translations ([#396](https://github.com/phrase/openapi/issues/396)) ([3e663d9](https://github.com/phrase/openapi/commit/3e663d971a99a816f0165dd6653a9a1e8a87c95e))

## [2.11.0](https://github.com/phrase/openapi/compare/cli-v2.10.0...cli-v2.11.0) (2023-08-28)


### Features

* **API:** Document new query parameters ([#393](https://github.com/phrase/openapi/issues/393)) ([770515a](https://github.com/phrase/openapi/commit/770515a9628122955bb3919405babf9392684eb9))

## [2.10.0](https://github.com/phrase/openapi/compare/cli-v2.9.1...cli-v2.10.0) (2023-08-24)


### Features

* **API:** Introduce comment replies endpoints ([#383](https://github.com/phrase/openapi/issues/383)) ([71351ac](https://github.com/phrase/openapi/commit/71351ac285f4f49976092e176c77b09f3485eb65))

## [2.9.1](https://github.com/phrase/openapi/compare/cli-v2.9.0...cli-v2.9.1) (2023-08-24)


### Bug Fixes

* **cli:** Bump go library version ([#384](https://github.com/phrase/openapi/issues/384)) ([ab2f655](https://github.com/phrase/openapi/commit/ab2f6556184bc7171c00c3f1b81908aec0e57a04))

## [2.9.0](https://github.com/phrase/openapi/compare/cli-v2.8.4...cli-v2.9.0) (2023-08-22)


### Features

* **TSE-950:** Document comment_reactions endpoints ([#380](https://github.com/phrase/openapi/issues/380)) ([f230244](https://github.com/phrase/openapi/commit/f230244e6e9c069b18edc4c35dd5e290fd14793b))

## [2.8.4](https://github.com/phrase/openapi/compare/cli-v2.8.3...cli-v2.8.4) (2023-07-31)


### Bug Fixes

* **schemas:** Fix gitlab_sync type mismatch ([#373](https://github.com/phrase/openapi/issues/373)) ([1cb1f65](https://github.com/phrase/openapi/commit/1cb1f650598c68afee6e2cd7c3c4ede1484aba35))

## [2.8.3](https://github.com/phrase/openapi/compare/cli-v2.8.2...cli-v2.8.3) (2023-07-28)


### Bug Fixes

* Fix gitlab_sync history status type mismatch ([#363](https://github.com/phrase/openapi/issues/363)) ([ebcaa4e](https://github.com/phrase/openapi/commit/ebcaa4e5dfcb2f73559a56c78b0f2512ca798375))
3 changes: 3 additions & 0 deletions clients/cli/cmd/internal/pull.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@ func (target *Target) Pull(client *phrase.APIClient, branch string) error {

err = target.DownloadAndWriteToFile(client, localeFile, branch)
if err != nil {
if openapiError, ok := err.(phrase.GenericOpenAPIError); ok {
print.Warn("API response: %s", openapiError.Body())
}
return fmt.Errorf("%s for %s", err, localeFile.Path)
} else {
print.Success("Downloaded %s to %s", localeFile.Message(), localeFile.RelPath())
Expand Down
8 changes: 4 additions & 4 deletions clients/cli/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ require (
github.com/daviddengcn/go-colortext v1.0.0
github.com/jpillora/backoff v1.0.0
github.com/mitchellh/mapstructure v1.4.0
github.com/phrase/phrase-go/v2 v2.8.0
github.com/phrase/phrase-go/v2 v2.18.0 // x-release-please-version
github.com/spf13/cobra v1.0.0
github.com/spf13/viper v1.7.1
gopkg.in/yaml.v2 v2.4.0
Expand All @@ -27,10 +27,10 @@ require (
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/subosito/gotenv v1.2.0 // indirect
golang.org/x/net v0.7.0 // indirect
golang.org/x/net v0.17.0 // indirect
golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5 // indirect
golang.org/x/sys v0.5.0 // indirect
golang.org/x/text v0.7.0 // indirect
golang.org/x/sys v0.13.0 // indirect
golang.org/x/text v0.13.0 // indirect
google.golang.org/appengine v1.6.6 // indirect
google.golang.org/protobuf v1.25.0 // indirect
gopkg.in/ini.v1 v1.62.0 // indirect
Expand Down
16 changes: 8 additions & 8 deletions clients/cli/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,8 @@ github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FI
github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
github.com/pelletier/go-toml v1.8.1 h1:1Nf83orprkJyknT6h7zbuEGUEjcyVlCxSUGTENmNCRM=
github.com/pelletier/go-toml v1.8.1/go.mod h1:T2/BmBdy8dvIRq1a/8aqjN41wvWlN4lrapLU/GW4pbc=
github.com/phrase/phrase-go/v2 v2.8.0 h1:GCa7gPN2DjfWbMZq6XDNhrGtOUfBIglgKRj3pwVQ1HQ=
github.com/phrase/phrase-go/v2 v2.8.0/go.mod h1:N1ou4nnB9ak8aAWOH7x25Xhzw8FmFeBRhSGq5A0CY2o=
github.com/phrase/phrase-go/v2 v2.15.0 h1:9v9B6p8z7yw5OYpAIOajHcD+tQMJyrBT79Dimxdk10A=
github.com/phrase/phrase-go/v2 v2.15.0/go.mod h1:N1ou4nnB9ak8aAWOH7x25Xhzw8FmFeBRhSGq5A0CY2o=
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI=
Expand Down Expand Up @@ -360,8 +360,8 @@ golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81R
golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g=
golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM=
golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
Expand Down Expand Up @@ -410,17 +410,17 @@ golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU=
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE=
golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo=
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k=
golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
Expand Down
13 changes: 7 additions & 6 deletions clients/go/.goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ before:
builds:
- skip: true
archives:
- replacements:
darwin: Darwin
linux: Linux
windows: Windows
386: i386
amd64: x86_64
- name_template: >-
{{ .ProjectName }}_
{{- title .Os }}_
{{- if eq .Arch "amd64" }}x86_64
{{- else if eq .Arch "386" }}i386
{{- else }}{{ .Arch }}{{ end }}
{{- if .Arm }}v{{ .Arm }}{{ end }}
checksum:
name_template: 'checksums.txt'
snapshot:
Expand Down
Loading

0 comments on commit 9cfea71

Please sign in to comment.