eve-esi-client-ts 1.0.17 → 1.0.23
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/generate.yml +1 -16
- package/.github/workflows/publish.yml +69 -0
- package/.openapi-generator/VERSION +1 -1
- package/README.md +2 -2
- package/api.ts +1 -1
- package/common.ts +16 -2
- package/dist/common.d.ts +6 -0
- package/dist/common.js +18 -3
- package/dist/esm/common.d.ts +6 -0
- package/dist/esm/common.js +16 -2
- package/package.json +1 -1
|
@@ -68,19 +68,4 @@ jobs:
|
|
|
68
68
|
git add .
|
|
69
69
|
git commit -m "Auto generate: ${{ steps.bump.outputs.version }}"
|
|
70
70
|
git push
|
|
71
|
-
|
|
72
|
-
if: steps.check.outputs.changed == 'true'
|
|
73
|
-
uses: actions/setup-node@v4
|
|
74
|
-
with:
|
|
75
|
-
node-version: lts/*
|
|
76
|
-
registry-url: 'https://registry.npmjs.org'
|
|
77
|
-
- name: Install dependencies
|
|
78
|
-
if: steps.check.outputs.changed == 'true'
|
|
79
|
-
run: |
|
|
80
|
-
rm -rf node_modules package-lock.json
|
|
81
|
-
npm install
|
|
82
|
-
- name: Publish to NPM
|
|
83
|
-
if: steps.check.outputs.changed == 'true'
|
|
84
|
-
run: npm publish --provenance --access public
|
|
85
|
-
env:
|
|
86
|
-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
71
|
+
# Publishing is now handled in a separate workflow (.github/workflows/publish.yml)
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
name: Publish
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_run:
|
|
5
|
+
workflows:
|
|
6
|
+
- "Generate Client"
|
|
7
|
+
types:
|
|
8
|
+
- completed
|
|
9
|
+
workflow_dispatch:
|
|
10
|
+
|
|
11
|
+
permissions:
|
|
12
|
+
contents: write
|
|
13
|
+
id-token: write
|
|
14
|
+
|
|
15
|
+
jobs:
|
|
16
|
+
publish:
|
|
17
|
+
name: Publish to NPM
|
|
18
|
+
runs-on: ubuntu-latest
|
|
19
|
+
if: ${{ (github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success') || github.event_name == 'workflow_dispatch' }}
|
|
20
|
+
steps:
|
|
21
|
+
- uses: actions/checkout@v4
|
|
22
|
+
with:
|
|
23
|
+
fetch-depth: 0
|
|
24
|
+
|
|
25
|
+
- name: Check last commit for generation
|
|
26
|
+
id: check_commit
|
|
27
|
+
run: |
|
|
28
|
+
git fetch --prune --unshallow || true
|
|
29
|
+
# If this run was started manually, always attempt to publish
|
|
30
|
+
if [ "$GITHUB_EVENT_NAME" = "workflow_dispatch" ]; then
|
|
31
|
+
echo "changed=true" >> $GITHUB_OUTPUT
|
|
32
|
+
LAST_COMMIT_MSG="(manual run)"
|
|
33
|
+
echo "last_msg<<EOF" >> $GITHUB_OUTPUT
|
|
34
|
+
echo "$LAST_COMMIT_MSG" >> $GITHUB_OUTPUT
|
|
35
|
+
echo "EOF" >> $GITHUB_OUTPUT
|
|
36
|
+
exit 0
|
|
37
|
+
fi
|
|
38
|
+
|
|
39
|
+
LAST_COMMIT_MSG="$(git log -1 --pretty=%B)"
|
|
40
|
+
echo "last_msg<<EOF" >> $GITHUB_OUTPUT
|
|
41
|
+
echo "$LAST_COMMIT_MSG" >> $GITHUB_OUTPUT
|
|
42
|
+
echo "EOF" >> $GITHUB_OUTPUT
|
|
43
|
+
if [[ "$LAST_COMMIT_MSG" == Auto\ generate:* ]]; then
|
|
44
|
+
echo "changed=true" >> $GITHUB_OUTPUT
|
|
45
|
+
else
|
|
46
|
+
echo "changed=false" >> $GITHUB_OUTPUT
|
|
47
|
+
fi
|
|
48
|
+
|
|
49
|
+
- name: No generated changes
|
|
50
|
+
if: steps.check_commit.outputs.changed == 'false'
|
|
51
|
+
run: |
|
|
52
|
+
echo "No generated changes to publish."
|
|
53
|
+
|
|
54
|
+
- name: Set up Node.js
|
|
55
|
+
if: steps.check_commit.outputs.changed == 'true'
|
|
56
|
+
uses: actions/setup-node@v4
|
|
57
|
+
with:
|
|
58
|
+
node-version: lts/*
|
|
59
|
+
registry-url: 'https://registry.npmjs.org'
|
|
60
|
+
|
|
61
|
+
- name: Install dependencies
|
|
62
|
+
if: steps.check_commit.outputs.changed == 'true'
|
|
63
|
+
run: |
|
|
64
|
+
rm -rf node_modules package-lock.json
|
|
65
|
+
npm install
|
|
66
|
+
|
|
67
|
+
- name: Publish to NPM
|
|
68
|
+
if: steps.check_commit.outputs.changed == 'true'
|
|
69
|
+
run: npm publish --provenance --access public
|
|
@@ -1 +1 @@
|
|
|
1
|
-
7.
|
|
1
|
+
7.20.0-SNAPSHOT
|
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
## eve-esi-client-ts@1.0.
|
|
1
|
+
## eve-esi-client-ts@1.0.23
|
|
2
2
|
|
|
3
3
|
This generator creates TypeScript/JavaScript client that utilizes [axios](https://github.com/axios/axios). The generated Node module can be used in the following environments:
|
|
4
4
|
|
|
@@ -36,7 +36,7 @@ navigate to the folder of your consuming project and run one of the following co
|
|
|
36
36
|
_published:_
|
|
37
37
|
|
|
38
38
|
```
|
|
39
|
-
npm install eve-esi-client-ts@1.0.
|
|
39
|
+
npm install eve-esi-client-ts@1.0.23 --save
|
|
40
40
|
```
|
|
41
41
|
|
|
42
42
|
_unPublished (not recommended):_
|
package/api.ts
CHANGED
|
@@ -18,7 +18,7 @@ import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios';
|
|
|
18
18
|
import globalAxios from 'axios';
|
|
19
19
|
// Some imports not used depending on template conditions
|
|
20
20
|
// @ts-ignore
|
|
21
|
-
import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from './common';
|
|
21
|
+
import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction, replaceWithSerializableTypeIfNeeded } from './common';
|
|
22
22
|
import type { RequestArgs } from './base';
|
|
23
23
|
// @ts-ignore
|
|
24
24
|
import { BASE_PATH, COLLECTION_FORMATS, BaseAPI, RequiredError, operationServerMap } from './base';
|
package/common.ts
CHANGED
|
@@ -66,7 +66,7 @@ export const setOAuthToObject = async function (object: any, name: string, scope
|
|
|
66
66
|
function setFlattenedQueryParams(urlSearchParams: URLSearchParams, parameter: any, key: string = ""): void {
|
|
67
67
|
if (parameter == null) return;
|
|
68
68
|
if (typeof parameter === "object") {
|
|
69
|
-
if (Array.isArray(parameter)) {
|
|
69
|
+
if (Array.isArray(parameter) || parameter instanceof Set) {
|
|
70
70
|
(parameter as any[]).forEach(item => setFlattenedQueryParams(urlSearchParams, item, key));
|
|
71
71
|
}
|
|
72
72
|
else {
|
|
@@ -91,13 +91,27 @@ export const setSearchParams = function (url: URL, ...objects: any[]) {
|
|
|
91
91
|
url.search = searchParams.toString();
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
+
/**
|
|
95
|
+
* JSON serialization helper function which replaces instances of unserializable types with serializable ones.
|
|
96
|
+
* This function will run for every key-value pair encountered by JSON.stringify while traversing an object.
|
|
97
|
+
* Converting a set to a string will return an empty object, so an intermediate conversion to an array is required.
|
|
98
|
+
*/
|
|
99
|
+
// @ts-ignore
|
|
100
|
+
export const replaceWithSerializableTypeIfNeeded = function(key: string, value: any) {
|
|
101
|
+
if (value instanceof Set) {
|
|
102
|
+
return Array.from(value);
|
|
103
|
+
} else {
|
|
104
|
+
return value;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
94
108
|
export const serializeDataIfNeeded = function (value: any, requestOptions: any, configuration?: Configuration) {
|
|
95
109
|
const nonString = typeof value !== 'string';
|
|
96
110
|
const needsSerialization = nonString && configuration && configuration.isJsonMime
|
|
97
111
|
? configuration.isJsonMime(requestOptions.headers['Content-Type'])
|
|
98
112
|
: nonString;
|
|
99
113
|
return needsSerialization
|
|
100
|
-
? JSON.stringify(value !== undefined ? value : {})
|
|
114
|
+
? JSON.stringify(value !== undefined ? value : {}, replaceWithSerializableTypeIfNeeded)
|
|
101
115
|
: (value || "");
|
|
102
116
|
}
|
|
103
117
|
|
package/dist/common.d.ts
CHANGED
|
@@ -23,6 +23,12 @@ export declare const setBasicAuthToObject: (object: any, configuration?: Configu
|
|
|
23
23
|
export declare const setBearerAuthToObject: (object: any, configuration?: Configuration) => Promise<void>;
|
|
24
24
|
export declare const setOAuthToObject: (object: any, name: string, scopes: string[], configuration?: Configuration) => Promise<void>;
|
|
25
25
|
export declare const setSearchParams: (url: URL, ...objects: any[]) => void;
|
|
26
|
+
/**
|
|
27
|
+
* JSON serialization helper function which replaces instances of unserializable types with serializable ones.
|
|
28
|
+
* This function will run for every key-value pair encountered by JSON.stringify while traversing an object.
|
|
29
|
+
* Converting a set to a string will return an empty object, so an intermediate conversion to an array is required.
|
|
30
|
+
*/
|
|
31
|
+
export declare const replaceWithSerializableTypeIfNeeded: (key: string, value: any) => any;
|
|
26
32
|
export declare const serializeDataIfNeeded: (value: any, requestOptions: any, configuration?: Configuration) => any;
|
|
27
33
|
export declare const toPathString: (url: URL) => string;
|
|
28
34
|
export declare const createRequestFunction: (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) => <T = unknown, R = AxiosResponse<T>>(axios?: AxiosInstance, basePath?: string) => Promise<R>;
|
package/dist/common.js
CHANGED
|
@@ -22,7 +22,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
22
22
|
});
|
|
23
23
|
};
|
|
24
24
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
-
exports.createRequestFunction = exports.toPathString = exports.serializeDataIfNeeded = exports.setSearchParams = exports.setOAuthToObject = exports.setBearerAuthToObject = exports.setBasicAuthToObject = exports.setApiKeyToObject = exports.assertParamExists = exports.DUMMY_BASE_URL = void 0;
|
|
25
|
+
exports.createRequestFunction = exports.toPathString = exports.serializeDataIfNeeded = exports.replaceWithSerializableTypeIfNeeded = exports.setSearchParams = exports.setOAuthToObject = exports.setBearerAuthToObject = exports.setBasicAuthToObject = exports.setApiKeyToObject = exports.assertParamExists = exports.DUMMY_BASE_URL = void 0;
|
|
26
26
|
const base_1 = require("./base");
|
|
27
27
|
exports.DUMMY_BASE_URL = 'https://example.com';
|
|
28
28
|
/**
|
|
@@ -78,7 +78,7 @@ function setFlattenedQueryParams(urlSearchParams, parameter, key = "") {
|
|
|
78
78
|
if (parameter == null)
|
|
79
79
|
return;
|
|
80
80
|
if (typeof parameter === "object") {
|
|
81
|
-
if (Array.isArray(parameter)) {
|
|
81
|
+
if (Array.isArray(parameter) || parameter instanceof Set) {
|
|
82
82
|
parameter.forEach(item => setFlattenedQueryParams(urlSearchParams, item, key));
|
|
83
83
|
}
|
|
84
84
|
else {
|
|
@@ -100,13 +100,28 @@ const setSearchParams = function (url, ...objects) {
|
|
|
100
100
|
url.search = searchParams.toString();
|
|
101
101
|
};
|
|
102
102
|
exports.setSearchParams = setSearchParams;
|
|
103
|
+
/**
|
|
104
|
+
* JSON serialization helper function which replaces instances of unserializable types with serializable ones.
|
|
105
|
+
* This function will run for every key-value pair encountered by JSON.stringify while traversing an object.
|
|
106
|
+
* Converting a set to a string will return an empty object, so an intermediate conversion to an array is required.
|
|
107
|
+
*/
|
|
108
|
+
// @ts-ignore
|
|
109
|
+
const replaceWithSerializableTypeIfNeeded = function (key, value) {
|
|
110
|
+
if (value instanceof Set) {
|
|
111
|
+
return Array.from(value);
|
|
112
|
+
}
|
|
113
|
+
else {
|
|
114
|
+
return value;
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
exports.replaceWithSerializableTypeIfNeeded = replaceWithSerializableTypeIfNeeded;
|
|
103
118
|
const serializeDataIfNeeded = function (value, requestOptions, configuration) {
|
|
104
119
|
const nonString = typeof value !== 'string';
|
|
105
120
|
const needsSerialization = nonString && configuration && configuration.isJsonMime
|
|
106
121
|
? configuration.isJsonMime(requestOptions.headers['Content-Type'])
|
|
107
122
|
: nonString;
|
|
108
123
|
return needsSerialization
|
|
109
|
-
? JSON.stringify(value !== undefined ? value : {})
|
|
124
|
+
? JSON.stringify(value !== undefined ? value : {}, exports.replaceWithSerializableTypeIfNeeded)
|
|
110
125
|
: (value || "");
|
|
111
126
|
};
|
|
112
127
|
exports.serializeDataIfNeeded = serializeDataIfNeeded;
|
package/dist/esm/common.d.ts
CHANGED
|
@@ -23,6 +23,12 @@ export declare const setBasicAuthToObject: (object: any, configuration?: Configu
|
|
|
23
23
|
export declare const setBearerAuthToObject: (object: any, configuration?: Configuration) => Promise<void>;
|
|
24
24
|
export declare const setOAuthToObject: (object: any, name: string, scopes: string[], configuration?: Configuration) => Promise<void>;
|
|
25
25
|
export declare const setSearchParams: (url: URL, ...objects: any[]) => void;
|
|
26
|
+
/**
|
|
27
|
+
* JSON serialization helper function which replaces instances of unserializable types with serializable ones.
|
|
28
|
+
* This function will run for every key-value pair encountered by JSON.stringify while traversing an object.
|
|
29
|
+
* Converting a set to a string will return an empty object, so an intermediate conversion to an array is required.
|
|
30
|
+
*/
|
|
31
|
+
export declare const replaceWithSerializableTypeIfNeeded: (key: string, value: any) => any;
|
|
26
32
|
export declare const serializeDataIfNeeded: (value: any, requestOptions: any, configuration?: Configuration) => any;
|
|
27
33
|
export declare const toPathString: (url: URL) => string;
|
|
28
34
|
export declare const createRequestFunction: (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) => <T = unknown, R = AxiosResponse<T>>(axios?: AxiosInstance, basePath?: string) => Promise<R>;
|
package/dist/esm/common.js
CHANGED
|
@@ -70,7 +70,7 @@ function setFlattenedQueryParams(urlSearchParams, parameter, key = "") {
|
|
|
70
70
|
if (parameter == null)
|
|
71
71
|
return;
|
|
72
72
|
if (typeof parameter === "object") {
|
|
73
|
-
if (Array.isArray(parameter)) {
|
|
73
|
+
if (Array.isArray(parameter) || parameter instanceof Set) {
|
|
74
74
|
parameter.forEach(item => setFlattenedQueryParams(urlSearchParams, item, key));
|
|
75
75
|
}
|
|
76
76
|
else {
|
|
@@ -91,13 +91,27 @@ export const setSearchParams = function (url, ...objects) {
|
|
|
91
91
|
setFlattenedQueryParams(searchParams, objects);
|
|
92
92
|
url.search = searchParams.toString();
|
|
93
93
|
};
|
|
94
|
+
/**
|
|
95
|
+
* JSON serialization helper function which replaces instances of unserializable types with serializable ones.
|
|
96
|
+
* This function will run for every key-value pair encountered by JSON.stringify while traversing an object.
|
|
97
|
+
* Converting a set to a string will return an empty object, so an intermediate conversion to an array is required.
|
|
98
|
+
*/
|
|
99
|
+
// @ts-ignore
|
|
100
|
+
export const replaceWithSerializableTypeIfNeeded = function (key, value) {
|
|
101
|
+
if (value instanceof Set) {
|
|
102
|
+
return Array.from(value);
|
|
103
|
+
}
|
|
104
|
+
else {
|
|
105
|
+
return value;
|
|
106
|
+
}
|
|
107
|
+
};
|
|
94
108
|
export const serializeDataIfNeeded = function (value, requestOptions, configuration) {
|
|
95
109
|
const nonString = typeof value !== 'string';
|
|
96
110
|
const needsSerialization = nonString && configuration && configuration.isJsonMime
|
|
97
111
|
? configuration.isJsonMime(requestOptions.headers['Content-Type'])
|
|
98
112
|
: nonString;
|
|
99
113
|
return needsSerialization
|
|
100
|
-
? JSON.stringify(value !== undefined ? value : {})
|
|
114
|
+
? JSON.stringify(value !== undefined ? value : {}, replaceWithSerializableTypeIfNeeded)
|
|
101
115
|
: (value || "");
|
|
102
116
|
};
|
|
103
117
|
export const toPathString = function (url) {
|