latchkey 3.14.0 → 3.16.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.
Files changed (156) hide show
  1. package/README.md +10 -0
  2. package/dist/src/apiCredentials/base.d.ts +53 -5
  3. package/dist/src/apiCredentials/base.d.ts.map +1 -1
  4. package/dist/src/apiCredentials/base.js +43 -9
  5. package/dist/src/apiCredentials/base.js.map +1 -1
  6. package/dist/src/apiCredentials/serialization.d.ts +11 -139
  7. package/dist/src/apiCredentials/serialization.d.ts.map +1 -1
  8. package/dist/src/apiCredentials/serialization.js +53 -81
  9. package/dist/src/apiCredentials/serialization.js.map +1 -1
  10. package/dist/src/apiCredentials/store.d.ts +7 -2
  11. package/dist/src/apiCredentials/store.d.ts.map +1 -1
  12. package/dist/src/apiCredentials/store.js +18 -8
  13. package/dist/src/apiCredentials/store.js.map +1 -1
  14. package/dist/src/browserStateImport.d.ts +50 -0
  15. package/dist/src/browserStateImport.d.ts.map +1 -0
  16. package/dist/src/browserStateImport.js +260 -0
  17. package/dist/src/browserStateImport.js.map +1 -0
  18. package/dist/src/cli.js +13 -2
  19. package/dist/src/cli.js.map +1 -1
  20. package/dist/src/cliCommands.d.ts +15 -7
  21. package/dist/src/cliCommands.d.ts.map +1 -1
  22. package/dist/src/cliCommands.js +64 -16
  23. package/dist/src/cliCommands.js.map +1 -1
  24. package/dist/src/config.d.ts +10 -0
  25. package/dist/src/config.d.ts.map +1 -1
  26. package/dist/src/config.js +15 -0
  27. package/dist/src/config.js.map +1 -1
  28. package/dist/src/configDataStore.d.ts +3 -0
  29. package/dist/src/configDataStore.d.ts.map +1 -1
  30. package/dist/src/configDataStore.js +1 -0
  31. package/dist/src/configDataStore.js.map +1 -1
  32. package/dist/src/curlInjection.d.ts +2 -0
  33. package/dist/src/curlInjection.d.ts.map +1 -1
  34. package/dist/src/curlInjection.js +12 -6
  35. package/dist/src/curlInjection.js.map +1 -1
  36. package/dist/src/diagnosticHeaders.d.ts +19 -0
  37. package/dist/src/diagnosticHeaders.d.ts.map +1 -0
  38. package/dist/src/diagnosticHeaders.js +20 -0
  39. package/dist/src/diagnosticHeaders.js.map +1 -0
  40. package/dist/src/gateway/gatewayEndpoint.d.ts.map +1 -1
  41. package/dist/src/gateway/gatewayEndpoint.js +1 -0
  42. package/dist/src/gateway/gatewayEndpoint.js.map +1 -1
  43. package/dist/src/gateway/server.js +1 -1
  44. package/dist/src/gateway/server.js.map +1 -1
  45. package/dist/src/index.d.ts +3 -3
  46. package/dist/src/index.d.ts.map +1 -1
  47. package/dist/src/index.js +2 -2
  48. package/dist/src/index.js.map +1 -1
  49. package/dist/src/migrations.d.ts.map +1 -1
  50. package/dist/src/migrations.js +8 -8
  51. package/dist/src/migrations.js.map +1 -1
  52. package/dist/src/oauthUtils.d.ts +17 -0
  53. package/dist/src/oauthUtils.d.ts.map +1 -1
  54. package/dist/src/oauthUtils.js +22 -1
  55. package/dist/src/oauthUtils.js.map +1 -1
  56. package/dist/src/pluginSdk.d.ts +118 -0
  57. package/dist/src/pluginSdk.d.ts.map +1 -0
  58. package/dist/src/pluginSdk.js +98 -0
  59. package/dist/src/pluginSdk.js.map +1 -0
  60. package/dist/src/plugins.d.ts +74 -0
  61. package/dist/src/plugins.d.ts.map +1 -0
  62. package/dist/src/plugins.js +221 -0
  63. package/dist/src/plugins.js.map +1 -0
  64. package/dist/src/serviceRegistry.d.ts +2 -2
  65. package/dist/src/serviceRegistry.d.ts.map +1 -1
  66. package/dist/src/serviceRegistry.js +3 -3
  67. package/dist/src/serviceRegistry.js.map +1 -1
  68. package/dist/src/services/aws.d.ts +2 -1
  69. package/dist/src/services/aws.d.ts.map +1 -1
  70. package/dist/src/services/aws.js +4 -2
  71. package/dist/src/services/aws.js.map +1 -1
  72. package/dist/src/services/core/base.d.ts +53 -3
  73. package/dist/src/services/core/base.d.ts.map +1 -1
  74. package/dist/src/services/core/base.js +63 -3
  75. package/dist/src/services/core/base.js.map +1 -1
  76. package/dist/src/services/dropbox.d.ts.map +1 -1
  77. package/dist/src/services/dropbox.js +2 -2
  78. package/dist/src/services/dropbox.js.map +1 -1
  79. package/dist/src/services/fastmail.d.ts +4 -19
  80. package/dist/src/services/fastmail.d.ts.map +1 -1
  81. package/dist/src/services/fastmail.js +17 -22
  82. package/dist/src/services/fastmail.js.map +1 -1
  83. package/dist/src/services/google/base.d.ts +8 -3
  84. package/dist/src/services/google/base.d.ts.map +1 -1
  85. package/dist/src/services/google/base.js +23 -13
  86. package/dist/src/services/google/base.js.map +1 -1
  87. package/dist/src/services/index.d.ts +1 -1
  88. package/dist/src/services/index.d.ts.map +1 -1
  89. package/dist/src/services/index.js +1 -1
  90. package/dist/src/services/index.js.map +1 -1
  91. package/dist/src/services/notion-mcp.d.ts +16 -16
  92. package/dist/src/services/notion-mcp.d.ts.map +1 -1
  93. package/dist/src/services/notion-mcp.js +36 -21
  94. package/dist/src/services/notion-mcp.js.map +1 -1
  95. package/dist/src/services/ramp.d.ts.map +1 -1
  96. package/dist/src/services/ramp.js +2 -2
  97. package/dist/src/services/ramp.js.map +1 -1
  98. package/dist/src/services/slack.d.ts +2 -1
  99. package/dist/src/services/slack.d.ts.map +1 -1
  100. package/dist/src/services/slack.js +4 -2
  101. package/dist/src/services/slack.js.map +1 -1
  102. package/dist/src/services/tailscale.d.ts +2 -1
  103. package/dist/src/services/tailscale.d.ts.map +1 -1
  104. package/dist/src/services/tailscale.js +4 -2
  105. package/dist/src/services/tailscale.js.map +1 -1
  106. package/dist/src/services/telegram.d.ts +2 -1
  107. package/dist/src/services/telegram.d.ts.map +1 -1
  108. package/dist/src/services/telegram.js +4 -2
  109. package/dist/src/services/telegram.js.map +1 -1
  110. package/dist/src/services/zoom.d.ts +7 -5
  111. package/dist/src/services/zoom.d.ts.map +1 -1
  112. package/dist/src/services/zoom.js +11 -8
  113. package/dist/src/services/zoom.js.map +1 -1
  114. package/dist/src/version.d.ts +1 -1
  115. package/dist/src/version.js +1 -1
  116. package/dist/tests/apiCredentialStore.test.js +54 -1
  117. package/dist/tests/apiCredentialStore.test.js.map +1 -1
  118. package/dist/tests/apiCredentials.test.js +73 -12
  119. package/dist/tests/apiCredentials.test.js.map +1 -1
  120. package/dist/tests/browserStateImport.test.d.ts +2 -0
  121. package/dist/tests/browserStateImport.test.d.ts.map +1 -0
  122. package/dist/tests/browserStateImport.test.js +88 -0
  123. package/dist/tests/browserStateImport.test.js.map +1 -0
  124. package/dist/tests/cli.test.js +33 -1
  125. package/dist/tests/cli.test.js.map +1 -1
  126. package/dist/tests/config.test.js +7 -0
  127. package/dist/tests/config.test.js.map +1 -1
  128. package/dist/tests/diagnosticHeaders.test.d.ts +2 -0
  129. package/dist/tests/diagnosticHeaders.test.d.ts.map +1 -0
  130. package/dist/tests/diagnosticHeaders.test.js +22 -0
  131. package/dist/tests/diagnosticHeaders.test.js.map +1 -0
  132. package/dist/tests/followupFailureRecovery.test.d.ts +11 -0
  133. package/dist/tests/followupFailureRecovery.test.d.ts.map +1 -0
  134. package/dist/tests/followupFailureRecovery.test.js +101 -0
  135. package/dist/tests/followupFailureRecovery.test.js.map +1 -0
  136. package/dist/tests/gateway.test.js +25 -4
  137. package/dist/tests/gateway.test.js.map +1 -1
  138. package/dist/tests/gatewayExtensions.test.js +5 -2
  139. package/dist/tests/gatewayExtensions.test.js.map +1 -1
  140. package/dist/tests/latchkeyEndpoint.test.js +8 -6
  141. package/dist/tests/latchkeyEndpoint.test.js.map +1 -1
  142. package/dist/tests/notion-mcp.test.d.ts +2 -0
  143. package/dist/tests/notion-mcp.test.d.ts.map +1 -0
  144. package/dist/tests/notion-mcp.test.js +16 -0
  145. package/dist/tests/notion-mcp.test.js.map +1 -0
  146. package/dist/tests/oauthUtils.test.js +23 -1
  147. package/dist/tests/oauthUtils.test.js.map +1 -1
  148. package/dist/tests/plugins.test.d.ts +2 -0
  149. package/dist/tests/plugins.test.d.ts.map +1 -0
  150. package/dist/tests/plugins.test.js +506 -0
  151. package/dist/tests/plugins.test.js.map +1 -0
  152. package/dist/tests/sharedOperations.test.js +63 -2
  153. package/dist/tests/sharedOperations.test.js.map +1 -1
  154. package/dist/tests/tailscale.test.js +1 -3
  155. package/dist/tests/tailscale.test.js.map +1 -1
  156. package/package.json +15 -1
