Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release/1.0.0 #65

Merged
merged 314 commits into from
Sep 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
314 commits
Select commit Hold shift + click to select a range
5e73d60
refactor: rename func
akastercomcom Sep 5, 2023
5e40aff
refactor: indent
akastercomcom Sep 5, 2023
faf4888
Merge pull request #10 from ainize-team/feat/woojae/service
akastercomcom Sep 5, 2023
60be753
style: spaces
yoojinko Sep 5, 2023
5a20f3c
Merge branch 'develop' into feature/yoojin/app_module
yoojinko Sep 5, 2023
a72dcb2
style: match styles.
yoojinko Sep 5, 2023
91ad02e
refactor: base structure
akastercomcom Sep 5, 2023
da009fd
style: fix
yoojinko Sep 5, 2023
49d2100
Merge pull request #11 from ainize-team/feature/yoojin/app_module
yoojinko Sep 5, 2023
04f3e81
merge
akastercomcom Sep 5, 2023
6c187d5
indent
akastercomcom Sep 5, 2023
44b0458
refactor: privatE
akastercomcom Sep 5, 2023
e431d7d
refactor: wallet extend moduleBase
akastercomcom Sep 5, 2023
a279388
feat: add set admin function
yoojinko Sep 5, 2023
3a835ee
refactor: private to protected
akastercomcom Sep 5, 2023
91b226c
fix:handler fitler
akastercomcom Sep 5, 2023
af781ae
refactor: delete unuse import
akastercomcom Sep 5, 2023
3c2475c
refactor: delete space
akastercomcom Sep 5, 2023
c21283b
refactor: delete space
akastercomcom Sep 5, 2023
d243f00
Merge pull request #13 from ainize-team/feature/yoojin/app_module
yoojinko Sep 5, 2023
c2b420c
reafactor: quote to doubleQuote
akastercomcom Sep 5, 2023
430cc34
reafactor: quote to doubleQuote
akastercomcom Sep 5, 2023
7bc6e82
refactor: delete import
akastercomcom Sep 6, 2023
1780979
Merge pull request #12 from ainize-team/feat/woojae/serviceBase
akastercomcom Sep 6, 2023
60d56a1
feat: useService
akastercomcom Sep 6, 2023
6fc13d9
refactor: delete import
akastercomcom Sep 6, 2023
84b5673
refactor: divide
akastercomcom Sep 6, 2023
05e178f
refactor: indent
akastercomcom Sep 6, 2023
df86742
refactor: indent
akastercomcom Sep 6, 2023
bfa70d1
refactor: indent
akastercomcom Sep 6, 2023
c0dfbf6
refactor: batch
akastercomcom Sep 6, 2023
e42a87c
refactor: batch
akastercomcom Sep 6, 2023
72a15d6
docs: add jsdoc example
yoojinko Sep 6, 2023
1a53e51
Merge pull request #14 from ainize-team/feat/woojae/useService
akastercomcom Sep 6, 2023
42b278d
fix: remove packgae-lock.json
yoojinko Sep 6, 2023
4d47d30
feat: add handleTxResultWrapper
yoojinko Sep 6, 2023
d66e6d1
fix: path
yoojinko Sep 6, 2023
2756876
doc: tsdoc
akastercomcom Sep 6, 2023
ba692e1
0.0.2
akastercomcom Sep 6, 2023
6a4760d
1.0.0
akastercomcom Sep 6, 2023
331e3ae
1.1.0
akastercomcom Sep 6, 2023
b7fea89
fix: tx result wrapper and
yoojinko Sep 6, 2023
217d18a
fix: set functions error
yoojinko Sep 6, 2023
e8efbb9
Merge branch 'develop' into feature/yoojin/init_jsdoc
yoojinko Sep 6, 2023
a8346db
Merge pull request #15 from ainize-team/feature/yoojin/init_jsdoc
yoojinko Sep 6, 2023
5dc7221
refactor: upper case
akastercomcom Sep 7, 2023
5b3998d
delete package-lock.json
akastercomcom Sep 7, 2023
f7c7b77
Merge pull request #16 from ainize-team/feat/woojae/jsdoc
akastercomcom Sep 7, 2023
84ba9f3
docs: add js docs
yoojinko Sep 7, 2023
33ec1f4
Merge branch 'develop' into feature/yoojin/init_jsdoc
yoojinko Sep 7, 2023
3a97a0e
update version
akastercomcom Sep 7, 2023
5627829
refactor: changeBalance type
yoojinko Sep 7, 2023
80679b5
fix:
akastercomcom Sep 7, 2023
cb58727
fix:
akastercomcom Sep 7, 2023
addca9a
Merge pull request #18 from ainize-team/feature/yoojin/types
yoojinko Sep 7, 2023
da1c509
Merge pull request #17 from ainize-team/feature/yoojin/init_jsdoc
yoojinko Sep 7, 2023
e796837
Merge pull request #19 from ainize-team/fix/woojae/wallet
akastercomcom Sep 7, 2023
be925d3
fix: dec_value
akastercomcom Sep 7, 2023
fdc72ca
Merge pull request #20 from ainize-team/fix/woojae/dec
akastercomcom Sep 7, 2023
cd14c27
fix: request rule
yoojinko Sep 7, 2023
c839985
fix: default account
akastercomcom Sep 8, 2023
44ec4ef
feat: getDataFromServiceRequest
akastercomcom Sep 8, 2023
20632bd
refactor: billingConfigService
akastercomcom Sep 8, 2023
99f3527
refactor: indent
akastercomcom Sep 8, 2023
464d3bb
refactor: indent
akastercomcom Sep 8, 2023
782670a
Merge pull request #22 from ainize-team/fix/woojae/writeRequest
akastercomcom Sep 8, 2023
48949b8
style: space
yoojinko Sep 8, 2023
2919b53
fix: handle tx error
yoojinko Sep 8, 2023
5ab1fc5
fix: remove todo
yoojinko Sep 8, 2023
6305c1d
fix: account check
yoojinko Sep 8, 2023
77f26b4
Merge pull request #24 from ainize-team/fix/yoojin/after_test
yoojinko Sep 8, 2023
42818a2
fix: write rule
yoojinko Sep 8, 2023
1640be0
fix: params
yoojinko Sep 8, 2023
c7c1b03
fix: default billing config should set on create
yoojinko Sep 8, 2023
b3963da
fix: write rule
yoojinko Sep 8, 2023
9de9c9e
Merge pull request #25 from ainize-team/feature/yoojin/new_rule
yoojinko Sep 8, 2023
6ff8bdc
Merge branch 'develop' into feat/woojae/reqToVar
yoojinko Sep 8, 2023
fee58cd
refactor: rename
akastercomcom Sep 8, 2023
908c212
merge
akastercomcom Sep 8, 2023
4f1fdb8
Merge remote-tracking branch 'origin/feat/woojae/reqToVar' into feat/…
akastercomcom Sep 8, 2023
082582c
reafactor: minCost
akastercomcom Sep 8, 2023
26faa8d
Merge pull request #23 from ainize-team/feat/woojae/reqToVar
akastercomcom Sep 8, 2023
bf066ad
feat: add billingConfig and configOfService rule
yoojinko Sep 8, 2023
2b65007
feat: add billingConfigOfService
yoojinko Sep 8, 2023
c17f28e
fix: check default set
yoojinko Sep 8, 2023
894bf6a
Merge pull request #26 from ainize-team/feature/yoojin/app_module
yoojinko Sep 8, 2023
6f8bc20
fix: remove default set flag
yoojinko Sep 11, 2023
dc15174
fix: move default set functions in app module
yoojinko Sep 11, 2023
10cdf2d
fix: move trigger function url map to types
yoojinko Sep 11, 2023
ecf0450
refactor: remove service tf set when app create
yoojinko Sep 11, 2023
24a7fea
refactor: param
yoojinko Sep 11, 2023
26079a6
docs: add readme
yoojinko Sep 11, 2023
f22ee1f
style: space
yoojinko Sep 11, 2023
b5a6288
docs: value desc
yoojinko Sep 11, 2023
7ee3a84
Merge pull request #27 from ainize-team/feature/yoojin/app_module
yoojinko Sep 11, 2023
1d829c3
Merge pull request #28 from ainize-team/docs/yoojin/readme
yoojinko Sep 11, 2023
ee5821b
docs: unlicense -> mit
yoojinko Sep 12, 2023
fd2b39f
Merge pull request #29 from ainize-team/docs/yoojin/license
yoojinko Sep 12, 2023
38b5c83
feat: add get default account to moduleBase
yoojinko Sep 12, 2023
341e8b9
feat: check defaultAccount at getDefaultAccount
yoojinko Sep 12, 2023
c6bb3d7
feat: use getDefaultAccount
yoojinko Sep 12, 2023
2ef3217
refactor: change getDefaultAccount to address
yoojinko Sep 12, 2023
6a2f101
refactor: change to getDefaultAddress
yoojinko Sep 12, 2023
57174f8
fix: error msg
yoojinko Sep 12, 2023
478859c
Merge pull request #30 from ainize-team/feature/yoojin/get_default_ac…
yoojinko Sep 12, 2023
526fe8d
refactor: add req,res type
akastercomcom Sep 12, 2023
344e8c1
refactor: requestData to request
akastercomcom Sep 12, 2023
7da0224
refactor: prompt to requestData
akastercomcom Sep 12, 2023
435102e
feat: add serviceBillingConfig
yoojinko Sep 13, 2023
8d4124f
style: space
yoojinko Sep 13, 2023
a0c7cb7
Merge pull request #32 from ainize-team/feature/yoojin/set_service_bi…
yoojinko Sep 13, 2023
71793cc
refactor: amount to cost
akastercomcom Sep 13, 2023
17dafe2
Merge pull request #31 from ainize-team/refactor/woojae/reqResType
akastercomcom Sep 13, 2023
e404ba1
refactor: checkCostAndBalance
akastercomcom Sep 13, 2023
778b297
Merge pull request #33 from ainize-team/refactor/woojae/checkCostAndB…
akastercomcom Sep 13, 2023
19044ee
fix: throw all tx result
yoojinko Sep 13, 2023
603c0ec
fix: billing config rules
yoojinko Sep 13, 2023
de87a41
billingconfig
akastercomcom Sep 13, 2023
99fc580
fix: request rule
yoojinko Sep 13, 2023
5b46a95
fix: delete maxCost elseIf
akastercomcom Sep 13, 2023
cdbd125
revert
akastercomcom Sep 13, 2023
521b049
Merge pull request #34 from ainize-team/refactor/woojae/checkCostAndB…
akastercomcom Sep 13, 2023
a751210
feat: add maxCost rule
yoojinko Sep 13, 2023
26d0c5a
fix: typo
yoojinko Sep 13, 2023
b2c93b3
fix: rule null check
yoojinko Sep 13, 2023
227713e
fix: request rull null check
yoojinko Sep 13, 2023
d01dd71
fix: send transaction to wrapped method
yoojinko Sep 13, 2023
f7a870e
fix: uncomment
yoojinko Sep 13, 2023
92186d1
fix: type
yoojinko Sep 13, 2023
4a89b80
Merge pull request #35 from ainize-team/feature/yoojin/billing_config…
yoojinko Sep 13, 2023
e2ab8f1
fix: delete Timeout
akastercomcom Sep 14, 2023
652c9c5
Merge pull request #36 from ainize-team/fix/woojae/handler
akastercomcom Sep 14, 2023
600e39e
fix: delte interval
akastercomcom Sep 14, 2023
665fa5c
Merge pull request #37 from ainize-team/fix/woojae/handler
akastercomcom Sep 14, 2023
67f8d17
feat: modelSkeleton
akastercomcom Sep 18, 2023
108ef86
feat: add AinModule
yoojinko Sep 18, 2023
71cca96
refactor: private static instance
akastercomcom Sep 18, 2023
9842103
fix: static getInstance
yoojinko Sep 18, 2023
fbbfdc8
refactor: constructor to static
akastercomcom Sep 18, 2023
ea30ec3
refactor: modelController
akastercomcom Sep 18, 2023
f062f24
feat: add getDefaultAccount
yoojinko Sep 18, 2023
264877c
refactor: delete serviceName
akastercomcom Sep 18, 2023
a4a9ba5
Merge pull request #38 from ainize-team/feat/woojae/modelSkeleton
akastercomcom Sep 18, 2023
3023710
fix: throw error with check
yoojinko Sep 18, 2023
597e7b1
feat: add isDefaultAccountExist
yoojinko Sep 18, 2023
45aad18
Merge pull request #39 from ainize-team/feature/yoojin/seperate_ain
yoojinko Sep 18, 2023
c1f46c4
refactor: serviceName
akastercomcom Sep 19, 2023
db9d7ad
Merge pull request #40 from ainize-team/refactor/woojae/serviceName
akastercomcom Sep 19, 2023
35fb337
feat: add getValue
yoojinko Sep 19, 2023
3388997
Merge pull request #41 from ainize-team/feature/yoojin/seperate_ain
yoojinko Sep 19, 2023
0227acc
util
akastercomcom Sep 19, 2023
bbe4147
Merge branch 'develop' into feat/woojae/modelController
akastercomcom Sep 19, 2023
48672b2
modelController
akastercomcom Sep 19, 2023
9734673
modelController
akastercomcom Sep 19, 2023
e93ca76
refactor: ops
akastercomcom Sep 19, 2023
9bb9a86
feat: deposit Type
akastercomcom Sep 19, 2023
c3a44c2
refactor: move app to appController
yoojinko Sep 19, 2023
bfe339f
fix: isDefaultAccountExist
akastercomcom Sep 19, 2023
b0776a2
fix: buildTxBody
yoojinko Sep 19, 2023
0c7c839
fix: move default app rules to constant
yoojinko Sep 19, 2023
7aa2df5
style: space
yoojinko Sep 19, 2023
f8f28f4
refactor: remove app
yoojinko Sep 19, 2023
846f0f2
refactor: change app to appController
yoojinko Sep 19, 2023
69d9f88
Merge pull request #42 from ainize-team/feat/woojae/modelController
akastercomcom Sep 19, 2023
589bede
Merge branch 'develop' into feature/yoojin/appController
yoojinko Sep 19, 2023
0a5b508
fix: move appController path
yoojinko Sep 19, 2023
ce707ac
fix: remove requesterAddress
yoojinko Sep 19, 2023
557ae07
Merge pull request #43 from ainize-team/feature/yoojin/appController
yoojinko Sep 19, 2023
ad1fb2c
fix: import path
yoojinko Sep 19, 2023
2f3edc0
feat: add createApp on deploy
yoojinko Sep 19, 2023
94fda8e
feat: add setContainerStatus and use on createApp
yoojinko Sep 19, 2023
e7f02f8
feat: add hander at use
akastercomcom Sep 19, 2023
d4a8b8d
feat: return result
akastercomcom Sep 19, 2023
09705b7
style: space
yoojinko Sep 19, 2023
cd9cf07
add todo
yoojinko Sep 19, 2023
766c2b8
Merge pull request #44 from ainize-team/feature/yoojin/deployConfig
yoojinko Sep 19, 2023
952e231
refactor: em
akastercomcom Sep 19, 2023
c409c54
Merge pull request #45 from ainize-team/feat/woojae/handler
akastercomcom Sep 19, 2023
2cbe6fc
feat: add account controll
yoojinko Sep 20, 2023
97ea281
feat: add ainize methods
yoojinko Sep 20, 2023
5c1bc41
feat: add getBalance
yoojinko Sep 20, 2023
4650ad6
fix: change createAinAccount to static
yoojinko Sep 20, 2023
0cbe54a
style: semi colon
yoojinko Sep 20, 2023
b9c5bdd
Merge branch 'develop' into feature/yoojin/ainize_methods
yoojinko Sep 20, 2023
d8ec315
fix: path
yoojinko Sep 20, 2023
cc06695
Merge pull request #46 from ainize-team/feature/yoojin/ainize_methods
yoojinko Sep 20, 2023
3262d40
feat: connect
akastercomcom Sep 20, 2023
fbf5971
feat: isRunning
akastercomcom Sep 20, 2023
2d27a44
Merge pull request #47 from ainize-team/feat/woojae/status
akastercomcom Sep 20, 2023
719180b
fix: add internal
akastercomcom Sep 20, 2023
625ea5e
refactor: space
akastercomcom Sep 20, 2023
b8b1b2f
refactor: space
akastercomcom Sep 20, 2023
93d4296
Merge pull request #48 from ainize-team/fix/woojae/internal
akastercomcom Sep 20, 2023
60fd8f1
fix: handler init
akastercomcom Sep 20, 2023
1feb377
fix: login
akastercomcom Sep 20, 2023
2b39280
feat: logout disconnect
akastercomcom Sep 20, 2023
ee5a97f
Merge pull request #49 from ainize-team/fix/woojae/ainInit
akastercomcom Sep 20, 2023
9cdc4b2
feat: model check
akastercomcom Sep 20, 2023
53c04e7
Merge pull request #50 from ainize-team/feat/woojae/modelCheck
akastercomcom Sep 20, 2023
d67cf66
feat: add txResultWrapper
yoojinko Sep 20, 2023
22efb65
fix: write rules
yoojinko Sep 20, 2023
9a9d34e
Merge pull request #51 from ainize-team/feature/yoojin/txResultWrapper
yoojinko Sep 20, 2023
e547d6c
fix: depositAddress
akastercomcom Sep 20, 2023
b32fbfa
fix
akastercomcom Sep 20, 2023
007ee79
refactor: getCreditBalance
akastercomcom Sep 20, 2023
8b31a44
Merge pull request #52 from ainize-team/fix/woojae/depositAddress
akastercomcom Sep 20, 2023
eadd4bd
fix: handler
akastercomcom Sep 21, 2023
cb56952
Merge pull request #53 from ainize-team/fix/woojae/handler
akastercomcom Sep 21, 2023
453ff5f
feat: add service function
yoojinko Sep 21, 2023
a640406
fix: trigger function
yoojinko Sep 21, 2023
1544131
fix: typo
yoojinko Sep 21, 2023
97a6915
Merge pull request #54 from ainize-team/fix/yoojin/trigger_function
yoojinko Sep 21, 2023
9851825
feat: add eventHandler
akastercomcom Sep 21, 2023
1718fc0
refactor: integrate subscribe
akastercomcom Sep 21, 2023
4e92490
Merge pull request #55 from ainize-team/feat/woojae/deployEventHandler
akastercomcom Sep 21, 2023
c06e51c
fix: deploy listen path
akastercomcom Sep 21, 2023
40ef701
Merge pull request #56 from ainize-team/fix/woojae/deployPath
akastercomcom Sep 21, 2023
3852a6a
docs: remove module docs
yoojinko Sep 21, 2023
852e999
docs: ainize
yoojinko Sep 21, 2023
3696f4b
Merge branch 'develop' into docs/yoojin/typedocs
yoojinko Sep 21, 2023
f43e185
docs: fix expression
yoojinko Sep 21, 2023
8476ab1
Merge pull request #57 from ainize-team/docs/yoojin/typedocs
yoojinko Sep 21, 2023
75a0237
feat: add typedoc
akastercomcom Sep 22, 2023
76eb1b2
refactor: delete
akastercomcom Sep 22, 2023
a7a065b
refactor: add types at modelController
akastercomcom Sep 22, 2023
347abbb
.gitignore docs/
akastercomcom Sep 22, 2023
30f19d7
refactor: getInformation
akastercomcom Sep 22, 2023
8db5b1d
refactor
akastercomcom Sep 22, 2023
30aaafa
indent
akastercomcom Sep 22, 2023
5726a5d
Merge pull request #58 from ainize-team/feat/woojae/typedoc
akastercomcom Sep 22, 2023
42054e1
feat: model run and stop
akastercomcom Sep 22, 2023
8cdefa9
fix: adminPath
akastercomcom Sep 22, 2023
c71ee0a
Merge pull request #59 from ainize-team/feat/woojae/modelAdmin
akastercomcom Sep 22, 2023
0f8a8d6
Update docs.yml
akastercomcom Sep 22, 2023
9d4e1e1
Update docs.yml
akastercomcom Sep 22, 2023
9e533b4
feat: typedoc
akastercomcom Sep 25, 2023
1a4f733
fix
akastercomcom Sep 25, 2023
ecfc4ee
Merge pull request #60 from ainize-team/feat/woojae/typedoc.json
akastercomcom Sep 25, 2023
47d6d86
fix: entrypoint
akastercomcom Sep 25, 2023
df20068
fix: hide private
akastercomcom Sep 25, 2023
812e3eb
Merge pull request #61 from ainize-team/feat/woojae/typedoc.json
akastercomcom Sep 25, 2023
5562e43
docs: fix readme
yoojinko Sep 25, 2023
4e92b0e
fix: unused value
yoojinko Sep 25, 2023
8eac130
Merge pull request #62 from ainize-team/docs/yoojin/readme2
yoojinko Sep 25, 2023
6a6fc6b
refactor: rename
akastercomcom Sep 25, 2023
4da9d98
refactor: rename
akastercomcom Sep 25, 2023
77dddb7
Merge pull request #63 from ainize-team/feat/woojae/rename
akastercomcom Sep 26, 2023
b884ddc
fix: docs pipeline
yoojinko Sep 26, 2023
298417d
chore: update package ver
yoojinko Sep 26, 2023
2ecb636
Merge branch 'main' into release/1.0.0
yoojinko Sep 26, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .DS_Store
Binary file not shown.
93 changes: 35 additions & 58 deletions .github/workflows/create_release.yml
Original file line number Diff line number Diff line change
@@ -1,62 +1,39 @@
# github action name
name: Auto Publish - patch update

