@kintone/dts-gen 6.1.24 → 6.1.25
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,56 +1,39 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
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;
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
24
4
|
};
|
|
25
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
6
|
exports.VisibleForTesting = exports.AxiosUtils = void 0;
|
|
27
|
-
const axios_1 =
|
|
7
|
+
const axios_1 = __importDefault(require("axios"));
|
|
28
8
|
const newAxiosInstance = (input) => {
|
|
29
9
|
let proxy;
|
|
30
10
|
// parse the proxy URL like http://admin:pass@localhost:8000
|
|
31
11
|
if (input.proxy) {
|
|
32
|
-
const
|
|
12
|
+
const proxyUrl = new URL(input.proxy);
|
|
33
13
|
proxy = {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
14
|
+
host: proxyUrl.hostname,
|
|
15
|
+
port: parseInt(proxyUrl.port, 10),
|
|
16
|
+
auth: {
|
|
17
|
+
username: proxyUrl.username,
|
|
18
|
+
password: proxyUrl.password,
|
|
19
|
+
},
|
|
37
20
|
};
|
|
38
|
-
if (username.length > 0 && password.length > 0) {
|
|
39
|
-
proxy.auth = {
|
|
40
|
-
username,
|
|
41
|
-
password,
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
21
|
}
|
|
45
|
-
|
|
22
|
+
let headers;
|
|
46
23
|
if (input.username && input.password) {
|
|
47
|
-
headers
|
|
24
|
+
headers = {
|
|
25
|
+
"X-Cybozu-Authorization": Buffer.from(`${input.username}:${input.password}`).toString("base64"),
|
|
26
|
+
};
|
|
48
27
|
}
|
|
49
28
|
else if (input.apiToken) {
|
|
50
|
-
headers
|
|
29
|
+
headers = {
|
|
30
|
+
"X-Cybozu-API-Token": input.apiToken,
|
|
31
|
+
};
|
|
51
32
|
}
|
|
52
33
|
else if (input.oAuthToken) {
|
|
53
|
-
headers
|
|
34
|
+
headers = {
|
|
35
|
+
Authorization: `Bearer ${input.oAuthToken}`,
|
|
36
|
+
};
|
|
54
37
|
}
|
|
55
38
|
else {
|
|
56
39
|
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":";;;;;;AAMA,kDAA0B;AAa1B,MAAM,gBAAgB,GAAG,CAAC,KAAuB,EAAiB,EAAE;IAClE,IAAI,KAAmC,CAAC;IACxC,4DAA4D;IAC5D,IAAI,KAA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ACN,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,7 +1,6 @@
|
|
|
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");
|
|
5
4
|
describe("FormsClientImpl#constructor", () => {
|
|
6
5
|
const baseUrl = "https://kintone.com";
|
|
7
6
|
const authToken = Buffer.from("username:password").toString("base64");
|
|
@@ -19,9 +18,9 @@ describe("FormsClientImpl#constructor", () => {
|
|
|
19
18
|
basicAuthPassword: null,
|
|
20
19
|
basicAuthUsername: null,
|
|
21
20
|
};
|
|
22
|
-
const headers =
|
|
21
|
+
const headers = {
|
|
23
22
|
"X-Cybozu-Authorization": authToken,
|
|
24
|
-
}
|
|
23
|
+
};
|
|
25
24
|
const expectedCalledWith = {
|
|
26
25
|
headers,
|
|
27
26
|
baseURL: baseUrl,
|
|
@@ -38,14 +37,13 @@ describe("FormsClientImpl#constructor", () => {
|
|
|
38
37
|
basicAuthPassword: null,
|
|
39
38
|
basicAuthUsername: null,
|
|
40
39
|
};
|
|
41
|
-
const headers =
|
|
40
|
+
const headers = {
|
|
42
41
|
"X-Cybozu-Authorization": authToken,
|
|
43
|
-
}
|
|
42
|
+
};
|
|
44
43
|
const expectedCalledWith = {
|
|
45
44
|
headers,
|
|
46
45
|
baseURL: baseUrl,
|
|
47
46
|
proxy: {
|
|
48
|
-
protocol: "http:",
|
|
49
47
|
host: "localhost",
|
|
50
48
|
port: 1234,
|
|
51
49
|
auth: {
|
|
@@ -56,29 +54,6 @@ describe("FormsClientImpl#constructor", () => {
|
|
|
56
54
|
};
|
|
57
55
|
assertConstructorWithArgs(input, expectedCalledWith);
|
|
58
56
|
});
|
|
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
|
-
});
|
|
82
57
|
test("with basic auth", () => {
|
|
83
58
|
const input = {
|
|
84
59
|
baseUrl,
|
|
@@ -88,10 +63,10 @@ describe("FormsClientImpl#constructor", () => {
|
|
|
88
63
|
basicAuthPassword: "basicUsername",
|
|
89
64
|
basicAuthUsername: "basicPassword",
|
|
90
65
|
};
|
|
91
|
-
const headers =
|
|
66
|
+
const headers = {
|
|
92
67
|
"X-Cybozu-Authorization": authToken,
|
|
93
68
|
Authorization: "Basic YmFzaWNQYXNzd29yZDpiYXNpY1VzZXJuYW1l",
|
|
94
|
-
}
|
|
69
|
+
};
|
|
95
70
|
const expectedCalledWith = {
|
|
96
71
|
headers,
|
|
97
72
|
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","sour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,GAAG;YACd,wBAAwB,EAAE,SAAS;SACpC,CAAC;QACF,MAAM,kBAAkB,GAAG;YACzB,OAAO;YACP,OAAO,EAAE,OAAO;YAChB,KAAK,EAAE;gBACL,IAAI,EAAE,WAAW;gBACjB,IAAI,EAAE,IAAI;gBACV,IAAI,EAAE;oBACJ,QAAQ,EAAE,OAAO;oBACjB,QAAQ,EAAE,UAAU;iBACrB;aACF;SACF,CAAC;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;YACd,wBAAwB,EAAE,SAAS;YACnC,aAAa,EAAE,4CAA4C;SAC5D,CAAC;QACF,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.25",
|
|
4
4
|
"description": "Types for kintone js api and Types generating tools",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"license": "MIT",
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@cybozu/eslint-config": "^18.0.2",
|
|
33
|
-
"axios": "^
|
|
33
|
+
"axios": "^0.27.2",
|
|
34
34
|
"commander": "^10.0.0",
|
|
35
35
|
"eslint": "^8.36.0",
|
|
36
36
|
"form-data": "^4.0.0",
|
|
@@ -38,11 +38,11 @@
|
|
|
38
38
|
"prettier": "^2.8.7"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@types/eslint": "^8.
|
|
41
|
+
"@types/eslint": "^8.37.0",
|
|
42
42
|
"@types/lodash": "^4.14.192",
|
|
43
43
|
"@types/prettier": "^2.7.2",
|
|
44
44
|
"ts-loader": "^9.4.2",
|
|
45
|
-
"webpack": "^5.
|
|
45
|
+
"webpack": "^5.77.0",
|
|
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": "c87dd28180f77adb294c11c179209a15753c9411"
|
|
68
68
|
}
|