@astrada.co/ts-astrada-sdk 1.1.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/api-sdk-release.yml +33 -20
- package/CHANGELOG.md +2 -2
- package/LICENSE +21 -0
- package/dist/astrada.co-ts-astrada-sdk-1.2.0.tgz +0 -0
- package/openapi-generator/templates/npmignore.mustache +2 -0
- package/openapi-generator/templates/package.mustache +44 -0
- package/package.json +2 -2
- package/dist/astrada.co-ts-astrada-sdk-1.1.0.tgz +0 -0
|
@@ -23,7 +23,7 @@ jobs:
|
|
|
23
23
|
repo_name: ts-astrada-sdk
|
|
24
24
|
repo_dir: .
|
|
25
25
|
template_dir: openapi-generator/templates
|
|
26
|
-
additional_properties: modelPropertyNaming=original,npmName=@astrada.co/ts-astrada-sdk,licenseName=MIT
|
|
26
|
+
additional_properties: modelPropertyNaming=original,npmName=@astrada.co/ts-astrada-sdk,npmVersion=1.0.0,licenseName=MIT
|
|
27
27
|
|
|
28
28
|
steps:
|
|
29
29
|
- name: Generate a token
|
|
@@ -44,11 +44,12 @@ jobs:
|
|
|
44
44
|
path: "./api-spec"
|
|
45
45
|
token: ${{ steps.generate-token.outputs.token }}
|
|
46
46
|
ref: ${{ inputs.api_spec_ref }}
|
|
47
|
+
fetch-depth: 0
|
|
47
48
|
|
|
48
49
|
- name: Set up Node.js
|
|
49
|
-
uses: actions/setup-node@
|
|
50
|
+
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
|
|
50
51
|
with:
|
|
51
|
-
node-version:
|
|
52
|
+
node-version-file: ./api-spec/package.json
|
|
52
53
|
|
|
53
54
|
- name: Render api-spec configuration
|
|
54
55
|
run: |
|
|
@@ -56,14 +57,14 @@ jobs:
|
|
|
56
57
|
|
|
57
58
|
npm ci
|
|
58
59
|
npm run bundle:public-api
|
|
59
|
-
|
|
60
|
-
- name: Copy openapi.yaml from api-spec repo
|
|
61
|
-
run: |
|
|
60
|
+
|
|
62
61
|
cp -r ./out-public-api.yaml $HOME
|
|
63
62
|
|
|
64
63
|
- name: Determine commit type from conventional commits
|
|
65
64
|
id: commit_type
|
|
66
65
|
run: |
|
|
66
|
+
cd ./api-spec
|
|
67
|
+
|
|
67
68
|
# Get the latest release tag
|
|
68
69
|
LATEST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "")
|
|
69
70
|
|
|
@@ -98,13 +99,14 @@ jobs:
|
|
|
98
99
|
|
|
99
100
|
echo "Determined commit type: $COMMIT_TYPE"
|
|
100
101
|
echo "commit_type=$COMMIT_TYPE" >> $GITHUB_OUTPUT
|
|
101
|
-
|
|
102
|
-
cd ..
|
|
103
102
|
|
|
104
103
|
- name: Checkout ${{ github.event.repository.name }} repo
|
|
105
104
|
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
|
105
|
+
|
|
106
|
+
- name: Set up Node.js
|
|
107
|
+
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
|
|
106
108
|
with:
|
|
107
|
-
|
|
109
|
+
node-version-file: package.json
|
|
108
110
|
|
|
109
111
|
- name: Install OpenAPI Generator
|
|
110
112
|
run: |
|
|
@@ -119,7 +121,7 @@ jobs:
|
|
|
119
121
|
fi
|
|
120
122
|
|
|
121
123
|
openapi-generator-cli generate \
|
|
122
|
-
-i
|
|
124
|
+
-i $HOME/out-public-api.yaml \
|
|
123
125
|
-g ${{ env.generator }} \
|
|
124
126
|
-o ${{ env.repo_dir }} \
|
|
125
127
|
--git-user-id "FidelLimited" \
|
|
@@ -134,12 +136,16 @@ jobs:
|
|
|
134
136
|
git status
|
|
135
137
|
|
|
136
138
|
- name: Create branch and commit changes
|
|
137
|
-
|
|
139
|
+
env:
|
|
140
|
+
GH_TOKEN: ${{ steps.generate-token.outputs.token }}
|
|
138
141
|
run: |
|
|
142
|
+
USER_NAME="api-sdk-generator[bot]"
|
|
143
|
+
USER_ID=$(gh api "users/${USER_NAME}" --jq .id)
|
|
144
|
+
|
|
139
145
|
# Configure git
|
|
140
|
-
git config user.name "
|
|
141
|
-
git config user.email "
|
|
142
|
-
|
|
146
|
+
git config user.name "${USER_NAME}"
|
|
147
|
+
git config user.email "${USER_ID}+${USER_NAME}@users.noreply.github.com"
|
|
148
|
+
|
|
143
149
|
# Get version from release or use timestamp
|
|
144
150
|
# Check if api_spec_ref is a semantic version (e.g., v1.2.3 or 1.2.3)
|
|
145
151
|
if [[ "${{ inputs.api_spec_ref }}" =~ ^v?[0-9]+\.[0-9]+\.[0-9]+ ]]; then
|
|
@@ -148,7 +154,7 @@ jobs:
|
|
|
148
154
|
VERSION="$(date +%Y%m%d-%H%M%S)"
|
|
149
155
|
fi
|
|
150
156
|
|
|
151
|
-
BRANCH_NAME="sdk-update
|
|
157
|
+
BRANCH_NAME="sdk-update/${VERSION}"
|
|
152
158
|
|
|
153
159
|
# Create and checkout new branch
|
|
154
160
|
git checkout -b ${BRANCH_NAME}
|
|
@@ -167,22 +173,29 @@ jobs:
|
|
|
167
173
|
# Create conventional commit message
|
|
168
174
|
if [[ "$COMMIT_TYPE" == *"!"* ]]; then
|
|
169
175
|
# Breaking change - multi-line commit message
|
|
170
|
-
|
|
171
|
-
-m "" \
|
|
172
|
-
-m "BREAKING CHANGE: SDK updated with breaking changes from api-spec"
|
|
176
|
+
COMMIT_MESSAGE="${COMMIT_TYPE}: update SDK from api-spec ${VERSION}\n\nBREAKING CHANGE: SDK updated with breaking changes from api-spec"
|
|
173
177
|
else
|
|
174
|
-
|
|
178
|
+
COMMIT_MESSAGE="${COMMIT_TYPE}: update SDK from api-spec ${VERSION}"
|
|
175
179
|
fi
|
|
176
180
|
|
|
177
181
|
git push origin ${BRANCH_NAME}
|
|
178
182
|
echo "has_changes=true" >> $GITHUB_ENV
|
|
179
183
|
echo "branch_name=${BRANCH_NAME}" >> $GITHUB_ENV
|
|
180
184
|
echo "version=${VERSION}" >> $GITHUB_ENV
|
|
185
|
+
echo "commit_message=${COMMIT_MESSAGE}" >> $GITHUB_ENV
|
|
181
186
|
fi
|
|
182
187
|
|
|
188
|
+
- uses: planetscale/ghcommit-action@343f41817a6a0f882f18bbc59fdd37f49452736f # v0.2.19
|
|
189
|
+
if: env.has_changes == 'true'
|
|
190
|
+
with:
|
|
191
|
+
commit_message: "${{ env.commit_message }}"
|
|
192
|
+
repo: ${{ github.repository }}
|
|
193
|
+
branch: ${{ env.branch_name }}
|
|
194
|
+
env:
|
|
195
|
+
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}
|
|
196
|
+
|
|
183
197
|
- name: Create Pull Request
|
|
184
198
|
if: env.has_changes == 'true'
|
|
185
|
-
working-directory: ${{ env.repo_name }}
|
|
186
199
|
env:
|
|
187
200
|
GH_TOKEN: ${{ steps.generate-token.outputs.token }}
|
|
188
201
|
run: |
|
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
# [1.
|
|
1
|
+
# [1.2.0](https://github.com/FidelLimited/ts-astrada-sdk/compare/v1.1.0...v1.2.0) (2025-11-21)
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
### Features
|
|
5
5
|
|
|
6
|
-
*
|
|
6
|
+
* **api-sdk:** improve release workflow and add generator templates ([#12](https://github.com/FidelLimited/ts-astrada-sdk/issues/12)) ([5ef13b9](https://github.com/FidelLimited/ts-astrada-sdk/commit/5ef13b943dd11117c0e2ecc383a5afa65d1e4505))
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Fidel Limited DBA Astrada
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
Binary file
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "{{npmName}}",
|
|
3
|
+
"version": "{{npmVersion}}",
|
|
4
|
+
"description": "Astrada's API client SDK for JavaScript/TypeScript",
|
|
5
|
+
"author": "Astrada",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://{{gitHost}}/{{gitUserId}}/{{gitRepoId}}.git"
|
|
9
|
+
},
|
|
10
|
+
{{#licenseName}}
|
|
11
|
+
"license": "{{licenseName}}",
|
|
12
|
+
{{/licenseName}}
|
|
13
|
+
{{#packageAsSourceOnlyLibrary}}
|
|
14
|
+
"main": "./index.ts",
|
|
15
|
+
{{/packageAsSourceOnlyLibrary}}
|
|
16
|
+
{{^packageAsSourceOnlyLibrary}}
|
|
17
|
+
"main": "./dist/index.js",
|
|
18
|
+
"types": "./dist/index.d.ts",
|
|
19
|
+
{{#supportsES6}}
|
|
20
|
+
"module": "./dist/esm/index.js",
|
|
21
|
+
"sideEffects": false,
|
|
22
|
+
{{/supportsES6}}
|
|
23
|
+
"scripts": {
|
|
24
|
+
"prebuild": "rm -rf dist",
|
|
25
|
+
"build": "tsc{{#supportsES6}} && tsc -p tsconfig.esm.json{{/supportsES6}}"{{^sagasAndRecords}},
|
|
26
|
+
"prepare": "npm run build"{{/sagasAndRecords}}
|
|
27
|
+
},
|
|
28
|
+
{{/packageAsSourceOnlyLibrary}}
|
|
29
|
+
"devDependencies": {
|
|
30
|
+
{{#sagasAndRecords}}
|
|
31
|
+
"immutable": "^4.0.0-rc.12",
|
|
32
|
+
"normalizr": "^3.6.1",
|
|
33
|
+
"redux-saga": "^1.1.3",
|
|
34
|
+
"redux-ts-simple": "^3.2.0",
|
|
35
|
+
"reselect": "^4.0.0",
|
|
36
|
+
{{/sagasAndRecords}}
|
|
37
|
+
"typescript": "^4.0 || ^5.0"
|
|
38
|
+
}{{#npmRepository}},{{/npmRepository}}
|
|
39
|
+
{{#npmRepository}}
|
|
40
|
+
"publishConfig": {
|
|
41
|
+
"registry": "{{npmRepository}}"
|
|
42
|
+
}
|
|
43
|
+
{{/npmRepository}}
|
|
44
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astrada.co/ts-astrada-sdk",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"author": "FidelLimited",
|
|
6
6
|
"license": "MIT",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"homepage": "https://github.com/FidelLimited/ts-astrada-sdk#readme",
|
|
12
12
|
"main": "lib/index.js",
|
|
13
13
|
"scripts": {
|
|
14
|
-
"prebuild": "rm -rf
|
|
14
|
+
"prebuild": "rm -rf dist",
|
|
15
15
|
"build": "tsc"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
Binary file
|