@k-int/bruno-shared-scripts 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/.gitlab-ci.yml ADDED
@@ -0,0 +1,40 @@
1
+ default:
2
+ # image: docker.libsdev.k-int.com/knowledgeintegration/stripes-build-agent:latest
3
+ # See https://github.com/angular/angular/blob/main/CONTRIBUTING.md#commit-header
4
+ image:
5
+ name: node:20
6
+ pull_policy: always
7
+ before_script:
8
+ # - npm config set @folio:registry "https://nexus.libsdev.k-int.com/repository/libsdev-npm-group/"
9
+ # - npm config set @knowledge-integration:registry "https://nexus.libsdev.k-int.com/repository/libsdev-npm-hosted/"
10
+ - npm config set -- //nexus.libsdev.k-int.com/repository/libsdev-npm-hosted/:_authToken $KI_NEXUS_NPM_TOKEN
11
+ - npm config set -- //nexus.libsdev.k-int.com/repository/libsdev-npm-snapshots-hosted/:_authToken $KI_NEXUS_NPM_TOKEN
12
+ # - npm config set registry "https://nexus.libsdev.k-int.com/repository/libsdev-npm-group/"
13
+ # - npm config set @k-int:registry "https://nexus.libsdev.k-int.com/repository/libsdev-npm-hosted/"
14
+ # - npm --registry "https://nexus.libsdev.k-int.com/repository/libsdev-npm-hosted/" adduser
15
+ # - npm --registry "https://nexus.libsdev.k-int.com/repository/libsdev-npm-hosted/" whoami
16
+ # - export NPM_TOKEN="$KI_NEXUS_NPM_TOKEN"
17
+ - export NPM_TOKEN="$NPMJS_TOKEN"
18
+ - git config --global user.name "ethanfreestone"
19
+ - git config --global user.email "ethan.freestone@k-int.com"
20
+ - npm install
21
+ - echo "token $GITLAB_TOKEN $NPM_TOKEN $KI_NEXUS_NPM_TOKEN"
22
+ cache:
23
+ key: ${CI_COMMIT_REF_SLUG}
24
+ paths:
25
+ - .npm/
26
+ tags:
27
+ - docker
28
+ # - docker-18
29
+ - ki-onprem
30
+ stages:
31
+ - release
32
+ publish:
33
+ stage: release
34
+ only:
35
+ - main
36
+ - /^[0-9]+.x/
37
+ script:
38
+ - npm run semantic-release
39
+ # We just need to npm-publish
40
+ # - npm --registry "$NPM_REGISTRY" publish --tag "${versionMajMin}-dev"
@@ -0,0 +1,17 @@
1
+ {
2
+ "branches": [{"name": "+([0-9]).x", "channel": "version${name.replace('.x', '')}"}, "main"],
3
+ "plugins": [
4
+ "@semantic-release/commit-analyzer",
5
+ "@semantic-release/release-notes-generator",
6
+ "@semantic-release/changelog",
7
+ "@semantic-release/gitlab",
8
+ "@semantic-release/npm",
9
+ [
10
+ "@semantic-release/git",
11
+ {
12
+ "assets": ["package.json", "CHANGELOG.md"],
13
+ "message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
14
+ }
15
+ ]
16
+ ]
17
+ }
package/CHANGELOG.md ADDED
@@ -0,0 +1,20 @@
1
+ # [1.2.0](https://gitlab.com/knowledge-integration/bruno/bruno-shared-scripts/compare/v1.1.1...v1.2.0) (2025-09-12)
2
+
3
+
4
+ ### Features
5
+
6
+ * Set up auto-release for bruno-shared-scripts ([6dbd472](https://gitlab.com/knowledge-integration/bruno/bruno-shared-scripts/commit/6dbd472424049927b871297f859d67a5c2eb407b))
7
+
8
+ # 1.0.0 (2025-09-12)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * Whoops... non-auth FOLIO requests failed ([734aac5](https://gitlab.com/knowledge-integration/bruno/bruno-shared-scripts/commit/734aac59490e8dc02ded6c949859a9ab7e211866))
14
+
15
+
16
+ ### Features
17
+
18
+ * folioAxios ([e92c60e](https://gitlab.com/knowledge-integration/bruno/bruno-shared-scripts/commit/e92c60e8b05e7cc0b81577cae5bc71c4bfbeddb8))
19
+ * Set up auto-release for bruno-shared-scripts ([6dbd472](https://gitlab.com/knowledge-integration/bruno/bruno-shared-scripts/commit/6dbd472424049927b871297f859d67a5c2eb407b))
20
+ * working workspace ([f3dc88c](https://gitlab.com/knowledge-integration/bruno/bruno-shared-scripts/commit/f3dc88c3d870ce8621e92ab713fd35245ede735e))
package/README.md ADDED
File without changes
package/es/index.js CHANGED
@@ -103,9 +103,7 @@ var init_login = __esm({
103
103
  url,
104
104
  creds,
105
105
  config
106
- ).catch((err) => {
107
- console.error("Failed to login to FOLIO: %o", err);
108
- });
106
+ );
109
107
  }
110
108
  };
111
109
  loginFunc = async ({
@@ -122,6 +120,8 @@ var init_login = __esm({
122
120
  if (!withExpiry) {
123
121
  req.setHeader("x-okapi-token", getToken());
124
122
  }
123
+ }).catch((err) => {
124
+ console.error("Failed to login to folio: %o", err);
125
125
  });
126
126
  };
127
127
  login = (urlOverride) => loginFunc({ urlOverride, withExpiry: false });
@@ -222,5 +222,7 @@ var getFolioAxios = async ({
222
222
  }
223
223
  !suppressConsole && console.log("folioRequest ready with config: %o", config);
224
224
  return axios2.create(config);
225
+ }).catch((err) => {
226
+ console.error("Failed to login to folio: %o", err);
225
227
  });
226
228
  };
package/package.json CHANGED
@@ -1,14 +1,19 @@
1
1
  {
2
2
  "name": "@k-int/bruno-shared-scripts",
3
- "version": "1.1.0",
3
+ "version": "1.2.0",
4
4
  "exports": "./es/index.js",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
7
7
  "scripts": {
8
8
  "test": "echo \"Error: no test specified\" && exit 1",
9
- "build": "esbuild ./src/index.js --bundle --format=cjs --outdir=es --external:axios"
9
+ "build": "esbuild ./src/index.js --bundle --format=cjs --outdir=es --external:axios",
10
+ "semantic-release": "semantic-release"
10
11
  },
11
12
  "devDependencies": {
12
- "esbuild": "^0.25.2"
13
+ "esbuild": "^0.25.2",
14
+ "@semantic-release/changelog": "^6.0.3",
15
+ "@semantic-release/git": "^10.0.1",
16
+ "@semantic-release/gitlab": "^12.0.6",
17
+ "@semantic-release/npm": "^11.0.0"
13
18
  }
14
19
  }
package/src/auth/login.js CHANGED
@@ -48,9 +48,6 @@ const doALogin = async ({
48
48
  creds,
49
49
  config
50
50
  )
51
- .catch(err => {
52
- console.error("Failed to login to FOLIO: %o", err);
53
- });
54
51
  }
55
52
  }
56
53
 
@@ -73,6 +70,9 @@ const loginFunc = async ({
73
70
  // This is only populated on login, not login with expiry
74
71
  req.setHeader('x-okapi-token', getToken())
75
72
  }
73
+ })
74
+ .catch(err => {
75
+ console.error("Failed to login to folio: %o", err)
76
76
  });
77
77
  }
78
78
 
@@ -20,5 +20,7 @@ export const getFolioAxios = async ({
20
20
 
21
21
  !suppressConsole && console.log("folioRequest ready with config: %o", config);
22
22
  return axios.create(config);
23
+ }).catch(err => {
24
+ console.error("Failed to login to folio: %o", err)
23
25
  })
24
26
  }