@sygna/bridge-util 2.0.1 → 2.0.3

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.
@@ -3,16 +3,21 @@ on:
3
3
  push:
4
4
  branches:
5
5
  - master
6
+ - feat/fix_npmjs_workflow
7
+
8
+ permissions:
9
+ id-token: write # Required for OIDC
10
+ contents: read
6
11
 
7
12
  jobs:
8
13
  install-and-test:
9
14
  runs-on: ubuntu-latest
10
15
  steps:
11
16
  - uses: actions/checkout@v2
12
- - name: Use Node.js
13
- uses: actions/setup-node@v1
17
+ - name: Setup Node.js
18
+ uses: actions/setup-node@v4
14
19
  with:
15
- node-version: '12.12.0'
20
+ node-version: '20'
16
21
  registry-url: https://registry.npmjs.org/
17
22
  - name: Install dependencies
18
23
  run: |
@@ -22,6 +27,7 @@ jobs:
22
27
  npm run test
23
28
  - name: Publish
24
29
  run: |
25
- npm publish
30
+ npm publish --access public
26
31
  env:
32
+ # 使用傳統 Token 繞過 OIDC 比對
27
33
  NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
package/README.md CHANGED
@@ -18,7 +18,7 @@ During the communication of VASPs, there are some private information that must
18
18
 
19
19
  We're using [IVMS101 (interVASP Messaging Standard)](https://intervasp.org/) as our private information format.
20
20
 
21
- We also provide [IVMS101 Typescript Utility](https://github.com/CoolBitX-Technology/sygna-bridge-ivms-utils/tree/master/typescript) to construct data payload.
21
+ We also provide [IVMS101 Typescript Utility](https://github.com/sygnaio/sygna-bridge-ivms-utils/tree/master/typescript) to construct data payload.
22
22
 
23
23
  ```javascript
24
24
  const sensitive_data = {
package/package.json CHANGED
@@ -1,6 +1,9 @@
1
1
  {
2
2
  "name": "@sygna/bridge-util",
3
- "version": "2.0.1",
3
+ "version": "2.0.3",
4
+ "publishConfig": {
5
+ "access": "public"
6
+ },
4
7
  "description": "JavaScript library to interact with Sygna Bridge Server.",
5
8
  "main": "index.js",
6
9
  "scripts": {
@@ -8,9 +11,9 @@
8
11
  },
9
12
  "repository": {
10
13
  "type": "git",
11
- "url": "https://github.com/CoolBitX-Technology/sygna-bridge-util"
14
+ "url": "https://github.com/sygnaio/sygna-bridge-util"
12
15
  },
13
- "author": "kunming@coolbitx.com",
16
+ "author": "sygna.tech@coolbitx.com",
14
17
  "license": "MIT",
15
18
  "dependencies": {
16
19
  "ajv": "^6.12.0",
package/src/api/index.js CHANGED
@@ -101,6 +101,7 @@ class API {
101
101
  const headers = {
102
102
  'Content-Type': 'application/json',
103
103
  'x-api-key': this.api_key,
104
+ 'User-Agent': 'util-js/2.0.2"'
104
105
  };
105
106
  const response = await fetch(url, {
106
107
  method: 'POST',
@@ -115,7 +116,7 @@ class API {
115
116
  * @param {string} url
116
117
  */
117
118
  async getSB(url) {
118
- const headers = { 'x-api-key': this.api_key };
119
+ const headers = { 'x-api-key': this.api_key, 'User-Agent': 'util-js/2.0.2"' };
119
120
  const response = await fetch(url, { headers: headers });
120
121
  return await response.json();
121
122
  }