@superblocksteam/shared 0.9546.7 → 0.9547.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/dist/socket/protocol.d.ts +10 -1
- package/dist/socket/protocol.d.ts.map +1 -1
- package/dist/socket/protocol.js.map +1 -1
- package/dist/types/datasource/auth.d.ts +7 -1
- package/dist/types/datasource/auth.d.ts.map +1 -1
- package/dist/types/datasource/auth.js +21 -1
- package/dist/types/datasource/auth.js.map +1 -1
- package/dist/types/datasource/index.d.ts +14 -0
- package/dist/types/datasource/index.d.ts.map +1 -1
- package/dist/types/datasource/index.js +36 -2
- package/dist/types/datasource/index.js.map +1 -1
- package/dist/types/datasource/index.test.d.ts +2 -0
- package/dist/types/datasource/index.test.d.ts.map +1 -0
- package/dist/types/datasource/index.test.js +421 -0
- package/dist/types/datasource/index.test.js.map +1 -0
- package/dist/types/lock/index.d.ts +8 -0
- package/dist/types/lock/index.d.ts.map +1 -1
- package/dist/types/plugin/integration.d.ts +2 -1
- package/dist/types/plugin/integration.d.ts.map +1 -1
- package/dist/types/plugin/integration.js +3 -1
- package/dist/types/plugin/integration.js.map +1 -1
- package/dist-esm/socket/protocol.d.ts +10 -1
- package/dist-esm/socket/protocol.d.ts.map +1 -1
- package/dist-esm/socket/protocol.js.map +1 -1
- package/dist-esm/types/datasource/auth.d.ts +7 -1
- package/dist-esm/types/datasource/auth.d.ts.map +1 -1
- package/dist-esm/types/datasource/auth.js +20 -0
- package/dist-esm/types/datasource/auth.js.map +1 -1
- package/dist-esm/types/datasource/index.d.ts +14 -0
- package/dist-esm/types/datasource/index.d.ts.map +1 -1
- package/dist-esm/types/datasource/index.js +33 -1
- package/dist-esm/types/datasource/index.js.map +1 -1
- package/dist-esm/types/datasource/index.test.d.ts +2 -0
- package/dist-esm/types/datasource/index.test.d.ts.map +1 -0
- package/dist-esm/types/datasource/index.test.js +419 -0
- package/dist-esm/types/datasource/index.test.js.map +1 -0
- package/dist-esm/types/lock/index.d.ts +8 -0
- package/dist-esm/types/lock/index.d.ts.map +1 -1
- package/dist-esm/types/plugin/integration.d.ts +2 -1
- package/dist-esm/types/plugin/integration.d.ts.map +1 -1
- package/dist-esm/types/plugin/integration.js +3 -1
- package/dist-esm/types/plugin/integration.js.map +1 -1
- package/package.json +1 -1
- package/src/socket/protocol.ts +3 -0
- package/src/types/datasource/auth.ts +21 -1
- package/src/types/datasource/index.test.ts +499 -0
- package/src/types/datasource/index.ts +45 -1
- package/src/types/lock/index.ts +9 -0
- package/src/types/plugin/integration.ts +4 -2
|
@@ -253,7 +253,51 @@ export type AuthenticatedDatasourceConfig = BaseDatasourceConfiguration & {
|
|
|
253
253
|
};
|
|
254
254
|
|
|
255
255
|
export function isAuthenticatedDatasourceConfig(dc: DatasourceConfiguration): dc is AuthenticatedDatasourceConfig {
|
|
256
|
-
|
|
256
|
+
if (!('authConfig' in dc)) {
|
|
257
|
+
return false;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
return 'authType' in dc && dc.authType !== undefined;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
export type AuthenticatedDatasourceConfigWithDynamicAuthType = BaseDatasourceConfiguration & {
|
|
264
|
+
authConfig?: AuthConfig;
|
|
265
|
+
authTypeField: string;
|
|
266
|
+
[key: string]: string | AuthConfig | undefined;
|
|
267
|
+
};
|
|
268
|
+
|
|
269
|
+
export function isAuthenticatedDatasourceConfigWithDynamicAuthType(
|
|
270
|
+
dc: DatasourceConfiguration
|
|
271
|
+
): dc is AuthenticatedDatasourceConfigWithDynamicAuthType {
|
|
272
|
+
if (!('authConfig' in dc)) {
|
|
273
|
+
return false;
|
|
274
|
+
}
|
|
275
|
+
if (
|
|
276
|
+
'authTypeField' in dc &&
|
|
277
|
+
dc.authTypeField &&
|
|
278
|
+
dc[dc.authTypeField] !== undefined &&
|
|
279
|
+
dc[dc.authTypeField] !== null &&
|
|
280
|
+
dc[dc.authTypeField] !== ''
|
|
281
|
+
) {
|
|
282
|
+
return true;
|
|
283
|
+
}
|
|
284
|
+
return false;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
/**
|
|
288
|
+
* Safely extracts the authType from an authenticated datasource configuration.
|
|
289
|
+
* This function handles both direct authType fields and authTypeField references.
|
|
290
|
+
*
|
|
291
|
+
* @param dc - The datasource configuration
|
|
292
|
+
* @returns The authType if available, undefined otherwise
|
|
293
|
+
*/
|
|
294
|
+
export function getAuthTypeFromConfig(dc: DatasourceConfiguration): AuthType | undefined {
|
|
295
|
+
if (isAuthenticatedDatasourceConfig(dc)) {
|
|
296
|
+
return dc.authType;
|
|
297
|
+
} else if (isAuthenticatedDatasourceConfigWithDynamicAuthType(dc)) {
|
|
298
|
+
return dc[dc.authTypeField] as AuthType;
|
|
299
|
+
}
|
|
300
|
+
return undefined;
|
|
257
301
|
}
|
|
258
302
|
|
|
259
303
|
export type GraphQLDatasourceConfiguration = AuthenticatedHttpDatasourceConfig & {
|
package/src/types/lock/index.ts
CHANGED
|
@@ -11,3 +11,12 @@ export interface AppBranchLock {
|
|
|
11
11
|
export interface GetAppBranchLockResponseBody {
|
|
12
12
|
appBranchLock: AppBranchLock[];
|
|
13
13
|
}
|
|
14
|
+
|
|
15
|
+
export interface LockInfo {
|
|
16
|
+
isUserActive: boolean;
|
|
17
|
+
ownerEmail: string;
|
|
18
|
+
ownerName: string;
|
|
19
|
+
lockLifetimeMs: number;
|
|
20
|
+
timeSinceLastActivityMs: number | null;
|
|
21
|
+
canForceTakeover: boolean;
|
|
22
|
+
}
|
|
@@ -46,7 +46,8 @@ export enum ExtendedIntegrationPluginId {
|
|
|
46
46
|
OPENAI_V2 = 'openai_v2',
|
|
47
47
|
// Not native OpenAPI-backed integrations, but leveraging the same auth system
|
|
48
48
|
GOOGLE_SHEETS_PLUGIN_ID = 'gsheets',
|
|
49
|
-
SNOWFLAKE = 'snowflake'
|
|
49
|
+
SNOWFLAKE = 'snowflake',
|
|
50
|
+
DATABRICKS = 'databricks'
|
|
50
51
|
}
|
|
51
52
|
|
|
52
53
|
// Note that we cannot import the plugins themselves to reference the id as
|
|
@@ -121,7 +122,8 @@ export const extendsAnyApiIntegrationPlugin = (pluginId = ''): boolean => {
|
|
|
121
122
|
return (
|
|
122
123
|
getBasePluginId(pluginId) === ExtendedIntegrationPluginId.REST_API ||
|
|
123
124
|
pluginId === ExtendedIntegrationPluginId.GRAPHQL ||
|
|
124
|
-
pluginId === ExtendedIntegrationPluginId.SNOWFLAKE
|
|
125
|
+
pluginId === ExtendedIntegrationPluginId.SNOWFLAKE ||
|
|
126
|
+
pluginId === ExtendedIntegrationPluginId.DATABRICKS
|
|
125
127
|
);
|
|
126
128
|
};
|
|
127
129
|
|