@open-norantec/utilities 2.10.0 → 2.11.0-beta.124.5

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.
@@ -1,6 +1,6 @@
1
1
  import { Context, ExecutionContext, Hono } from 'hono';
2
2
  import { z } from './zod';
3
- import { Bindings as BindingsType } from 'hono/types';
3
+ import { Bindings as BindingsType, Variables } from 'hono/types';
4
4
  import { Constructor, PartialDeep } from 'type-fest';
5
5
  import { ContentfulStatusCode } from 'hono/utils/http-status';
6
6
  import { OpenAPIObject } from 'openapi3-ts/oas31';
@@ -66,8 +66,11 @@ export declare class HonoUtil {
66
66
  authenticationTypes?: A;
67
67
  operationId?: string;
68
68
  }, handler: (context: HandlerContext<IS, Bindings, SS, A, HWR, GC>) => Promise<z.infer<OS>>) => void;
69
- getApp: () => Hono<{
69
+ getApp: <V extends Variables = object>({ version }: {
70
+ version?: string;
71
+ }) => Hono<{
70
72
  Bindings: Bindings;
73
+ Variables: V;
71
74
  }, import("hono/types").BlankSchema, "/">;
72
75
  };
73
76
  }
@@ -63,14 +63,14 @@ class HonoUtil {
63
63
  register: function (pathname, options, handler) {
64
64
  config[pathname] = Object.assign(Object.assign({}, options), { handler, authenticationTypes: Array.isArray(options === null || options === void 0 ? void 0 : options.authenticationTypes) ? options.authenticationTypes : [] });
65
65
  },
66
- getApp: function () {
66
+ getApp: function ({ version }) {
67
67
  const app = new hono_1.Hono();
68
68
  const hookContext = { use: app.use.bind(app) };
69
69
  const openAPIDocument = _.merge({
70
70
  openapi: '3.1.0',
71
71
  info: {
72
72
  title: 'API Documentation',
73
- version: '1.0.0',
73
+ version: version || '1.0.0',
74
74
  },
75
75
  paths: {},
76
76
  }, _.omit(openAPIObject, ['paths']));
@@ -23,10 +23,11 @@ export declare class OctoUtil {
23
23
  retryRequest: (error: import("octokit").RequestError, retries: number, retryAfter: number) => import("octokit").RequestError;
24
24
  };
25
25
  };
26
- ensureReleaseByTagName({ tagName, createReleaseRequestParameters, getReleaseByTagRequestParameters, }: {
26
+ ensureReleaseByTagName({ tagName, sha, createReleaseRequestParameters, getReleaseByTagRequestParameters, }: {
27
27
  tagName: string;
28
28
  createReleaseRequestParameters?: RequestParameters;
29
29
  getReleaseByTagRequestParameters?: RequestParameters;
30
+ sha?: string;
30
31
  }): Promise<{
31
32
  url: string;
32
33
  html_url: string;
@@ -38,14 +38,14 @@ class OctoUtil {
38
38
  return this.octokitInstance;
39
39
  }
40
40
  ensureReleaseByTagName(_a) {
41
- return __awaiter(this, arguments, void 0, function* ({ tagName, createReleaseRequestParameters, getReleaseByTagRequestParameters, }) {
41
+ return __awaiter(this, arguments, void 0, function* ({ tagName, sha, createReleaseRequestParameters, getReleaseByTagRequestParameters, }) {
42
42
  return yield this.octokit.rest.repos
43
43
  .getReleaseByTag(Object.assign(Object.assign({}, getReleaseByTagRequestParameters), { owner: this.config.owner, repo: this.config.repo, tag: tagName }))
44
44
  .then((response) => response.data)
45
45
  .catch((error) => {
46
46
  if ((error === null || error === void 0 ? void 0 : error.status) === 404) {
47
47
  return this.octokit.rest.repos
48
- .createRelease(Object.assign(Object.assign({}, createReleaseRequestParameters), { tag_name: tagName, target_commitish: 'main', owner: this.config.owner, repo: this.config.repo }))
48
+ .createRelease(Object.assign(Object.assign({}, createReleaseRequestParameters), { tag_name: tagName, target_commitish: sha !== null && sha !== void 0 ? sha : 'main', owner: this.config.owner, repo: this.config.repo }))
49
49
  .then((response) => response.data);
50
50
  }
51
51
  else {
package/package.json CHANGED
@@ -1,71 +1,71 @@
1
1
  {
2
- "name": "@open-norantec/utilities",
3
- "version": "2.10.0",
4
- "description": "NoranTec Utilities",
5
- "main": "dist/index.js",
6
- "scripts": {
7
- "test": "echo \"Error: no test specified\" && exit 1",
8
- "build:cjs": "rimraf dist && tsc -b",
9
- "build": "npm run build:cjs",
10
- "setup:exec": "node bin/nttc.js setup",
11
- "setup": "npm run build && node bin/nttc.js setup"
2
+ "name": "@open-norantec/utilities",
3
+ "version": "2.11.0-beta.124.5",
4
+ "description": "NoranTec Utilities",
5
+ "main": "dist/index.js",
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1",
8
+ "build:cjs": "rimraf dist && tsc -b",
9
+ "build": "npm run build:cjs",
10
+ "setup:exec": "node bin/nttc.js setup",
11
+ "setup": "npm run build && node bin/nttc.js setup"
12
+ },
13
+ "repository": {
14
+ "type": "git",
15
+ "url": "git+ssh://git@github.com/norantec/utilities.git"
16
+ },
17
+ "author": "lenconda <i@lenconda.top>",
18
+ "bugs": {
19
+ "url": "https://github.com/norantec/utilities/issues"
20
+ },
21
+ "files": [
22
+ "bin",
23
+ "dist",
24
+ "LICENSE",
25
+ "README.md"
26
+ ],
27
+ "type": "commonjs",
28
+ "publishConfig": {
29
+ "access": "public",
30
+ "registry": "https://registry.npmjs.org"
31
+ },
32
+ "homepage": "https://github.com/norantec/utilities#readme",
33
+ "devDependencies": {
34
+ "@types/colors": "^1.1.3",
35
+ "@types/lodash": "^4.17.25",
36
+ "@types/node": "18.11.18",
37
+ "cross-env": "^7.0.3",
38
+ "eslint": "^10.3.0",
39
+ "hono": "^4.13.2",
40
+ "octokit": "^5.0.5",
41
+ "rimraf": "^6.0.1",
42
+ "ts-node": "^10.0.0",
43
+ "type-fest": "^4.37.0",
44
+ "typescript": "^6.0.3"
45
+ },
46
+ "dependencies": {
47
+ "@stylistic/eslint-plugin": "5.10.0",
48
+ "@typescript-eslint/eslint-plugin": "^8.0.0",
49
+ "@typescript-eslint/parser": "^8.0.0",
50
+ "colors": "^1.4.0",
51
+ "eslint-config-prettier": "^10.0.0",
52
+ "eslint-plugin-prettier": "^5.0.0",
53
+ "lodash": "^4.18.1",
54
+ "openapi3-ts": "^4.6.1",
55
+ "prettier": "^3.0.0",
56
+ "uuid": "^11.1.0",
57
+ "zod": "^4.4.3"
58
+ },
59
+ "peerDependencies": {
60
+ "octokit": ">=5.0.0",
61
+ "hono": ">=4.0.0"
62
+ },
63
+ "peerDependenciesMeta": {
64
+ "octokit": {
65
+ "optional": true
12
66
  },
13
- "repository": {
14
- "type": "git",
15
- "url": "git+ssh://git@github.com/norantec/utilities.git"
16
- },
17
- "author": "lenconda <i@lenconda.top>",
18
- "bugs": {
19
- "url": "https://github.com/norantec/utilities/issues"
20
- },
21
- "files": [
22
- "bin",
23
- "dist",
24
- "LICENSE",
25
- "README.md"
26
- ],
27
- "type": "commonjs",
28
- "publishConfig": {
29
- "access": "public",
30
- "registry": "https://registry.npmjs.org"
31
- },
32
- "homepage": "https://github.com/norantec/utilities#readme",
33
- "devDependencies": {
34
- "@types/colors": "^1.1.3",
35
- "@types/lodash": "^4.17.25",
36
- "@types/node": "18.11.18",
37
- "cross-env": "^7.0.3",
38
- "eslint": "^10.3.0",
39
- "hono": "^4.13.2",
40
- "octokit": "^5.0.5",
41
- "rimraf": "^6.0.1",
42
- "ts-node": "^10.0.0",
43
- "type-fest": "^4.37.0",
44
- "typescript": "^6.0.3"
45
- },
46
- "dependencies": {
47
- "@stylistic/eslint-plugin": "5.10.0",
48
- "@typescript-eslint/eslint-plugin": "^8.0.0",
49
- "@typescript-eslint/parser": "^8.0.0",
50
- "colors": "^1.4.0",
51
- "eslint-config-prettier": "^10.0.0",
52
- "eslint-plugin-prettier": "^5.0.0",
53
- "lodash": "^4.18.1",
54
- "openapi3-ts": "^4.6.1",
55
- "prettier": "^3.0.0",
56
- "uuid": "^11.1.0",
57
- "zod": "^4.4.3"
58
- },
59
- "peerDependencies": {
60
- "octokit": ">=5.0.0",
61
- "hono": ">=4.0.0"
62
- },
63
- "peerDependenciesMeta": {
64
- "octokit": {
65
- "optional": true
66
- },
67
- "hono": {
68
- "optional": true
69
- }
67
+ "hono": {
68
+ "optional": true
70
69
  }
70
+ }
71
71
  }