# develop 브랜치에 push 되면 자동 patch update를 한다는 구현
name: Create Release Branch
on:
push:
branches: [ develop ]

# 실제 실행 구현부
workflow_dispatch:
inputs:
version:
type: choice
description: Sematic version type of new version
options:
- patch
- minor
- major
jobs:
# build 환경
build:
release:
runs-on: ubuntu-latest
permissions:
contents: write
strategy:
matrix:
node-version: [16.13.1]
# 실행할 순서

steps:
# github action에서 NodeJS 세팅을 위한 actions/setup-node@v2 action을 사용
- uses: actions/checkout@v2
- name: Set up NodeJS ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
registry-url: https://registry.npmjs.org/
# yarn을 사용하기에 yarn을 global install하고 install dependencies
- name : Install Dependencies
run: |
npm install -g yarn
npm install --legacy-peer-deps --save-dev --ignore-scripts install-peers
yarn install
# npm version을 patch 명령어를 통해 올리고, 리눅스 파이프라인 명령어를 통해 patch로 변경한 버전을 저장
- name : Patch
run: |
npm version patch > version.txt
# 저장한 버전 파일을 읽어 변수로 사용하기 위해 외부 action을 사용 -> setps.{id}.outputs.content로 사용 가능
- name: Read version.txt
id: commit
uses: juliangruber/read-file-action@v1
with:
path: ./version.txt
# version을 변경한 package.json을 commit, 바뀐 버전으로 commit message 작성 후 push
- name: Deploy and Push
run: |
git config --global user.name "${GITHUB_ACTOR}"
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com"
git add package.json
git commit -m "${{ (steps.commit.outputs.content) }}"
echo ${{ (steps.commit.outputs.content) }}
yarn deploy
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
# slack 웹훅을 통해 채널에 전송
- name: Send result to slack
uses: Ilshidur/[email protected]
with:
args: "버전 ➡️${{ (steps.commit.outputs.content) }}의 결과는 ➡️${{ job.status }} 에요"
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
if: always()
- uses: actions/checkout@v3
with:
ref: develop
- name: Git configuration
run: |
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com"
git config --global user.name "${GITHUB_ACTOR}"
- name: Upgrade version
run: |
yarn --no-git-tag-version version --$RELEASE_TYPE
echo "NEW_VERSION=$(npm pkg get version | tr -d '"')" >> $GITHUB_ENV
env:
RELEASE_TYPE: ${{ github.event.inputs.version }}
- name: Create release branch
run: |
git checkout -b release/${{ env.NEW_VERSION }}
git add "package.json"
git commit -m "Upgrade version to ${{ env.NEW_VERSION }}"
git push origin release/${{ env.NEW_VERSION }}
gh pr create -B main -H release/${{ env.NEW_VERSION }} -d --title 'Upgrade version to ${{ env.NEW_VERSION }}' --body 'Upgrade version to ${{ env.NEW_VERSION }}'
gh pr create -B develop -H release/${{ env.NEW_VERSION }} -d --title 'Release/${{ env.NEW_VERSION }} -> develop' --body 'Upgrade version to ${{ env.NEW_VERSION }}'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
21 changes: 21 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Docs
on:
push:
branches: [main]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
with:
fetch-depth: 0 # otherwise, you will failed to push refs to dest repo
- uses: actions/setup-node@v3
with:
node-version: 16 # typedoc require node version >= 14.14
- name: Build Docs
run: yarn && yarn docs
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs
23 changes: 23 additions & 0 deletions .github/workflows/pr_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Test Pipeline for opened PR
on:
pull_request:
branches: [ main, develop ] #put your branches which you want to execute test pipeline
types: [ opened, ready_for_review ]
concurrency:
group: ${{ github.event.pull_request.number }}
cancel-in-progress: true
jobs:
run_test:
runs-on: ubuntu-latest
strategy:
matrix:
node: [ 16 ]
name: Run Test on Node ${{ matrix.node }}
steps:
- uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
- run: yarn install --immutable --immutable-cache --check-cache
- run: yarn test
78 changes: 78 additions & 0 deletions .github/workflows/pr_test_when_merged.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: Test Pipeline for Merged PR
on:
pull_request:
branches: [ main, develop ]
types: [ closed ]
concurrency:
group: ${{ github.event.pull_request.number }}
cancel-in-progress: true
jobs:
run_test:
if: ${{ github.event.pull_request.merged == true }}
runs-on: ubuntu-latest
strategy:
matrix:
node: [ 16 ]
name: Run Test on Node ${{ matrix.node }}
steps:
- uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
- run: yarn install --immutable --immutable-cache --check-cache
- run: yarn test
publish:
needs: [ run_test ]
if: ${{ startsWith(github.head_ref, 'release/') && (github.base_ref == 'main') && (github.event.pull_request.merged == true) }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '16.x'
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies
run: yarn
- name: Test Success
run: yarn test
- name: Publish package
run: |
yarn
yarn build
yarn publish --access public
echo "NEW_VERSION=$(npm pkg get version | tr -d '"')" >> $GITHUB_ENV
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }}
- name: Push tag
run: |
git tag ${{ env.NEW_VERSION }}
git push --tags
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Notify package published to slack
uses: slackapi/[email protected]
with:
payload: |
{
"text": "Ainize-SDK ${{ env.NEW_VERSION }} is published",
"blocks": [
{
"type": "header",
"text": {
"type": "plain_text",
"text": "Ainize-SDK Release"
}
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "Version ${{ env.NEW_VERSION }} is published"
}
}
]
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
53 changes: 53 additions & 0 deletions .github/workflows/send_slack.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Send Error to Slack
on:
workflow_run:
workflows: [ Test Pipeline for Merged PR ]
types:
- completed
jobs:
on-failure:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'failure' }}
steps:
- uses: actions/checkout@v3
- name: Get error log
id: error_log
run: |
ERROR_LOG="$(gh run view ${{ github.event.workflow_run.id }} --log-failed | tail -n 7 | rev | cut -f 1 | rev | sed -r 's/\x1B\[(([0-9]+)(;[0-9]+)*)?[m,K,H,f,J]//g' | sed -z 's/\n/\\n/g' | sed 's/\t/ /g')"
echo "ERROR_LOG=$ERROR_LOG" >> $GITHUB_OUTPUT
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Notify error to slack
uses: slackapi/[email protected]
with:
payload: |
{
"text": "${{ github.event.workflow.name }} failed",
"blocks": [
{
"type": "header",
"text": {
"type": "plain_text",
"text": ":rotating_light:PIPELINE FAILED",
"emoji": true
}
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "${{ github.event.workflow.name }} failed"
}
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*Error log*\n```${{ steps.error_log.outputs.ERROR_LOG }}```\nCheck full logs in ${{ github.event.workflow_run.html_url }}"
}
}
]
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -128,3 +128,6 @@ dist
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*