@@ -0,0 +1,118 @@
1
+ /**
2
+ * The `latchkey/plugin` entry point.
3
+ *
4
+ * At runtime, this builds the object handed to a plugin's factory: every value
5
+ * a plugin may use, so that a bare clone with no node_modules of its own has
6
+ * everything it needs. For plugin authors, it is also where the types come
7
+ * from, with `import type { LatchkeySdk, Service } from 'latchkey/plugin'`.
8
+ * That is the only way a plugin imports from it: the SDK object, not this
9
+ * module, is what carries the classes and helpers.
10
+ *
11
+ * Plugins declare the Latchkey versions they support as a semver range (see
12
+ * `src/plugins.ts`), so this surface follows semantic versioning: additions
13
+ * are welcome in any release, while removing or changing anything here is a
14
+ * breaking change that calls for a new major version of Latchkey.
15
+ */
16
+ import { z } from 'zod';
17
+ import { ApiCredentialStatus, ApiCredentialsUsageError, AuthorizationBare, AuthorizationBearer, OAuthCredentials, RawCurlCredentials } from './apiCredentials/base.js';
18
+ import { fetchAccountFromEndpoint, tryParseJson } from './apiCredentials/account.js';
19
+ import { runCapturedAsync } from './curl.js';
20
+ import { OAuthCallbackServerTimeoutError, OAuthTokenExchangeError, buildLoopbackRedirectUri, exchangeCodeForTokens, generateCodeChallenge, generateCodeVerifier, readRedirectUriOverride, refreshAccessToken, startOAuthCallbackServer } from './oauthUtils.js';
21
+ import { BrowserFeaturesUnavailableError, loadPlaywright } from './playwrightLoader.js';
22
+ import { BrowserDisabledError, BrowserFlowsNotSupportedError, CredentialFormFieldMissingError, CredentialFormValues, GraphicalEnvironmentNotFoundError, generateLatchkeyAppName, hasGraphicalEnvironment, requestCredentialsFromUser, showSpinnerPage, typeLikeHuman, withTempBrowserContext } from './playwrightUtils.js';
23
+ import { BrowserFollowupServiceSession, FollowupWork, LoginCancelledError, LoginFailedError, UnrecoverableLoginFailedError, NoCurlCredentialsNotSupportedError, PrepareInputInvalidError, PrepareNotSupportedError, Service, ServiceSession, SimpleServiceSession, buildDynamicClientPreparation, buildFollowupSpinnerDetails, buildPreparedCredentials, describeSchemaIssues, isBrowserClosedError, isResponseBodyUnavailableError, isTimeoutError } from './services/core/base.js';
24
+ import { CookieCaptureLoginFlow } from './services/core/loginFlows/cookieCapture.js';
25
+ import { TokenCaptureLoginFlow } from './services/core/loginFlows/tokenCapture.js';
26
+ import { RegisteredService } from './services/core/registered.js';
27
+ import { GoogleService } from './services/google/base.js';
28
+ export declare function createLatchkeySdk(latchkeyVersion: string): Readonly<{
29
+ latchkeyVersion: string;
30
+ z: typeof z;
31
+ builtinServices: readonly Service[];
32
+ Service: typeof Service;
33
+ ServiceSession: typeof ServiceSession;
34
+ SimpleServiceSession: typeof SimpleServiceSession;
35
+ BrowserFollowupServiceSession: typeof BrowserFollowupServiceSession;
36
+ FollowupWork: typeof FollowupWork;
37
+ RegisteredService: typeof RegisteredService;
38
+ GoogleService: typeof GoogleService;
39
+ CookieCaptureLoginFlow: typeof CookieCaptureLoginFlow;
40
+ TokenCaptureLoginFlow: typeof TokenCaptureLoginFlow;
41
+ buildDynamicClientPreparation: typeof buildDynamicClientPreparation;
42
+ buildFollowupSpinnerDetails: typeof buildFollowupSpinnerDetails;
43
+ buildPreparedCredentials: typeof buildPreparedCredentials;
44
+ describeSchemaIssues: typeof describeSchemaIssues;
45
+ isBrowserClosedError: typeof isBrowserClosedError;
46
+ isResponseBodyUnavailableError: typeof isResponseBodyUnavailableError;
47
+ isTimeoutError: typeof isTimeoutError;
48
+ LoginCancelledError: typeof LoginCancelledError;
49
+ LoginFailedError: typeof LoginFailedError;
50
+ UnrecoverableLoginFailedError: typeof UnrecoverableLoginFailedError;
51
+ NoCurlCredentialsNotSupportedError: typeof NoCurlCredentialsNotSupportedError;
52
+ PrepareNotSupportedError: typeof PrepareNotSupportedError;
53
+ PrepareInputInvalidError: typeof PrepareInputInvalidError;
54
+ RedirectUriOverrideSchema: z.ZodEffects<z.ZodString, string, string>;
55
+ DynamicClientPrepareInputSchema: z.ZodEffects<z.ZodObject<{
56
+ clientId: z.ZodOptional<z.ZodString>;
57
+ redirectUri: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
58
+ }, "strict", z.ZodTypeAny, {
59
+ clientId?: string | undefined;
60
+ redirectUri?: string | undefined;
61
+ }, {
62
+ clientId?: string | undefined;
63
+ redirectUri?: string | undefined;
64
+ }>, {
65
+ clientId?: string | undefined;
66
+ redirectUri?: string | undefined;
67
+ }, {
68
+ clientId?: string | undefined;
69
+ redirectUri?: string | undefined;
70
+ }>;
71
+ ApiCredentialStatus: typeof ApiCredentialStatus;
72
+ ApiCredentialsUsageError: typeof ApiCredentialsUsageError;
73
+ AuthorizationBearer: typeof AuthorizationBearer;
74
+ AuthorizationBare: typeof AuthorizationBare;
75
+ RawCurlCredentials: typeof RawCurlCredentials;
76
+ OAuthCredentials: typeof OAuthCredentials;
77
+ DEFAULT_ACCOUNT: "";
78
+ fetchAccountFromEndpoint: typeof fetchAccountFromEndpoint;
79
+ tryParseJson: typeof tryParseJson;
80
+ loadPlaywright: typeof loadPlaywright;
81
+ withTempBrowserContext: typeof withTempBrowserContext;
82
+ showSpinnerPage: typeof showSpinnerPage;
83
+ requestCredentialsFromUser: typeof requestCredentialsFromUser;
84
+ typeLikeHuman: typeof typeLikeHuman;
85
+ generateLatchkeyAppName: typeof generateLatchkeyAppName;
86
+ hasGraphicalEnvironment: typeof hasGraphicalEnvironment;
87
+ CredentialFormValues: typeof CredentialFormValues;
88
+ CredentialFormFieldMissingError: typeof CredentialFormFieldMissingError;
89
+ BrowserDisabledError: typeof BrowserDisabledError;
90
+ BrowserFlowsNotSupportedError: typeof BrowserFlowsNotSupportedError;
91
+ BrowserFeaturesUnavailableError: typeof BrowserFeaturesUnavailableError;
92
+ GraphicalEnvironmentNotFoundError: typeof GraphicalEnvironmentNotFoundError;
93
+ startOAuthCallbackServer: typeof startOAuthCallbackServer;
94
+ DEFAULT_OAUTH_CALLBACK_PATH: "/oauth2callback";
95
+ buildLoopbackRedirectUri: typeof buildLoopbackRedirectUri;
96
+ readRedirectUriOverride: typeof readRedirectUriOverride;
97
+ exchangeCodeForTokens: typeof exchangeCodeForTokens;
98
+ refreshAccessToken: typeof refreshAccessToken;
99
+ generateCodeVerifier: typeof generateCodeVerifier;
100
+ generateCodeChallenge: typeof generateCodeChallenge;
101
+ OAuthTokenExchangeError: typeof OAuthTokenExchangeError;
102
+ OAuthCallbackServerTimeoutError: typeof OAuthCallbackServerTimeoutError;
103
+ runCurlCapturedAsync: typeof runCapturedAsync;
104
+ }>;
105
+ export type LatchkeySdk = ReturnType<typeof createLatchkeySdk>;
106
+ export type { LatchkeyPlugin, LatchkeyPluginFactory } from './plugins.js';
107
+ export type { Service, ServiceSession, SimpleServiceSession, BrowserFollowupServiceSession, LoginResult, ManualCredentialForm, } from './services/core/base.js';
108
+ export type { RegisteredService, RegisteredServiceOptions } from './services/core/registered.js';
109
+ export type { LoginFlow } from './services/core/loginFlows/base.js';
110
+ export type { GoogleService } from './services/google/base.js';
111
+ export type { ApiCredentials, ApiCredentialsType, AuthorizationBare, AuthorizationBearer, OAuthCredentials, RawCurlCredentials, SerializedApiCredentials, } from './apiCredentials/base.js';
112
+ export type { EncryptedStorage } from './encryptedStorage.js';
113
+ export type { BrowserLaunchOptions, BrowserWithContext, CredentialFormDecision, CredentialFormField, CredentialFormValues, CredentialRequest, } from './playwrightUtils.js';
114
+ export type { OAuthCallbackServer, OAuthTokenExchangeResponse, OAuthTokenResponse, } from './oauthUtils.js';
115
+ export type { CurlResult } from './curl.js';
116
+ export type { Browser, BrowserContext, Locator, Page, Response } from 'playwright';
117
+ export type { z } from 'zod';
118
+ //# sourceMappingURL=pluginSdk.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pluginSdk.d.ts","sourceRoot":"","sources":["../../src/pluginSdk.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;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BAAiB,CAAC,eAAe,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyExD;AAED,MAAM,MAAM,WAAW,GAAG,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAI/D,YAAY,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAE1E,YAAY,EACV,OAAO,EACP,cAAc,EACd,oBAAoB,EACpB,6BAA6B,EAC7B,WAAW,EACX,oBAAoB,GACrB,MAAM,yBAAyB,CAAC;AACjC,YAAY,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACjG,YAAY,EAAE,SAAS,EAAE,MAAM,oCAAoC,CAAC;AACpE,YAAY,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE/D,YAAY,EACV,cAAc,EACd,kBAAkB,EAClB,iBAAiB,EACjB,mBAAmB,EACnB,gBAAgB,EAChB,kBAAkB,EAClB,wBAAwB,GACzB,MAAM,0BAA0B,CAAC;AAClC,YAAY,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE9D,YAAY,EACV,oBAAoB,EACpB,kBAAkB,EAClB,sBAAsB,EACtB,mBAAmB,EACnB,oBAAoB,EACpB,iBAAiB,GAClB,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EACV,mBAAmB,EACnB,0BAA0B,EAC1B,kBAAkB,GACnB,MAAM,iBAAiB,CAAC;AACzB,YAAY,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAI5C,YAAY,EAAE,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACnF,YAAY,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC"}
@@ -0,0 +1,98 @@
1
+ /**
2
+ * The `latchkey/plugin` entry point.
3
+ *
4
+ * At runtime, this builds the object handed to a plugin's factory: every value
5
+ * a plugin may use, so that a bare clone with no node_modules of its own has
6
+ * everything it needs. For plugin authors, it is also where the types come
7
+ * from, with `import type { LatchkeySdk, Service } from 'latchkey/plugin'`.
8
+ * That is the only way a plugin imports from it: the SDK object, not this
9
+ * module, is what carries the classes and helpers.
10
+ *
11
+ * Plugins declare the Latchkey versions they support as a semver range (see
12
+ * `src/plugins.ts`), so this surface follows semantic versioning: additions
13
+ * are welcome in any release, while removing or changing anything here is a
14
+ * breaking change that calls for a new major version of Latchkey.
15
+ */
16
+ import { z } from 'zod';
17
+ import { ApiCredentialStatus, ApiCredentialsUsageError, AuthorizationBare, AuthorizationBearer, OAuthCredentials, RawCurlCredentials, } from './apiCredentials/base.js';
18
+ import { DEFAULT_ACCOUNT, fetchAccountFromEndpoint, tryParseJson, } from './apiCredentials/account.js';
19
+ import { runCapturedAsync } from './curl.js';
20
+ import { DEFAULT_OAUTH_CALLBACK_PATH, OAuthCallbackServerTimeoutError, OAuthTokenExchangeError, buildLoopbackRedirectUri, exchangeCodeForTokens, generateCodeChallenge, generateCodeVerifier, readRedirectUriOverride, refreshAccessToken, startOAuthCallbackServer, } from './oauthUtils.js';
21
+ import { BrowserFeaturesUnavailableError, loadPlaywright } from './playwrightLoader.js';
22
+ import { BrowserDisabledError, BrowserFlowsNotSupportedError, CredentialFormFieldMissingError, CredentialFormValues, GraphicalEnvironmentNotFoundError, generateLatchkeyAppName, hasGraphicalEnvironment, requestCredentialsFromUser, showSpinnerPage, typeLikeHuman, withTempBrowserContext, } from './playwrightUtils.js';
23
+ import { BUILTIN_SERVICES } from './serviceRegistry.js';
24
+ import { BrowserFollowupServiceSession, DynamicClientPrepareInputSchema, FollowupWork, LoginCancelledError, LoginFailedError, UnrecoverableLoginFailedError, NoCurlCredentialsNotSupportedError, PrepareInputInvalidError, PrepareNotSupportedError, RedirectUriOverrideSchema, Service, ServiceSession, SimpleServiceSession, buildDynamicClientPreparation, buildFollowupSpinnerDetails, buildPreparedCredentials, describeSchemaIssues, isBrowserClosedError, isResponseBodyUnavailableError, isTimeoutError, } from './services/core/base.js';
25
+ import { CookieCaptureLoginFlow } from './services/core/loginFlows/cookieCapture.js';
26
+ import { TokenCaptureLoginFlow } from './services/core/loginFlows/tokenCapture.js';
27
+ import { RegisteredService } from './services/core/registered.js';
28
+ import { GoogleService } from './services/google/base.js';
29
+ export function createLatchkeySdk(latchkeyVersion) {
30
+ return Object.freeze({
31
+ latchkeyVersion,
32
+ z,
33
+ builtinServices: BUILTIN_SERVICES,
34
+ // Services
35
+ Service,
36
+ ServiceSession,
37
+ SimpleServiceSession,
38
+ BrowserFollowupServiceSession,
39
+ FollowupWork,
40
+ RegisteredService,
41
+ GoogleService,
42
+ CookieCaptureLoginFlow,
43
+ TokenCaptureLoginFlow,
44
+ buildDynamicClientPreparation,
45
+ buildFollowupSpinnerDetails,
46
+ buildPreparedCredentials,
47
+ describeSchemaIssues,
48
+ isBrowserClosedError,
49
+ isResponseBodyUnavailableError,
50
+ isTimeoutError,
51
+ LoginCancelledError,
52
+ LoginFailedError,
53
+ UnrecoverableLoginFailedError,
54
+ NoCurlCredentialsNotSupportedError,
55
+ PrepareNotSupportedError,
56
+ PrepareInputInvalidError,
57
+ RedirectUriOverrideSchema,
58
+ DynamicClientPrepareInputSchema,
59
+ // Credentials
60
+ ApiCredentialStatus,
61
+ ApiCredentialsUsageError,
62
+ AuthorizationBearer,
63
+ AuthorizationBare,
64
+ RawCurlCredentials,
65
+ OAuthCredentials,
66
+ DEFAULT_ACCOUNT,
67
+ fetchAccountFromEndpoint,
68
+ tryParseJson,
69
+ // Browser automation
70
+ loadPlaywright,
71
+ withTempBrowserContext,
72
+ showSpinnerPage,
73
+ requestCredentialsFromUser,
74
+ typeLikeHuman,
75
+ generateLatchkeyAppName,
76
+ hasGraphicalEnvironment,
77
+ CredentialFormValues,
78
+ CredentialFormFieldMissingError,
79
+ BrowserDisabledError,
80
+ BrowserFlowsNotSupportedError,
81
+ BrowserFeaturesUnavailableError,
82
+ GraphicalEnvironmentNotFoundError,
83
+ // OAuth
84
+ startOAuthCallbackServer,
85
+ DEFAULT_OAUTH_CALLBACK_PATH,
86
+ buildLoopbackRedirectUri,
87
+ readRedirectUriOverride,
88
+ exchangeCodeForTokens,
89
+ refreshAccessToken,
90
+ generateCodeVerifier,
91
+ generateCodeChallenge,
92
+ OAuthTokenExchangeError,
93
+ OAuthCallbackServerTimeoutError,
94
+ // curl
95
+ runCurlCapturedAsync: runCapturedAsync,
96
+ });
97
+ }
98
+ //# sourceMappingURL=pluginSdk.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pluginSdk.js","sourceRoot":"","sources":["../../src/pluginSdk.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,mBAAmB,EACnB,wBAAwB,EACxB,iBAAiB,EACjB,mBAAmB,EACnB,gBAAgB,EAChB,kBAAkB,GACnB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,eAAe,EACf,wBAAwB,EACxB,YAAY,GACb,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EACL,2BAA2B,EAC3B,+BAA+B,EAC/B,uBAAuB,EACvB,wBAAwB,EACxB,qBAAqB,EACrB,qBAAqB,EACrB,oBAAoB,EACpB,uBAAuB,EACvB,kBAAkB,EAClB,wBAAwB,GACzB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,+BAA+B,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACxF,OAAO,EACL,oBAAoB,EACpB,6BAA6B,EAC7B,+BAA+B,EAC/B,oBAAoB,EACpB,iCAAiC,EACjC,uBAAuB,EACvB,uBAAuB,EACvB,0BAA0B,EAC1B,eAAe,EACf,aAAa,EACb,sBAAsB,GACvB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,gBAAgB,EAAE,MAA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a;QACb,uBAAuB;QACvB,uBAAuB;QACvB,oBAAoB;QACpB,+BAA+B;QAC/B,oBAAoB;QACpB,6BAA6B;QAC7B,+BAA+B;QAC/B,iCAAiC;QAEjC,QAAQ;QACR,wBAAwB;QACxB,2BAA2B;QAC3B,wBAAwB;QACxB,uBAAuB;QACvB,qBAAqB;QACrB,kBAAkB;QAClB,oBAAoB;QACpB,qBAAqB;QACrB,uBAAuB;QACvB,+BAA+B;QAE/B,OAAO;QACP,oBAAoB,EAAE,gBAAgB;KACvC,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,74 @@
1
+ /**
2
+ * Plugins: services contributed by repositories cloned into the plugins
3
+ * directory (`~/.latchkey/plugins/` by default). Once loaded, their services
4
+ * are indistinguishable from the built-in ones.
5
+ *
6
+ * A plugin is an ES module package whose default export is a factory. It is
7
+ * handed a {@link LatchkeySdk} and returns a {@link LatchkeyPlugin}:
8
+ *
9
+ * export default (sdk) => {
10
+ * class Foo extends sdk.Service { ... }
11
+ * return { latchkeyVersion: '^3.15.0', services: [new Foo()] };
12
+ * };
13
+ *
14
+ * A plugin whose services use a credentials class of their own also lists
15
+ * that class under `apiCredentialsTypes`, which is what lets such credentials
16
+ * be stored. The class carries a static `objectType` and a static `fromJSON`
17
+ * that validates stored data (see the built-in credentials classes).
18
+ *
19
+ * `latchkeyVersion` is the range of Latchkey versions the plugin was written
20
+ * for, in the syntax of a package.json dependency. Latchkey follows semantic
21
+ * versioning with respect to the sdk, so `^3.15.0` means "3.15.0 or newer,
22
+ * until the next major version", and a plugin whose range excludes the running
23
+ * Latchkey is refused at load time rather than failing in some subtler way
24
+ * later.
25
+ *
26
+ * Everything a plugin needs at runtime comes from the sdk, so a bare
27
+ * `git clone` into the plugins directory is a complete installation.
28
+ */
29
+ import type { ApiCredentialsType } from './apiCredentials/base.js';
30
+ import type { LatchkeySdk } from './pluginSdk.js';
31
+ import { Service } from './services/core/base.js';
32
+ export interface LatchkeyPlugin {
33
+ /**
34
+ * The Latchkey versions the plugin supports, as a package.json-style
35
+ * version range such as `^3.15.0`.
36
+ */
37
+ readonly latchkeyVersion: string;
38
+ readonly services: readonly Service[];
39
+ /** The credentials classes the plugin defines, if any. */
40
+ readonly apiCredentialsTypes?: readonly ApiCredentialsType[];
41
+ }
42
+ export type LatchkeyPluginFactory = (sdk: LatchkeySdk) => LatchkeyPlugin | Promise<LatchkeyPlugin>;
43
+ export interface LoadedPlugin {
44
+ /** The name of the plugin's directory inside the plugins directory. */
45
+ readonly name: string;
46
+ readonly directory: string;
47
+ readonly services: readonly Service[];
48
+ readonly apiCredentialsTypes: readonly ApiCredentialsType[];
49
+ }
50
+ export declare class PluginLoadError extends Error {
51
+ constructor(pluginName: string, detail: string);
52
+ }
53
+ /**
54
+ * Whether the running Latchkey falls within the version range a plugin
55
+ * declares. A prerelease Latchkey (say a development build) counts too, as
56
+ * long as the range would admit its release.
57
+ */
58
+ export declare function isLatchkeyVersionSupported(versionRange: string, latchkeyVersion: string): boolean;
59
+ /**
60
+ * Load every plugin found in `directory`, in alphabetical order of directory
61
+ * name. Entries that are not directories (following symlinks, so a checkout
62
+ * elsewhere can be linked in) are ignored, as are `node_modules` and dot
63
+ * directories. A missing directory means no plugins. Throws `PluginLoadError`
64
+ * on the first plugin that cannot be loaded.
65
+ */
66
+ export declare function loadPlugins(directory: string, sdk: LatchkeySdk): Promise<readonly LoadedPlugin[]>;
67
+ /**
68
+ * The built-in services followed by every plugin's, refusing a plugin service
69
+ * whose name is already taken. The registry itself only checks names as
70
+ * services are added one by one, and these all go in together.
71
+ */
72
+ export declare function combineWithPluginServices(builtinServices: readonly Service[], plugins: readonly LoadedPlugin[]): readonly Service[];
73
+ export declare function combineWithPluginApiCredentialsTypes(builtinTypes: readonly ApiCredentialsType[], plugins: readonly LoadedPlugin[]): readonly ApiCredentialsType[];
74
+ //# sourceMappingURL=plugins.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugins.d.ts","sourceRoot":"","sources":["../../src/plugins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AE,SAAS,YAAY,EAAE,GAC/B,SAAS,OAAO,EAAE,CAQpB;AAED,wBAAgB,oCAAoC,CAClD,YAAY,EAAE,SAAS,kBAAkB,EAAE,EAC3C,OAAO,EAAE,SAAS,YAAY,EAAE,GAC/B,SAAS,kBAAkB,EAAE,CAQ/B"}
@@ -0,0 +1,221 @@
1
+ /**
2
+ * Plugins: services contributed by repositories cloned into the plugins
3
+ * directory (`~/.latchkey/plugins/` by default). Once loaded, their services
4
+ * are indistinguishable from the built-in ones.
5
+ *
6
+ * A plugin is an ES module package whose default export is a factory. It is
7
+ * handed a {@link LatchkeySdk} and returns a {@link LatchkeyPlugin}:
8
+ *
9
+ * export default (sdk) => {
10
+ * class Foo extends sdk.Service { ... }
11
+ * return { latchkeyVersion: '^3.15.0', services: [new Foo()] };
12
+ * };
13
+ *
14
+ * A plugin whose services use a credentials class of their own also lists
15
+ * that class under `apiCredentialsTypes`, which is what lets such credentials
16
+ * be stored. The class carries a static `objectType` and a static `fromJSON`
17
+ * that validates stored data (see the built-in credentials classes).
18
+ *
19
+ * `latchkeyVersion` is the range of Latchkey versions the plugin was written
20
+ * for, in the syntax of a package.json dependency. Latchkey follows semantic
21
+ * versioning with respect to the sdk, so `^3.15.0` means "3.15.0 or newer,
22
+ * until the next major version", and a plugin whose range excludes the running
23
+ * Latchkey is refused at load time rather than failing in some subtler way
24
+ * later.
25
+ *
26
+ * Everything a plugin needs at runtime comes from the sdk, so a bare
27
+ * `git clone` into the plugins directory is a complete installation.
28
+ */
29
+ import { existsSync, readdirSync, readFileSync, statSync } from 'node:fs';
30
+ import { join } from 'node:path';
31
+ import { pathToFileURL } from 'node:url';
32
+ import { satisfies as satisfiesVersionRange, validRange } from 'semver';
33
+ import { Service } from './services/core/base.js';
34
+ export class PluginLoadError extends Error {
35
+ constructor(pluginName, detail) {
36
+ super(`Failed to load plugin '${pluginName}': ${detail}`);
37
+ this.name = 'PluginLoadError';
38
+ }
39
+ }
40
+ const PACKAGE_JSON_FILENAME = 'package.json';
41
+ const DEFAULT_ENTRY_FILENAME = 'index.js';
42
+ // ─── Loading ──────────────────────────────────────────────────────────────────
43
+ /**
44
+ * The entry a package.json `exports` field points at for the package root,
45
+ * or undefined when it names none that an `import` would pick.
46
+ */
47
+ function pickEntryFromExports(exportsField) {
48
+ if (typeof exportsField === 'string') {
49
+ return exportsField;
50
+ }
51
+ if (typeof exportsField !== 'object' || exportsField === null) {
52
+ return undefined;
53
+ }
54
+ const record = exportsField;
55
+ if ('.' in record) {
56
+ return pickEntryFromExports(record['.']);
57
+ }
58
+ return pickEntryFromExports(record.import ?? record.default);
59
+ }
60
+ function resolvePluginEntryFile(pluginName, pluginDirectory) {
61
+ const packageJsonPath = join(pluginDirectory, PACKAGE_JSON_FILENAME);
62
+ let entry = DEFAULT_ENTRY_FILENAME;
63
+ if (existsSync(packageJsonPath)) {
64
+ let packageJson;
65
+ try {
66
+ packageJson = JSON.parse(readFileSync(packageJsonPath, 'utf-8'));
67
+ }
68
+ catch (error) {
69
+ const message = error instanceof Error ? error.message : String(error);
70
+ throw new PluginLoadError(pluginName, `invalid ${PACKAGE_JSON_FILENAME}: ${message}`);
71
+ }
72
+ const { exports: exportsField, main } = packageJson;
73
+ entry = pickEntryFromExports(exportsField) ?? (typeof main === 'string' ? main : entry);
74
+ }
75
+ const entryFile = join(pluginDirectory, entry);
76
+ if (!existsSync(entryFile)) {
77
+ throw new PluginLoadError(pluginName, `entry file '${entryFile}' does not exist. ` +
78
+ 'If the plugin is written in TypeScript, it has to be built first.');
79
+ }
80
+ return entryFile;
81
+ }
82
+ const EXAMPLE_VERSION_RANGE = '^3.15.0';
83
+ /**
84
+ * Whether the running Latchkey falls within the version range a plugin
85
+ * declares. A prerelease Latchkey (say a development build) counts too, as
86
+ * long as the range would admit its release.
87
+ */
88
+ export function isLatchkeyVersionSupported(versionRange, latchkeyVersion) {
89
+ return satisfiesVersionRange(latchkeyVersion, versionRange, { includePrerelease: true });
90
+ }
91
+ function validatePluginManifest(pluginName, manifest, latchkeyVersion) {
92
+ if (typeof manifest !== 'object' || manifest === null) {
93
+ throw new PluginLoadError(pluginName, 'the plugin factory did not return an object.');
94
+ }
95
+ const { latchkeyVersion: versionRange, services, apiCredentialsTypes, } = manifest;
96
+ if (typeof versionRange !== 'string') {
97
+ throw new PluginLoadError(pluginName, "'latchkeyVersion' must be a string declaring the Latchkey versions the plugin supports, " +
98
+ `like '${EXAMPLE_VERSION_RANGE}'.`);
99
+ }
100
+ if (validRange(versionRange) === null) {
101
+ throw new PluginLoadError(pluginName, `'${versionRange}' is not a valid version range for 'latchkeyVersion'. ` +
102
+ `Use the syntax of a package.json dependency, like '${EXAMPLE_VERSION_RANGE}'.`);
103
+ }
104
+ if (!isLatchkeyVersionSupported(versionRange, latchkeyVersion)) {
105
+ throw new PluginLoadError(pluginName, `it supports Latchkey ${versionRange}, but this is Latchkey ${latchkeyVersion}.`);
106
+ }
107
+ if (!Array.isArray(services)) {
108
+ throw new PluginLoadError(pluginName, "'services' must be an array of Service instances.");
109
+ }
110
+ for (const service of services) {
111
+ if (!(service instanceof Service)) {
112
+ throw new PluginLoadError(pluginName, "every entry of 'services' must extend the Service class handed to the plugin " +
113
+ 'as sdk.Service. A service that looks right but is still refused usually extends ' +
114
+ 'the class of a separately installed latchkey instead.');
115
+ }
116
+ }
117
+ return {
118
+ latchkeyVersion: versionRange,
119
+ services: services,
120
+ apiCredentialsTypes: validateApiCredentialsTypes(pluginName, apiCredentialsTypes),
121
+ };
122
+ }
123
+ function isApiCredentialsType(value) {
124
+ if ((typeof value !== 'object' && typeof value !== 'function') || value === null) {
125
+ return false;
126
+ }
127
+ const { objectType, fromJSON } = value;
128
+ return typeof objectType === 'string' && typeof fromJSON === 'function';
129
+ }
130
+ function validateApiCredentialsTypes(pluginName, apiCredentialsTypes) {
131
+ if (apiCredentialsTypes === undefined) {
132
+ return [];
133
+ }
134
+ if (!Array.isArray(apiCredentialsTypes)) {
135
+ throw new PluginLoadError(pluginName, "'apiCredentialsTypes' must be an array when present.");
136
+ }
137
+ for (const type of apiCredentialsTypes) {
138
+ if (!isApiCredentialsType(type)) {
139
+ throw new PluginLoadError(pluginName, "every entry of 'apiCredentialsTypes' must be a credentials class with a static " +
140
+ "'objectType' and a static 'fromJSON'.");
141
+ }
142
+ }
143
+ return apiCredentialsTypes;
144
+ }
145
+ async function loadPlugin(pluginName, pluginDirectory, sdk) {
146
+ const entryFile = resolvePluginEntryFile(pluginName, pluginDirectory);
147
+ let importedModule;
148
+ try {
149
+ importedModule = (await import(pathToFileURL(entryFile).href));
150
+ }
151
+ catch (error) {
152
+ throw new PluginLoadError(pluginName, `could not import '${entryFile}': ${error instanceof Error ? error.message : String(error)}`);
153
+ }
154
+ const factory = importedModule.default;
155
+ if (typeof factory !== 'function') {
156
+ throw new PluginLoadError(pluginName, `'${entryFile}' must have a default export that is a function (sdk) => plugin.`);
157
+ }
158
+ let manifest;
159
+ try {
160
+ manifest = await factory(sdk);
161
+ }
162
+ catch (error) {
163
+ const message = error instanceof Error ? error.message : String(error);
164
+ throw new PluginLoadError(pluginName, `the plugin factory threw: ${message}`);
165
+ }
166
+ const { services, apiCredentialsTypes } = validatePluginManifest(pluginName, manifest, sdk.latchkeyVersion);
167
+ return { name: pluginName, directory: pluginDirectory, services, apiCredentialsTypes };
168
+ }
169
+ function isDirectory(path) {
170
+ return statSync(path, { throwIfNoEntry: false })?.isDirectory() ?? false;
171
+ }
172
+ /**
173
+ * Load every plugin found in `directory`, in alphabetical order of directory
174
+ * name. Entries that are not directories (following symlinks, so a checkout
175
+ * elsewhere can be linked in) are ignored, as are `node_modules` and dot
176
+ * directories. A missing directory means no plugins. Throws `PluginLoadError`
177
+ * on the first plugin that cannot be loaded.
178
+ */
179
+ export async function loadPlugins(directory, sdk) {
180
+ if (!isDirectory(directory)) {
181
+ return [];
182
+ }
183
+ const pluginNames = readdirSync(directory)
184
+ .filter((name) => !name.startsWith('.') && name !== 'node_modules')
185
+ .filter((name) => isDirectory(join(directory, name)))
186
+ .sort();
187
+ const plugins = [];
188
+ for (const pluginName of pluginNames) {
189
+ plugins.push(await loadPlugin(pluginName, join(directory, pluginName), sdk));
190
+ }
191
+ return plugins;
192
+ }
193
+ /**
194
+ * The built-in items followed by every plugin's, refusing a plugin item whose
195
+ * key is already taken.
196
+ */
197
+ function combineWithPluginContributions(kind, builtinItems, plugins, itemsOf, keyOf) {
198
+ const providers = new Map(builtinItems.map((item) => [keyOf(item), 'Latchkey itself']));
199
+ for (const plugin of plugins) {
200
+ for (const item of itemsOf(plugin)) {
201
+ const provider = providers.get(keyOf(item));
202
+ if (provider !== undefined) {
203
+ throw new PluginLoadError(plugin.name, `${kind} '${keyOf(item)}' is already provided by ${provider}.`);
204
+ }
205
+ providers.set(keyOf(item), `plugin '${plugin.name}'`);
206
+ }
207
+ }
208
+ return [...builtinItems, ...plugins.flatMap(itemsOf)];
209
+ }
210
+ /**
211
+ * The built-in services followed by every plugin's, refusing a plugin service
212
+ * whose name is already taken. The registry itself only checks names as
213
+ * services are added one by one, and these all go in together.
214
+ */
215
+ export function combineWithPluginServices(builtinServices, plugins) {
216
+ return combineWithPluginContributions('service', builtinServices, plugins, (plugin) => plugin.services, (service) => service.name);
217
+ }
218
+ export function combineWithPluginApiCredentialsTypes(builtinTypes, plugins) {
219
+ return combineWithPluginContributions('credentials type', builtinTypes, plugins, (plugin) => plugin.apiCredentialsTypes, (type) => type.objectType);
220
+ }
221
+ //# sourceMappingURL=plugins.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugins.js","sourceRoot":"","sources":["../../src/plugins.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC1E,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,E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H,MAAM,UAAU,yBAAyB,CACvC,eAAmC,EACnC,OAAgC;IAEhC,OAAO,8BAA8B,CACnC,SAAS,EACT,eAAe,EACf,OAAO,EACP,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,QAAQ,EAC3B,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAC1B,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,oCAAoC,CAClD,YAA2C,EAC3C,OAAgC;IAEhC,OAAO,8BAA8B,CACnC,kBAAkB,EAClB,YAAY,EACZ,OAAO,EACP,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,mBAAmB,EACtC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,UAAU,CAC1B,CAAC;AACJ,CAAC"}
@@ -44,7 +44,7 @@ export declare class ServiceRegistry {
44
44
  export declare function hideServicesFromRegistry(registry: ServiceRegistry, serviceNames: readonly string[]): void;
45
45
  export declare function loadRegisteredServicesIntoServiceRegistry(configPath: string, registry: ServiceRegistry): void;
46
46
  /**
47
- * Build a registry holding `builtinServices` plus the services registered in
47
+ * Build a registry holding `baseServices` plus the services registered in
48
48
  * config.json, with the named services removed. This is how both the CLI and
49
49
  * every gateway request get their registry.
50
50
  *
@@ -55,6 +55,6 @@ export declare function loadRegisteredServicesIntoServiceRegistry(configPath: st
55
55
  * when it is pointed at a remote gateway: the gateway owns the registered
56
56
  * services there, and the local CLI only forwards commands to it.
57
57
  */
58
- export declare function createServiceRegistry(builtinServices: readonly Service[], configPath: string | null, hiddenServiceNames: readonly string[]): ServiceRegistry;
58
+ export declare function createServiceRegistry(baseServices: readonly Service[], configPath: string | null, hiddenServiceNames: readonly string[]): ServiceRegistry;
59
59
  export declare const BUILTIN_SERVICES: readonly Service[];
60
60
  //# sourceMappingURL=serviceRegistry.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"serviceRegistry.d.ts","sourceRoot":"","sources":["../../src/serviceRegistry.ts"],"names":[],"mappings":"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B,EAAE,SAAS,OAAO,EAqC9C,CAAC"}
@@ -141,7 +141,7 @@ export function loadRegisteredServicesIntoServiceRegistry(configPath, registry)
141
141
  }
