zoom-api-js 0.1.3 → 0.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/.turbo/turbo-build.log +12 -20
- package/CHANGELOG.md +6 -0
- package/dist/{index.js → index.cjs} +15 -55
- package/dist/index.d.cts +27313 -0
- package/dist/index.d.mts +435 -129
- package/dist/index.d.ts +435 -129
- package/dist/index.mjs +14 -30
- package/package.json +6 -10
- package/dist/index.js.map +0 -1
- package/dist/index.mjs.map +0 -1
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,22 +1,14 @@
|
|
|
1
1
|
|
|
2
|
-
> zoom-api-js@0.
|
|
3
|
-
>
|
|
2
|
+
> zoom-api-js@0.2.0 build /home/runner/work/openapi-clients/openapi-clients/packages/zoom-api-js
|
|
3
|
+
> unbuild
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
[32mCJS[39m ⚡️ Build success in 68ms
|
|
16
|
-
[32mESM[39m [1mdist/index.mjs [22m[32m4.07 KB[39m
|
|
17
|
-
[32mESM[39m [1mdist/index.mjs.map [22m[32m8.33 KB[39m
|
|
18
|
-
[32mESM[39m ⚡️ Build success in 68ms
|
|
19
|
-
[34mDTS[39m Build start
|
|
20
|
-
[32mDTS[39m ⚡️ Build success in 10070ms
|
|
21
|
-
[32mDTS[39m [1mdist/index.d.ts [22m[32m1.05 MB[39m
|
|
22
|
-
[32mDTS[39m [1mdist/index.d.mts [22m[32m1.05 MB[39m
|
|
5
|
+
[info] Automatically detected entries: src/index [esm] [cjs] [dts]
|
|
6
|
+
[info] Building zoom-api-js
|
|
7
|
+
[info] Cleaning dist directory: `./dist`
|
|
8
|
+
[success] Build succeeded for zoom-api-js
|
|
9
|
+
[log] dist/index.cjs (total size: 3.21 kB, chunk size: 3.21 kB, exports: ZoomApi)
|
|
10
|
+
|
|
11
|
+
[log] dist/index.mjs (total size: 3.19 kB, chunk size: 3.19 kB, exports: ZoomApi)
|
|
12
|
+
|
|
13
|
+
Σ Total dist size (byte size): 3.35 MB
|
|
14
|
+
[log]
|
package/CHANGELOG.md
CHANGED
|
@@ -1,37 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __typeError = (msg) => {
|
|
7
|
-
throw TypeError(msg);
|
|
8
|
-
};
|
|
9
|
-
var __export = (target, all) => {
|
|
10
|
-
for (var name in all)
|
|
11
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
12
|
-
};
|
|
13
|
-
var __copyProps = (to, from, except, desc) => {
|
|
14
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
-
for (let key of __getOwnPropNames(from))
|
|
16
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
17
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
18
|
-
}
|
|
19
|
-
return to;
|
|
20
|
-
};
|
|
21
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
22
|
-
var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
|
|
23
|
-
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
24
|
-
var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
25
|
-
var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
|
|
1
|
+
'use strict';
|
|
26
2
|
|
|
27
|
-
// src/index.ts
|
|
28
|
-
var src_exports = {};
|
|
29
|
-
__export(src_exports, {
|
|
30
|
-
ZoomApi: () => ZoomApi
|
|
31
|
-
});
|
|
32
|
-
module.exports = __toCommonJS(src_exports);
|
|
33
|
-
|
|
34
|
-
// src/utils/lang.ts
|
|
35
3
|
function notEmpty(value) {
|
|
36
4
|
return value !== null && value !== void 0;
|
|
37
5
|
}
|
|
@@ -39,9 +7,8 @@ function compactObject(obj) {
|
|
|
39
7
|
return Object.fromEntries(Object.entries(obj).filter(([, value]) => notEmpty(value)));
|
|
40
8
|
}
|
|
41
9
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
async function fetch2({
|
|
10
|
+
const baseUrl = "https://api.zoom.us/v2";
|
|
11
|
+
async function fetch$1({
|
|
45
12
|
url,
|
|
46
13
|
method,
|
|
47
14
|
body,
|
|
@@ -94,21 +61,19 @@ async function fetch2({
|
|
|
94
61
|
throw errorObject;
|
|
95
62
|
}
|
|
96
63
|
}
|
|
97
|
-
|
|
64
|
+
const resolveUrl = (url, queryParams = {}, pathParams = {}) => {
|
|
98
65
|
let query = new URLSearchParams(queryParams).toString();
|
|
99
66
|
if (query) query = `?${query}`;
|
|
100
67
|
return url.replace(/\{\w*\}/g, (key) => pathParams[key.slice(1, -1)] ?? "") + query;
|
|
101
68
|
};
|
|
102
69
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
70
|
+
class ZoomApi {
|
|
71
|
+
#token;
|
|
72
|
+
#fetch;
|
|
106
73
|
constructor(options) {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
__privateSet(this, _fetch, options.fetch || fetch);
|
|
111
|
-
if (!__privateGet(this, _fetch)) throw new Error("Fetch is required");
|
|
74
|
+
this.#token = options.token;
|
|
75
|
+
this.#fetch = options.fetch || fetch;
|
|
76
|
+
if (!this.#fetch) throw new Error("Fetch is required");
|
|
112
77
|
}
|
|
113
78
|
get auth() {
|
|
114
79
|
return {
|
|
@@ -117,7 +82,7 @@ var ZoomApi = class {
|
|
|
117
82
|
clientId,
|
|
118
83
|
clientSecret
|
|
119
84
|
}) => {
|
|
120
|
-
const response = await
|
|
85
|
+
const response = await this.#fetch("https://zoom.us/oauth/token", {
|
|
121
86
|
method: "POST",
|
|
122
87
|
body: new URLSearchParams({
|
|
123
88
|
grant_type: "refresh_token",
|
|
@@ -141,14 +106,9 @@ var ZoomApi = class {
|
|
|
141
106
|
async request(endpoint, params) {
|
|
142
107
|
const [method = "", url = ""] = endpoint.split(" ");
|
|
143
108
|
const extraParams = params || {};
|
|
144
|
-
const result = await
|
|
109
|
+
const result = await fetch$1({ ...extraParams, method, url, token: this.#token, fetchImpl: this.#fetch });
|
|
145
110
|
return result;
|
|
146
111
|
}
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
151
|
-
0 && (module.exports = {
|
|
152
|
-
ZoomApi
|
|
153
|
-
});
|
|
154
|
-
//# sourceMappingURL=index.js.map
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
exports.ZoomApi = ZoomApi;
|