# typedoc
docs/
37 changes: 17 additions & 20 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,24 +1,21 @@
This is free and unencumbered software released into the public domain.
MIT License

Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
Copyright (c) 2023 AINIZE Team

In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
of the public at large and to the detriment of our heirs and
successors. We intend this dedication to be an overt act of
relinquishment in perpetuity of all present and future rights to this
software under copyright law.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

For more information, please refer to <https://unlicense.org>
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
67 changes: 66 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,66 @@
# ainize-sdk
# ainize-sdk

A Typescript SDK for the Ainize, a system for running AI services on the AI Network.

## Requirements
node >= 16

## usage
### Install
```bash
npm install @ainize-team/ainize-sdk

yarn install @ainize-team/ainize-sdk
```

### Import
```typescript
import Ainize from '@ainize-team/ainize-sdk'
const ainize = new Ainize(<CHAIN_ID>);
```

CHAIN_ID
- 0: AI Network test net
- 1: AI Network main net

### Login
You should login to ainize with AI Network account before deploy the container.
```typescript
ainize.login(<YOUR_PRIVATE_KEY>);
```

### Deploy
You can deploy your AI model to ainize.
```typescript
const model = await ainize.deploy(<CONFIGURATION>);
```
CONFIGURATION
- modelName: The name you want to deploying model.
- billingConfig: Billing configuration required for model usage.
- depositAddress: The address for receiving AIN deposits.
- costPerToken: Cost per token for model usage.
- minCost: Minimum cost.
- maxCost: Maximum cost. (optional)

You can stop or run your model container. Model deployer only can use this.
```typescript
model.stop();
model.run();
```

### Using Model
You can use a model using `ainize.model(<MODEL_NAME>)`.
```typescript
const model = await ainize.model(<MODEL_NAME>);
```

You should deposit AIN to credit before using model.
```typescript
await model.deposit(<AMOUNT>);
const balance = await model.getCreditBalance();
```

If you have enough credit, you can use the model.
```typescript
const result = await model.use(<REQUEST_DATA>);
```
Loading