@kintone/dts-gen 6.1.22 → 6.1.24
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,39 +1,56 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
4
24
|
};
|
|
5
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
26
|
exports.VisibleForTesting = exports.AxiosUtils = void 0;
|
|
7
|
-
const axios_1 =
|
|
27
|
+
const axios_1 = __importStar(require("axios"));
|
|
8
28
|
const newAxiosInstance = (input) => {
|
|
9
29
|
let proxy;
|
|
10
30
|
// parse the proxy URL like http://admin:pass@localhost:8000
|
|
11
31
|
if (input.proxy) {
|
|
12
|
-
const
|
|
32
|
+
const { protocol, hostname, port, username, password } = new URL(input.proxy);
|
|
13
33
|
proxy = {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
username: proxyUrl.username,
|
|
18
|
-
password: proxyUrl.password,
|
|
19
|
-
},
|
|
34
|
+
protocol,
|
|
35
|
+
host: hostname,
|
|
36
|
+
port: parseInt(port, 10),
|
|
20
37
|
};
|
|
38
|
+
if (username.length > 0 && password.length > 0) {
|
|
39
|
+
proxy.auth = {
|
|
40
|
+
username,
|
|
41
|
+
password,
|
|
42
|
+
};
|
|
43
|
+
}
|
|
21
44
|
}
|
|
22
|
-
|
|
45
|
+
const headers = new axios_1.AxiosHeaders();
|
|
23
46
|
if (input.username && input.password) {
|
|
24
|
-
headers = {
|
|
25
|
-
"X-Cybozu-Authorization": Buffer.from(`${input.username}:${input.password}`).toString("base64"),
|
|
26
|
-
};
|
|
47
|
+
headers["X-Cybozu-Authorization"] = Buffer.from(`${input.username}:${input.password}`).toString("base64");
|
|
27
48
|
}
|
|
28
49
|
else if (input.apiToken) {
|
|
29
|
-
headers =
|
|
30
|
-
"X-Cybozu-API-Token": input.apiToken,
|
|
31
|
-
};
|
|
50
|
+
headers["X-Cybozu-API-Token"] = input.apiToken;
|
|
32
51
|
}
|
|
33
52
|
else if (input.oAuthToken) {
|
|
34
|
-
headers = {
|
|
35
|
-
Authorization: `Bearer ${input.oAuthToken}`,
|
|
36
|
-
};
|
|
53
|
+
headers.Authorization = `Bearer ${input.oAuthToken}`;
|
|
37
54
|
}
|
|
38
55
|
else {
|
|
39
56
|
throw new Error("cannot get an authentication input");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"axios-utils.js","sourceRoot":"","sources":["../../../src/kintone/clients/axios-utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"axios-utils.js","sourceRoot":"","sources":["../../../src/kintone/clients/axios-utils.ts"],"names":[],"mappings":";;;;;;;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aAAa;YACnB,QAAQ;gBACR,MAAM,CAAC,IAAI,CACT,GAAG,KAAK,CAAC,iBAAiB,IAAI,KAAK,CAAC,iBAAiB,EAAE,CACxD,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;KACxB;IACD,OAAO,yBAAiB,CAAC,wBAAwB,CAAC;QAChD,OAAO,EAAE,KAAK,CAAC,OAAO;QACtB,OAAO;QACP,KAAK;KACN,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,MAAM,wBAAwB,GAAG,CAAC,MAA0B,EAAE,EAAE;IAC9D,OAAO,eAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;AAC9B,CAAC,CAAC;AAEW,QAAA,UAAU,GAAG;IACxB,gBAAgB;CACjB,CAAC;AAEW,QAAA,iBAAiB,GAAG;IAC/B,wBAAwB;CACzB,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const axios_utils_1 = require("./axios-utils");
|
|
4
|
+
const axios_1 = require("axios");
|
|
4
5
|
describe("FormsClientImpl#constructor", () => {
|
|
5
6
|
const baseUrl = "https://kintone.com";
|
|
6
7
|
const authToken = Buffer.from("username:password").toString("base64");
|
|
@@ -18,9 +19,9 @@ describe("FormsClientImpl#constructor", () => {
|
|
|
18
19
|
basicAuthPassword: null,
|
|
19
20
|
basicAuthUsername: null,
|
|
20
21
|
};
|
|
21
|
-
const headers = {
|
|
22
|
+
const headers = new axios_1.AxiosHeaders({
|
|
22
23
|
"X-Cybozu-Authorization": authToken,
|
|
23
|
-
};
|
|
24
|
+
});
|
|
24
25
|
const expectedCalledWith = {
|
|
25
26
|
headers,
|
|
26
27
|
baseURL: baseUrl,
|
|
@@ -37,13 +38,14 @@ describe("FormsClientImpl#constructor", () => {
|
|
|
37
38
|
basicAuthPassword: null,
|
|
38
39
|
basicAuthUsername: null,
|
|
39
40
|
};
|
|
40
|
-
const headers = {
|
|
41
|
+
const headers = new axios_1.AxiosHeaders({
|
|
41
42
|
"X-Cybozu-Authorization": authToken,
|
|
42
|
-
};
|
|
43
|
+
});
|
|
43
44
|
const expectedCalledWith = {
|
|
44
45
|
headers,
|
|
45
46
|
baseURL: baseUrl,
|
|
46
47
|
proxy: {
|
|
48
|
+
protocol: "http:",
|
|
47
49
|
host: "localhost",
|
|
48
50
|
port: 1234,
|
|
49
51
|
auth: {
|
|
@@ -54,6 +56,29 @@ describe("FormsClientImpl#constructor", () => {
|
|
|
54
56
|
};
|
|
55
57
|
assertConstructorWithArgs(input, expectedCalledWith);
|
|
56
58
|
});
|
|
59
|
+
test("with proxy option and empty proxy authorization", () => {
|
|
60
|
+
const input = {
|
|
61
|
+
baseUrl,
|
|
62
|
+
username: "username",
|
|
63
|
+
password: "password",
|
|
64
|
+
proxy: "https://localhost:1234",
|
|
65
|
+
basicAuthPassword: null,
|
|
66
|
+
basicAuthUsername: null,
|
|
67
|
+
};
|
|
68
|
+
const headers = new axios_1.AxiosHeaders({
|
|
69
|
+
"X-Cybozu-Authorization": authToken,
|
|
70
|
+
});
|
|
71
|
+
const expectedCalledWith = {
|
|
72
|
+
headers,
|
|
73
|
+
baseURL: baseUrl,
|
|
74
|
+
proxy: {
|
|
75
|
+
protocol: "https:",
|
|
76
|
+
host: "localhost",
|
|
77
|
+
port: 1234,
|
|
78
|
+
},
|
|
79
|
+
};
|
|
80
|
+
assertConstructorWithArgs(input, expectedCalledWith);
|
|
81
|
+
});
|
|
57
82
|
test("with basic auth", () => {
|
|
58
83
|
const input = {
|
|
59
84
|
baseUrl,
|
|
@@ -63,10 +88,10 @@ describe("FormsClientImpl#constructor", () => {
|
|
|
63
88
|
basicAuthPassword: "basicUsername",
|
|
64
89
|
basicAuthUsername: "basicPassword",
|
|
65
90
|
};
|
|
66
|
-
const headers = {
|
|
91
|
+
const headers = new axios_1.AxiosHeaders({
|
|
67
92
|
"X-Cybozu-Authorization": authToken,
|
|
68
93
|
Authorization: "Basic YmFzaWNQYXNzd29yZDpiYXNpY1VzZXJuYW1l",
|
|
69
|
-
};
|
|
94
|
+
});
|
|
70
95
|
const expectedCalledWith = {
|
|
71
96
|
headers,
|
|
72
97
|
baseURL: baseUrl,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"axios-utils.test.js","sourceRoot":"","sources":["../../../src/kintone/clients/axios-utils.test.ts"],"names":[],"mappings":";;AAAA,+CAA8D;
|
|
1
|
+
{"version":3,"file":"axios-utils.test.js","sourceRoot":"","sources":["../../../src/kintone/clients/axios-utils.test.ts"],"names":[],"mappings":";;AAAA,+CAA8D;AAE9D,iCAAqC;AAErC,QAAQ,CAAC,6BAA6B,EAAE,GAAG,EAAE;IAC3C,MAAM,OAAO,GAAG,qBAAqB,CAAC;IACtC,MAAM,SAAS,GAAG,MAAM,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;IAEtE,MAAM,yBAAyB,GAAG,CAChC,KAAK,EACL,aAAiC,EACjC,EAAE;QACF,+BAAiB,CAAC,wBAAwB,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC;QACvD,wBAAU,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC;QACnC,MAAM,CAAC,+BAAiB,CAAC,wBAAwB,CAAC,CAAC,cAAc,CAC/D,aAAa,CACd,CAAC;IACJ,CAAC,CAAC;IAEF,IAAI,CAAC,qBAAqB,EAAE,GAAG,EAAE;QAC/B,MAAM,KAAK,GAAG;YACZ,OAAO;YACP,QAAQ,EAAE,UAAU;YACpB,QAAQ,EAAE,UAAU;YACpB,KAAK,EAAE,IAAI;YACX,iBAAiB,EAAE,IAAI;YACvB,iBAAiB,EAAE,IAAI;SACxB,CAAC;QAEF,MAAM,OAAO,GAAG,IAAI,oBAAY,CAAC;YAC/B,wBAAwB,EAAE,SAAS;SACpC,CAAC,CAAC;QACH,MAAM,kBAAkB,GAAG;YACzB,OAAO;YACP,OAAO,EAAE,OAAO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;QACF,yBAAyB,CAAC,KAAK,EAAE,kBAAkB,CAAC,CAAC;IACvD,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,iBAAiB,EAAE,GAAG,EAAE;QAC3B,MAAM,KAAK,GAAG;YACZ,OAAO;YACP,QAAQ,EAAE,UAAU;YACpB,QAAQ,EAAE,UAAU;YACpB,KAAK,EAAE,IAAI;YACX,iBAAiB,EAAE,eAAe;YAClC,iBAAiB,EAAE,eAAe;SACnC,CAAC;QAEF,MAAM,OAAO,GAAG,IAAI,oBAAY,CAAC;YAC/B,wBAAwB,EAAE,SAAS;YACnC,aAAa,EAAE,4CAA4C;SAC5D,CAAC,CAAC;QACH,MAAM,kBAAkB,GAAG;YACzB,OAAO;YACP,OAAO,EAAE,OAAO;YAChB,KAAK,EAAE,SAAS;SACK,CAAC;QACxB,yBAAyB,CAAC,KAAK,EAAE,kBAAkB,CAAC,CAAC;IACvD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kintone/dts-gen",
|
|
3
|
-
"version": "6.1.
|
|
3
|
+
"version": "6.1.24",
|
|
4
4
|
"description": "Types for kintone js api and Types generating tools",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -29,20 +29,20 @@
|
|
|
29
29
|
},
|
|
30
30
|
"license": "MIT",
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@cybozu/eslint-config": "^18.0.
|
|
33
|
-
"axios": "^
|
|
32
|
+
"@cybozu/eslint-config": "^18.0.2",
|
|
33
|
+
"axios": "^1.3.4",
|
|
34
34
|
"commander": "^10.0.0",
|
|
35
35
|
"eslint": "^8.36.0",
|
|
36
36
|
"form-data": "^4.0.0",
|
|
37
37
|
"lodash": "^4.17.21",
|
|
38
|
-
"prettier": "^2.8.
|
|
38
|
+
"prettier": "^2.8.7"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@types/eslint": "^8.21.
|
|
42
|
-
"@types/lodash": "^4.14.
|
|
41
|
+
"@types/eslint": "^8.21.3",
|
|
42
|
+
"@types/lodash": "^4.14.192",
|
|
43
43
|
"@types/prettier": "^2.7.2",
|
|
44
44
|
"ts-loader": "^9.4.2",
|
|
45
|
-
"webpack": "^5.76.
|
|
45
|
+
"webpack": "^5.76.3",
|
|
46
46
|
"webpack-cli": "^5.0.1"
|
|
47
47
|
},
|
|
48
48
|
"bin": {
|
|
@@ -64,5 +64,5 @@
|
|
|
64
64
|
"keywords": [
|
|
65
65
|
"kintone"
|
|
66
66
|
],
|
|
67
|
-
"gitHead": "
|
|
67
|
+
"gitHead": "f4336c09b22409a3e0f705f8fed9e297e50f033b"
|
|
68
68
|
}
|