latchkey 3.2.2 → 3.4.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/README.md +2 -1
- package/dist/skills/generic/latchkey/SKILL.md +1 -1
- package/dist/skills/openclaw/latchkey/SKILL.md +1 -1
- package/dist/src/apiCredentials/serialization.d.ts +21 -0
- package/dist/src/apiCredentials/serialization.d.ts.map +1 -1
- package/dist/src/apiCredentials/serialization.js +7 -0
- package/dist/src/apiCredentials/serialization.js.map +1 -1
- package/dist/src/cliCommands.d.ts.map +1 -1
- package/dist/src/cliCommands.js +91 -7
- package/dist/src/cliCommands.js.map +1 -1
- package/dist/src/configDataStore.d.ts +18 -0
- package/dist/src/configDataStore.d.ts.map +1 -1
- package/dist/src/configDataStore.js +10 -0
- package/dist/src/configDataStore.js.map +1 -1
- package/dist/src/serviceRegistry.d.ts.map +1 -1
- package/dist/src/serviceRegistry.js +27 -3
- package/dist/src/serviceRegistry.js.map +1 -1
- package/dist/src/services/aws.d.ts.map +1 -1
- package/dist/src/services/aws.js +1 -2
- package/dist/src/services/aws.js.map +1 -1
- package/dist/src/services/core/base.d.ts +25 -3
- package/dist/src/services/core/base.d.ts.map +1 -1
- package/dist/src/services/core/base.js +32 -10
- package/dist/src/services/core/base.js.map +1 -1
- package/dist/src/services/core/loginFlows/base.d.ts +75 -0
- package/dist/src/services/core/loginFlows/base.d.ts.map +1 -0
- package/dist/src/services/core/loginFlows/base.js +47 -0
- package/dist/src/services/core/loginFlows/base.js.map +1 -0
- package/dist/src/services/core/loginFlows/cookieCapture.d.ts +55 -0
- package/dist/src/services/core/loginFlows/cookieCapture.d.ts.map +1 -0
- package/dist/src/services/core/loginFlows/cookieCapture.js +244 -0
- package/dist/src/services/core/loginFlows/cookieCapture.js.map +1 -0
- package/dist/src/services/core/loginFlows/registry.d.ts +30 -0
- package/dist/src/services/core/loginFlows/registry.d.ts.map +1 -0
- package/dist/src/services/core/loginFlows/registry.js +56 -0
- package/dist/src/services/core/loginFlows/registry.js.map +1 -0
- package/dist/src/services/core/registered.d.ts +38 -2
- package/dist/src/services/core/registered.d.ts.map +1 -1
- package/dist/src/services/core/registered.js +37 -2
- package/dist/src/services/core/registered.js.map +1 -1
- package/dist/src/services/index.d.ts +4 -0
- package/dist/src/services/index.d.ts.map +1 -1
- package/dist/src/services/index.js +4 -0
- package/dist/src/services/index.js.map +1 -1
- package/dist/src/services/ngrok.d.ts +38 -0
- package/dist/src/services/ngrok.d.ts.map +1 -0
- package/dist/src/services/ngrok.js +129 -0
- package/dist/src/services/ngrok.js.map +1 -0
- package/dist/src/services/zoom.d.ts +118 -5
- package/dist/src/services/zoom.d.ts.map +1 -1
- package/dist/src/services/zoom.js +692 -7
- package/dist/src/services/zoom.js.map +1 -1
- package/dist/src/version.d.ts +1 -1
- package/dist/src/version.js +1 -1
- package/dist/tests/apiCredentials.test.js +5 -0
- package/dist/tests/apiCredentials.test.js.map +1 -1
- package/dist/tests/cli.test.js +178 -2
- package/dist/tests/cli.test.js.map +1 -1
- package/dist/tests/cookieCapture.test.d.ts +10 -0
- package/dist/tests/cookieCapture.test.d.ts.map +1 -0
- package/dist/tests/cookieCapture.test.js +221 -0
- package/dist/tests/cookieCapture.test.js.map +1 -0
- package/dist/tests/serviceRegistry.test.js +29 -8
- package/dist/tests/serviceRegistry.test.js.map +1 -1
- package/dist/tests/servicesAgainstRecordings.test.js +13 -11
- package/dist/tests/servicesAgainstRecordings.test.js.map +1 -1
- package/dist/tests/zoom.test.d.ts +2 -0
- package/dist/tests/zoom.test.d.ts.map +1 -0
- package/dist/tests/zoom.test.js +110 -0
- package/dist/tests/zoom.test.js.map +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ngrok service implementation.
|
|
3
|
+
*
|
|
4
|
+
* ngrok issues personal API keys from its dashboard, and the key value is
|
|
5
|
+
* revealed exactly once at creation time (like Linear). We sign the user into
|
|
6
|
+
* the dashboard, create a fresh API key on their behalf, and read its value
|
|
7
|
+
* from the one-time reveal dialog.
|
|
8
|
+
*
|
|
9
|
+
* Every ngrok API request must carry two headers: the bearer API key and a
|
|
10
|
+
* constant `ngrok-version` header (https://ngrok.com/docs/api/#authentication).
|
|
11
|
+
* We therefore store the credential as raw curl arguments that inject both, so
|
|
12
|
+
* a plain `latchkey curl` to the ngrok API works without the caller having to
|
|
13
|
+
* remember the version header.
|
|
14
|
+
*/
|
|
15
|
+
import { RawCurlCredentials } from '../apiCredentials/base.js';
|
|
16
|
+
import { typeLikeHuman } from '../playwrightUtils.js';
|
|
17
|
+
import { Service, BrowserFollowupServiceSession, FollowupWork, LoginFailedError, } from './core/base.js';
|
|
18
|
+
const DEFAULT_TIMEOUT_MS = 8000;
|
|
19
|
+
// The ngrok REST API. Every request must also send the `ngrok-version` header.
|
|
20
|
+
const NGROK_API_BASE_URL = 'https://api.ngrok.com/';
|
|
21
|
+
const NGROK_API_VERSION = '2';
|
|
22
|
+
const NGROK_LOGIN_URL = 'https://dashboard.ngrok.com/login';
|
|
23
|
+
// Navigating here opens the "New API Key" dialog directly; the secret is shown
|
|
24
|
+
// once in that dialog after creation.
|
|
25
|
+
const NGROK_NEW_API_KEY_URL = 'https://dashboard.ngrok.com/api-keys/new';
|
|
26
|
+
// Dashboard host, and the first path segments served before the user is signed
|
|
27
|
+
// in. A dashboard document response on any *other* path only happens once login
|
|
28
|
+
// has succeeded, so we use it as the login-complete signal.
|
|
29
|
+
const NGROK_DASHBOARD_HOST = 'dashboard.ngrok.com';
|
|
30
|
+
const NGROK_PRE_LOGIN_PATH_PATTERN = /^\/(login|signup|signin|auth|sso|oauth|verify|mfa)/i;
|
|
31
|
+
/**
|
|
32
|
+
* Build the stored credential: a bearer API key plus the mandatory
|
|
33
|
+
* `ngrok-version` header, expressed as raw curl arguments so both are injected
|
|
34
|
+
* into every request.
|
|
35
|
+
*/
|
|
36
|
+
function ngrokCredentials(apiKey) {
|
|
37
|
+
return new RawCurlCredentials([
|
|
38
|
+
'-H',
|
|
39
|
+
`Authorization: Bearer ${apiKey}`,
|
|
40
|
+
'-H',
|
|
41
|
+
`ngrok-version: ${NGROK_API_VERSION}`,
|
|
42
|
+
]);
|
|
43
|
+
}
|
|
44
|
+
class NgrokServiceSession extends BrowserFollowupServiceSession {
|
|
45
|
+
followupWork = FollowupWork.CreateApiToken;
|
|
46
|
+
isLoggedIn = false;
|
|
47
|
+
onResponse(response) {
|
|
48
|
+
if (this.isLoggedIn) {
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
// The dashboard is a client-side app; after a successful sign-in the browser
|
|
52
|
+
// lands on a dashboard document that is not one of the auth pages (works the
|
|
53
|
+
// same whether the user signs in with a password or an SSO provider, since
|
|
54
|
+
// the final redirect target is always a dashboard page).
|
|
55
|
+
if (response.request().resourceType() !== 'document') {
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
let url;
|
|
59
|
+
try {
|
|
60
|
+
url = new URL(response.url());
|
|
61
|
+
}
|
|
62
|
+
catch {
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
if (url.hostname !== NGROK_DASHBOARD_HOST) {
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
if (NGROK_PRE_LOGIN_PATH_PATTERN.test(url.pathname)) {
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
if (response.status() >= 200 && response.status() < 400) {
|
|
72
|
+
this.isLoggedIn = true;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
isLoginComplete() {
|
|
76
|
+
return this.isLoggedIn;
|
|
77
|
+
}
|
|
78
|
+
async performBrowserFollowup(context, _oldCredentials) {
|
|
79
|
+
const page = context.pages()[0];
|
|
80
|
+
if (!page) {
|
|
81
|
+
throw new LoginFailedError('No page available in browser context.');
|
|
82
|
+
}
|
|
83
|
+
await page.goto(NGROK_NEW_API_KEY_URL);
|
|
84
|
+
// The description field comes prefilled; replace it with our own label so
|
|
85
|
+
// the user can recognize and revoke the key later.
|
|
86
|
+
const description = this.generateAppName();
|
|
87
|
+
const descriptionInput = page.locator('input[name="description"]');
|
|
88
|
+
await descriptionInput.waitFor({ timeout: DEFAULT_TIMEOUT_MS });
|
|
89
|
+
await descriptionInput.fill('');
|
|
90
|
+
await typeLikeHuman(page, descriptionInput, description);
|
|
91
|
+
const createButton = page.locator('button[type="submit"]');
|
|
92
|
+
await createButton.waitFor({ timeout: DEFAULT_TIMEOUT_MS });
|
|
93
|
+
await createButton.click();
|
|
94
|
+
// The created key is revealed exactly once, inside the success dialog's
|
|
95
|
+
// <pre> element. ngrok keys have no fixed prefix, so we read that element
|
|
96
|
+
// directly rather than matching on the token text.
|
|
97
|
+
const tokenElement = page.locator('[role="dialog"] pre');
|
|
98
|
+
await tokenElement.waitFor({ timeout: DEFAULT_TIMEOUT_MS });
|
|
99
|
+
const token = (await tokenElement.textContent())?.trim();
|
|
100
|
+
if (token === undefined || token === '') {
|
|
101
|
+
throw new LoginFailedError('Failed to extract API key from ngrok.');
|
|
102
|
+
}
|
|
103
|
+
await page.close();
|
|
104
|
+
return ngrokCredentials(token);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
export class Ngrok extends Service {
|
|
108
|
+
name = 'ngrok';
|
|
109
|
+
displayName = 'ngrok';
|
|
110
|
+
baseApiUrls = [NGROK_API_BASE_URL];
|
|
111
|
+
loginUrl = NGROK_LOGIN_URL;
|
|
112
|
+
info = 'https://ngrok.com/docs/api/';
|
|
113
|
+
// Listing API keys returns 200 for any valid key; the stored credential adds
|
|
114
|
+
// the required Authorization and ngrok-version headers.
|
|
115
|
+
credentialCheckCurlArguments = ['https://api.ngrok.com/api_keys'];
|
|
116
|
+
setCredentialsExample(serviceName) {
|
|
117
|
+
return `latchkey auth set ${serviceName} -H "Authorization: Bearer <token>" -H "ngrok-version: ${NGROK_API_VERSION}"`;
|
|
118
|
+
}
|
|
119
|
+
// An ngrok API key carries no queryable identity endpoint, so the account is
|
|
120
|
+
// left as the default rather than guessed.
|
|
121
|
+
getAccount(_apiCredentials) {
|
|
122
|
+
return Promise.resolve(null);
|
|
123
|
+
}
|
|
124
|
+
getSession(appNamePrefix) {
|
|
125
|
+
return new NgrokServiceSession(this, appNamePrefix);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
export const NGROK = new Ngrok();
|
|
129
|
+
//# sourceMappingURL=ngrok.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ngrok.js","sourceRoot":"","sources":["../../../src/services/ngrok.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,EAAkB,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/E,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EACL,OAAO,EACP,6BAA6B,EAC7B,YAAY,EACZ,gBAAgB,GACjB,MAAM,gBAAgB,CAAC;AAExB,MAAM,kBAAkB,GAAG,IAAI,CAAC;AAEhC,+EAA+E;AAC/E,MAAM,kBAAkB,GAAG,wBAAwB,CAAC;AACpD,MAAM,iBAAiB,GAAG,GAAG,CAAC;AAE9B,MAAM,eAAe,GAAG,mCAAmC,CAAC;AAE5D,+EAA+E;AAC/E,sCAAsC;AACtC,MAAM,qBAAqB,GAAG,0CAA0C,CAAC;AAEzE,+EAA+E;AAC/E,gFAAgF;AAChF,4DAA4D;AAC5D,MAAM,oBAAoB,GAAG,qBAAqB,CAAC;AACnD,MAAM,4BAA4B,GAAG,qDAAqD,CAAC;AAE3F;;;;GAIG;AACH,SAAS,gBAAgB,CAAC,MAAc;IACtC,OAAO,IAAI,kBAAkB,CAAC;QAC5B,IAAI;QACJ,yBAAyB,MAAM,EAAE;QACjC,IAAI;QACJ,kBAAkB,iBAAiB,EAAE;KACtC,CAAC,CAAC;AACL,CAAC;AAED,MAAM,mBAAoB,SAAQ,6BAA6B;IAC1C,YAAY,GAAG,YAAY,CAAC,cAAc,CAAC;IACtD,UAA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,CAAC,gCAAgC,CAAU,CAAC;IAEpF,qBAAqB,CAAC,WAAmB;QACvC,OAAO,qBAAqB,WAAW,0DAA0D,iBAAiB,GAAG,CAAC;IACxH,CAAC;IAED,6EAA6E;IAC7E,2CAA2C;IAClC,UAAU,CAAC,eAA+B;QACjD,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/B,CAAC;IAEQ,UAAU,CAAC,aAAqB;QACvC,OAAO,IAAI,mBAAmB,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC;IACtD,CAAC;CACF;AAED,MAAM,CAAC,MAAM,KAAK,GAAG,IAAI,KAAK,EAAE,CAAC"}
|
|
@@ -1,20 +1,133 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Zoom service implementation.
|
|
3
|
+
*
|
|
4
|
+
* Browser login creates a Server-to-Server OAuth app in the Zoom App
|
|
5
|
+
* Marketplace. Such an app has no user context: its credentials are an account
|
|
6
|
+
* id plus a client id/secret, which are exchanged for a short-lived access
|
|
7
|
+
* token with the `account_credentials` grant whenever the previous token
|
|
8
|
+
* expires.
|
|
9
|
+
*/
|
|
10
|
+
import type { BrowserContext, Response } from 'playwright';
|
|
11
|
+
import { z } from 'zod';
|
|
12
|
+
import { ApiCredentials } from '../apiCredentials/base.js';
|
|
13
|
+
import { BrowserFollowupServiceSession, FollowupWork, LoginFailedError, Service } from './core/base.js';
|
|
14
|
+
/**
|
|
15
|
+
* Whether a URL names the home page Zoom sends a user to once they are signed
|
|
16
|
+
* in. Also accepts the bare path, the form a redirect to it may take.
|
|
17
|
+
*/
|
|
18
|
+
export declare function isZoomSignedInHomeUrl(url: string): boolean;
|
|
19
|
+
export declare class ZoomCredentialError extends Error {
|
|
20
|
+
constructor(message: string);
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Raised when the signed-in user is not allowed to create apps in their Zoom
|
|
24
|
+
* account. Extends {@link LoginFailedError} so the CLI reports the message on
|
|
25
|
+
* stderr instead of a stack trace.
|
|
26
|
+
*/
|
|
27
|
+
export declare class ZoomAppCreationNotPermittedError extends LoginFailedError {
|
|
28
|
+
constructor();
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Credentials of a Zoom Server-to-Server OAuth app: the long-lived triple that
|
|
32
|
+
* identifies the app, plus the short-lived access token minted from it.
|
|
33
|
+
*/
|
|
34
|
+
export declare const ZoomServerToServerCredentialsSchema: z.ZodObject<{
|
|
35
|
+
objectType: z.ZodLiteral<"zoomServerToServer">;
|
|
36
|
+
accountId: z.ZodString;
|
|
37
|
+
clientId: z.ZodString;
|
|
38
|
+
clientSecret: z.ZodString;
|
|
39
|
+
accessToken: z.ZodOptional<z.ZodString>;
|
|
40
|
+
accessTokenExpiresAt: z.ZodOptional<z.ZodString>;
|
|
41
|
+
}, "strip", z.ZodTypeAny, {
|
|
42
|
+
objectType: "zoomServerToServer";
|
|
43
|
+
clientId: string;
|
|
44
|
+
clientSecret: string;
|
|
45
|
+
accountId: string;
|
|
46
|
+
accessToken?: string | undefined;
|
|
47
|
+
accessTokenExpiresAt?: string | undefined;
|
|
48
|
+
}, {
|
|
49
|
+
objectType: "zoomServerToServer";
|
|
50
|
+
clientId: string;
|
|
51
|
+
clientSecret: string;
|
|
52
|
+
accountId: string;
|
|
53
|
+
accessToken?: string | undefined;
|
|
54
|
+
accessTokenExpiresAt?: string | undefined;
|
|
55
|
+
}>;
|
|
56
|
+
export type ZoomServerToServerCredentialsData = z.infer<typeof ZoomServerToServerCredentialsSchema>;
|
|
57
|
+
export declare class ZoomServerToServerCredentials implements ApiCredentials {
|
|
58
|
+
readonly objectType: "zoomServerToServer";
|
|
59
|
+
readonly accountId: string;
|
|
60
|
+
readonly clientId: string;
|
|
61
|
+
readonly clientSecret: string;
|
|
62
|
+
readonly accessToken?: string;
|
|
63
|
+
readonly accessTokenExpiresAt?: string;
|
|
64
|
+
readonly accountEmail?: string;
|
|
65
|
+
constructor(accountId: string, clientId: string, clientSecret: string, accessToken?: string, accessTokenExpiresAt?: string, accountEmail?: string);
|
|
66
|
+
withAccessToken(accessToken: string, accessTokenExpiresAt: string): ZoomServerToServerCredentials;
|
|
67
|
+
injectIntoCurlCall(curlArguments: readonly string[]): Promise<readonly string[]>;
|
|
68
|
+
/**
|
|
69
|
+
* Missing tokens count as expired: the client id and secret are enough to
|
|
70
|
+
* mint a new one, so refreshing is always the right response.
|
|
71
|
+
*/
|
|
72
|
+
isExpired(): boolean;
|
|
73
|
+
toJSON(): ZoomServerToServerCredentialsData;
|
|
74
|
+
static fromJSON(data: ZoomServerToServerCredentialsData): ZoomServerToServerCredentials;
|
|
75
|
+
}
|
|
76
|
+
declare class ZoomServiceSession extends BrowserFollowupServiceSession {
|
|
77
|
+
protected readonly followupWork = FollowupWork.CreateApp;
|
|
78
|
+
private isSignedIn;
|
|
79
|
+
/**
|
|
80
|
+
* Sign-in is over once Zoom sends the user to their home page, which it does
|
|
81
|
+
* after the last step of the sign-in (whatever two-factor or consent steps
|
|
82
|
+
* came before). Being sent there is enough — waiting for the home page to
|
|
83
|
+
* answer, let alone to render, would only cost a round trip, since the flow
|
|
84
|
+
* navigates away from it to the Marketplace anyway.
|
|
85
|
+
*/
|
|
86
|
+
onResponse(response: Response): void;
|
|
87
|
+
protected isLoginComplete(): boolean;
|
|
88
|
+
/**
|
|
89
|
+
* Accounts that have not accepted Zoom's API License and Terms of Use yet see
|
|
90
|
+
* a dialog blocking the app creation. Accepting the terms is the user's
|
|
91
|
+
* decision, so the page is surfaced and the flow waits until the dialog is
|
|
92
|
+
* gone rather than clicking "Agree" on the user's behalf.
|
|
93
|
+
*/
|
|
94
|
+
private waitForApiTermsOfUseDecision;
|
|
95
|
+
/**
|
|
96
|
+
* Open the dialog that asks what kind of app to create, letting the user
|
|
97
|
+
* accept the API terms of use on the way if the account has not signed them
|
|
98
|
+
* yet.
|
|
99
|
+
*/
|
|
100
|
+
private openAppKindDialog;
|
|
101
|
+
protected performBrowserFollowup(context: BrowserContext, _oldCredentials?: ApiCredentials): Promise<ApiCredentials | null>;
|
|
102
|
+
}
|
|
3
103
|
export declare class Zoom extends Service {
|
|
4
104
|
readonly name = "zoom";
|
|
5
105
|
readonly displayName = "Zoom";
|
|
6
106
|
readonly baseApiUrls: readonly ["https://api.zoom.us/v2/"];
|
|
7
|
-
readonly loginUrl = "https://zoom.us/signin";
|
|
8
|
-
readonly info
|
|
107
|
+
readonly loginUrl = "https://zoom.us/signin#/login";
|
|
108
|
+
readonly info: string;
|
|
9
109
|
readonly credentialCheckCurlArguments: readonly ["-H", "Content-Type: application/json", "https://api.zoom.us/v2/users?page_size=1"];
|
|
10
110
|
setCredentialsExample(serviceName: string): string;
|
|
111
|
+
/**
|
|
112
|
+
* Accept the credentials of a Server-to-Server OAuth app the user created
|
|
113
|
+
* themselves, in the order the Zoom App Marketplace shows them.
|
|
114
|
+
*/
|
|
115
|
+
getCredentialsNoCurl(arguments_: readonly string[]): ApiCredentials;
|
|
116
|
+
getSession(appNamePrefix: string): ZoomServiceSession;
|
|
11
117
|
/**
|
|
12
118
|
* The account comes from /users/me rather than the user-list endpoint used
|
|
13
119
|
* by the credential check, which carries no identity. Server-to-server
|
|
14
120
|
* tokens have no user context and error on /users/me, in which case the
|
|
15
|
-
* account
|
|
121
|
+
* account is named after the user the app was created by, and failing that
|
|
122
|
+
* by the app's (opaque) Zoom account id.
|
|
16
123
|
*/
|
|
17
124
|
getAccount(apiCredentials: ApiCredentials): Promise<string | null>;
|
|
125
|
+
/**
|
|
126
|
+
* Server-to-server credentials carry no refresh token: a fresh access token
|
|
127
|
+
* is minted from the client id and secret whenever the old one expires.
|
|
128
|
+
*/
|
|
129
|
+
refreshCredentials(apiCredentials: ApiCredentials): Promise<ApiCredentials | null>;
|
|
18
130
|
}
|
|
19
131
|
export declare const ZOOM: Zoom;
|
|
132
|
+
export {};
|
|
20
133
|
//# sourceMappingURL=zoom.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zoom.d.ts","sourceRoot":"","sources":["../../../src/services/zoom.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"zoom.d.ts","sourceRoot":"","sources":["../../../src/services/zoom.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAiB,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC1E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,cAAc,EAA4B,MAAM,2BAA2B,CAAC;AAIrF,OAAO,EACL,6BAA6B,EAC7B,YAAY,EAGZ,gBAAgB,EAChB,OAAO,EACR,MAAM,gBAAgB,CAAC;AAcxB;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAE1D;AAWD,qBAAa,mBAAoB,SAAQ,KAAK;gBAChC,OAAO,EAAE,MAAM;CAI5B;AAED;;;;GAIG;AACH,qBAAa,gCAAiC,SAAQ,gBAAgB;;CAQrE;AAED;;;GAGG;AACH,eAAO,MAAM,mCAAmC;;;;;;;;;;;;;;;;;;;;;EAO9C,CAAC;AAEH,MAAM,MAAM,iCAAiC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mCAAmC,CAAC,CAAC;AAEpG,qBAAa,6BAA8B,YAAW,cAAc;IAClE,QAAQ,CAAC,UAAU,EAAG,oBAAoB,CAAU;IACpD,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,oBAAoB,CAAC,EAAE,MAAM,CAAC;IACvC,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;gBAG7B,SAAS,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