142
142
  }
143
143
  /**
144
- * Build a registry holding `builtinServices` plus the services registered in
144
+ * Build a registry holding `baseServices` plus the services registered in
145
145
  * config.json, with the named services removed. This is how both the CLI and
146
146
  * every gateway request get their registry.
147
147
  *
@@ -152,8 +152,8 @@ export function loadRegisteredServicesIntoServiceRegistry(configPath, registry)
152
152
  * when it is pointed at a remote gateway: the gateway owns the registered
153
153
  * services there, and the local CLI only forwards commands to it.
154
154
  */
155
- export function createServiceRegistry(builtinServices, configPath, hiddenServiceNames) {
156
- const registry = new ServiceRegistry(builtinServices);
155
+ export function createServiceRegistry(baseServices, configPath, hiddenServiceNames) {
156
+ const registry = new ServiceRegistry(baseServices);
157
157
  if (configPath !== null) {
158
158
  loadRegisteredServicesIntoServiceRegistry(configPath, registry);
159
159
  }
@@ -1 +1 @@
1
- {"version":3,"file":"serviceRegistry.js","sourceRoot":"","sources":["../../src/serviceRegistry.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,sBAAsB,EAA+B,MAAM,sBAAsB,CAAC;AAC3F,OAAO,EAAE,6BAA6B,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AACjG,OAAO,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,wCAAwC,CAAC;AACjG,OAAO,EAAE,2BAA2B,EAAkB,MAAM,oCAAoC,CAAC;AACjG,OAAO,EAEL,KAAK,EACL,OAAO,EACP,OAAO,EACP,MAAM,EACN,MAAM,EACN,MAAM,EACN,UAAU,EACV,YAAY,EACZ,eAAe,EACf,YAAY,EACZ,aAAa,EACb,WAAW,EACX,aAAa,EACb,aAAa,EACb,SAAS,EACT,QAAQ,EACR,YAAY,EACZ,MAAM,EACN,IAAI,EACJ,MAAM,EACN,MAAM,EACN,KAAK,EACL,gBAAgB,EAChB,QAAQ,EACR,IAAI,E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S;QACX,CAAC;QACD,MAAM,iBAAiB,GAAG,IAAI,iBAAiB,CAC7C,IAAI,EACJ,KAAK,CAAC,UAAU,EAChB,6BAA6B,CAC3B,aAAa,EACb,KAAK,CAAC,QAAQ,EACd,sBAAsB,CAAC,KAAK,CAAC,SAAS,CAAC,CACxC,CACF,CAAC;QACF,QAAQ,CAAC,UAAU,CAAC,iBAAiB,CAAC,CAAC;IACzC,CAAC;AACH,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,qBAAqB,CACnC,eAAmC,EACnC,UAAyB,EACzB,kBAAqC;IAErC,MAAM,QAAQ,GAAG,IAAI,eAAe,CAAC,eAAe,CAAC,CAAC;IACtD,IAAI,UAAU,KAAK,IAAI,EAAE,CAAC;QACxB,yCAAyC,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;IAClE,CAAC;IACD,wBAAwB,CAAC,QAAQ,EAAE,kBAAkB,CAAC,CAAC;IACvD,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,MAAM,CAAC,MAAM,gBAAgB,GAAuB;IAClD,KAAK;IACL,OAAO;IACP,OAAO;IACP,MAAM;IACN,MAAM;IACN,MAAM;IACN,UAAU;IACV,YAAY;IACZ,eAAe;IACf,YAAY;IACZ,aAAa;IACb,WAAW;IACX,aAAa;IACb,aAAa;IACb,SAAS;IACT,QAAQ;IACR,YAAY;IACZ,MAAM;IACN,IAAI;IACJ,MAAM;IACN,MAAM;IACN,KAAK;IACL,gBAAgB;IAChB,QAAQ;IACR,IAAI;IACJ,QAAQ;IACR,GAAG;IACH,iBAAiB;IACjB,OAAO;IACP,KAAK;IACL,IAAI;IACJ,OAAO;IACP,KAAK;IACL,WAAW;IACX,UAAU;IACV,SAAS;CACV,CAAC"}
1
+ {"version":3,"file":"serviceRegistry.js","sourceRoot":"","sources":["../../src/serviceRegistry.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,sBAAsB,EAA+B,MAAM,sBAAsB,CAAC;AAC3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Z,eAAe;IACf,YAAY;IACZ,aAAa;IACb,WAAW;IACX,aAAa;IACb,aAAa;IACb,SAAS;IACT,QAAQ;IACR,YAAY;IACZ,MAAM;IACN,IAAI;IACJ,MAAM;IACN,MAAM;IACN,KAAK;IACL,gBAAgB;IAChB,QAAQ;IACR,IAAI;IACJ,QAAQ;IACR,GAAG;IACH,iBAAiB;IACjB,OAAO;IACP,KAAK;IACL,IAAI;IACJ,OAAO;IACP,KAAK;IACL,WAAW;IACX,UAAU;IACV,SAAS;CACV,CAAC"}
@@ -21,6 +21,7 @@ export declare const AwsCredentialsSchema: z.ZodObject<{
21
21
  }>;
22
22
  export type AwsCredentialsData = z.infer<typeof AwsCredentialsSchema>;
23
23
  export declare class AwsCredentials implements ApiCredentials {
24
+ static readonly objectType: "aws";
24
25
  readonly objectType: "aws";
25
26
  readonly accessKeyId: string;
26
27
  readonly secretAccessKey: string;
@@ -28,7 +29,7 @@ export declare class AwsCredentials implements ApiCredentials {
28
29
  injectIntoCurlCall(curlArguments: readonly string[], requestBody?: Buffer | null): Promise<readonly string[]>;
29
30
  isExpired(): boolean | undefined;
30
31
  toJSON(): AwsCredentialsData;
31
- static fromJSON(data: AwsCredentialsData): AwsCredentials;
32
+ static fromJSON(data: unknown): AwsCredentials;
32
33
  }
33
34
  export declare class Aws extends Service {
34
35
  readonly name = "aws";