@corsair-dev/studio 0.1.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/LICENSE +191 -0
- package/dist/server/index.js +1339 -0
- package/dist/src/server/dev-entry.d.ts +2 -0
- package/dist/src/server/dev-entry.d.ts.map +1 -0
- package/dist/src/server/handlers/auth.d.ts +4 -0
- package/dist/src/server/handlers/auth.d.ts.map +1 -0
- package/dist/src/server/handlers/credentials-internal.d.ts +21 -0
- package/dist/src/server/handlers/credentials-internal.d.ts.map +1 -0
- package/dist/src/server/handlers/credentials.d.ts +4 -0
- package/dist/src/server/handlers/credentials.d.ts.map +1 -0
- package/dist/src/server/handlers/db.d.ts +6 -0
- package/dist/src/server/handlers/db.d.ts.map +1 -0
- package/dist/src/server/handlers/operations.d.ts +6 -0
- package/dist/src/server/handlers/operations.d.ts.map +1 -0
- package/dist/src/server/handlers/plugin-setup.d.ts +3 -0
- package/dist/src/server/handlers/plugin-setup.d.ts.map +1 -0
- package/dist/src/server/handlers/plugins.d.ts +3 -0
- package/dist/src/server/handlers/plugins.d.ts.map +1 -0
- package/dist/src/server/handlers/status.d.ts +3 -0
- package/dist/src/server/handlers/status.d.ts.map +1 -0
- package/dist/src/server/handlers/tenants.d.ts +4 -0
- package/dist/src/server/handlers/tenants.d.ts.map +1 -0
- package/dist/src/server/index.d.ts +22 -0
- package/dist/src/server/index.d.ts.map +1 -0
- package/dist/src/server/load.d.ts +5 -0
- package/dist/src/server/load.d.ts.map +1 -0
- package/dist/src/server/router.d.ts +5 -0
- package/dist/src/server/router.d.ts.map +1 -0
- package/dist/src/server/serve-static.d.ts +3 -0
- package/dist/src/server/serve-static.d.ts.map +1 -0
- package/dist/src/server/types.d.ts +21 -0
- package/dist/src/server/types.d.ts.map +1 -0
- package/dist/web/assets/index-BdMocr9R.js +52 -0
- package/dist/web/assets/index-BdMocr9R.js.map +1 -0
- package/dist/web/assets/index-D8r6TgYt.css +1 -0
- package/dist/web/index.html +14 -0
- package/package.json +45 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dev-entry.d.ts","sourceRoot":"","sources":["../../../src/server/dev-entry.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../../src/server/handlers/auth.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAmK1C,eAAO,MAAM,UAAU,EAAE,SAgHxB,CAAC;AAiBF,eAAO,MAAM,aAAa,EAAE,SAgE3B,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { AuthTypes, CorsairPlugin } from 'corsair/core';
|
|
2
|
+
export type FieldStatus = {
|
|
3
|
+
name: string;
|
|
4
|
+
level: 'integration' | 'account';
|
|
5
|
+
set: boolean;
|
|
6
|
+
};
|
|
7
|
+
export declare function getCustomFields(plugin: CorsairPlugin, authType: AuthTypes): {
|
|
8
|
+
integration: readonly string[];
|
|
9
|
+
account: readonly string[];
|
|
10
|
+
};
|
|
11
|
+
export declare function getAuthFieldStatus(opts: {
|
|
12
|
+
authType: AuthTypes | undefined;
|
|
13
|
+
extraIntegration: readonly string[];
|
|
14
|
+
extraAccount: readonly string[];
|
|
15
|
+
integrationNamespace: Record<string, unknown> | null;
|
|
16
|
+
accountNamespace: Record<string, unknown> | null;
|
|
17
|
+
includeIntegration?: boolean;
|
|
18
|
+
includeAccount?: boolean;
|
|
19
|
+
}): Promise<FieldStatus[]>;
|
|
20
|
+
export declare function maskValue(value: string | null): string | null;
|
|
21
|
+
//# sourceMappingURL=credentials-internal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"credentials-internal.d.ts","sourceRoot":"","sources":["../../../../src/server/handlers/credentials-internal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAoB,MAAM,cAAc,CAAC;AAc/E,MAAM,MAAM,WAAW,GAAG;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,aAAa,GAAG,SAAS,CAAC;IACjC,GAAG,EAAE,OAAO,CAAC;CACb,CAAC;AAEF,wBAAgB,eAAe,CAC9B,MAAM,EAAE,aAAa,EACrB,QAAQ,EAAE,SAAS,GACjB;IAAE,WAAW,EAAE,SAAS,MAAM,EAAE,CAAC;IAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,CAOhE;AAED,wBAAsB,kBAAkB,CAAC,IAAI,EAAE;IAC9C,QAAQ,EAAE,SAAS,GAAG,SAAS,CAAC;IAChC,gBAAgB,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,YAAY,EAAE,SAAS,MAAM,EAAE,CAAC;IAChC,oBAAoB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IACrD,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IACjD,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,cAAc,CAAC,EAAE,OAAO,CAAC;CACzB,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC,CAmCzB;AAYD,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,GAAG,IAAI,CAK7D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"credentials.d.ts","sourceRoot":"","sources":["../../../../src/server/handlers/credentials.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAuB1C,eAAO,MAAM,cAAc,EAAE,SAuE5B,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,SAmE5B,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { HandlerFn } from '../types';
|
|
2
|
+
export declare const listDbTables: HandlerFn;
|
|
3
|
+
export declare const listDbRows: HandlerFn;
|
|
4
|
+
export declare const queryEntityData: HandlerFn;
|
|
5
|
+
export declare const listPermissions: HandlerFn;
|
|
6
|
+
//# sourceMappingURL=db.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"db.d.ts","sourceRoot":"","sources":["../../../../src/server/handlers/db.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AA0C1C,eAAO,MAAM,YAAY,EAAE,SAc1B,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,SA2BxB,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,SAgH7B,CAAC;AAqDF,eAAO,MAAM,eAAe,EAAE,SAsB7B,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { HandlerFn } from '../types';
|
|
2
|
+
export declare const listOperations: HandlerFn;
|
|
3
|
+
export declare const schemaForOperation: HandlerFn;
|
|
4
|
+
export declare const runOperation: HandlerFn;
|
|
5
|
+
export declare const runScript: HandlerFn;
|
|
6
|
+
//# sourceMappingURL=operations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operations.d.ts","sourceRoot":"","sources":["../../../../src/server/handlers/operations.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAiB1C,eAAO,MAAM,cAAc,EAAE,SAc5B,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,SAYhC,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,SA6B1B,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,SA+BvB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-setup.d.ts","sourceRoot":"","sources":["../../../../src/server/handlers/plugin-setup.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAgE1C,eAAO,MAAM,WAAW,EAAE,SAuGzB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugins.d.ts","sourceRoot":"","sources":["../../../../src/server/handlers/plugins.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAyB1C,eAAO,MAAM,WAAW,EAAE,SAoEzB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../../../src/server/handlers/status.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAE1C,eAAO,MAAM,SAAS,EAAE,SAQvB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tenants.d.ts","sourceRoot":"","sources":["../../../../src/server/handlers/tenants.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AA8D1C,eAAO,MAAM,WAAW,EAAE,SAgBzB,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,SA4G1B,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export type StartStudioOptions = {
|
|
2
|
+
/** Project root that contains the user's corsair.ts. Defaults to process.cwd(). */
|
|
3
|
+
cwd?: string;
|
|
4
|
+
/** Port to listen on. Defaults to 4317. */
|
|
5
|
+
port?: number;
|
|
6
|
+
/** Hostname to bind to. Defaults to 127.0.0.1. */
|
|
7
|
+
host?: string;
|
|
8
|
+
/** Open the studio URL in the default browser. Defaults to true. */
|
|
9
|
+
open?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Optional path to built static assets. If not provided, assets are resolved
|
|
12
|
+
* relative to this module (dist/web when installed, dist/web when built locally).
|
|
13
|
+
*/
|
|
14
|
+
webRoot?: string;
|
|
15
|
+
};
|
|
16
|
+
export declare function startStudio(options?: StartStudioOptions): Promise<{
|
|
17
|
+
port: number;
|
|
18
|
+
url: string;
|
|
19
|
+
close: () => Promise<void>;
|
|
20
|
+
}>;
|
|
21
|
+
export { startStudio as start };
|
|
22
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/server/index.ts"],"names":[],"mappings":"AASA,MAAM,MAAM,kBAAkB,GAAG;IAChC,mFAAmF;IACnF,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,2CAA2C;IAC3C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,kDAAkD;IAClD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,oEAAoE;IACpE,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,wBAAsB,WAAW,CAAC,OAAO,GAAE,kBAAuB,GAAG,OAAO,CAAC;IAC5E,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC3B,CAAC,CA2JD;AAYD,OAAO,EAAE,WAAW,IAAI,KAAK,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"load.d.ts","sourceRoot":"","sources":["../../../src/server/load.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAU7C,wBAAgB,WAAW,CAC1B,GAAG,EAAE,MAAM,EACX,OAAO,GAAE;IAAE,KAAK,CAAC,EAAE,OAAO,CAAA;CAAO,GAC/B,OAAO,CAAC,aAAa,CAAC,CA2CxB"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { IncomingMessage, ServerResponse } from 'node:http';
|
|
2
|
+
import type { HandlerCtx } from './types';
|
|
3
|
+
export declare function handleApi(req: IncomingMessage, res: ServerResponse, baseCtx: Omit<HandlerCtx, 'req' | 'res' | 'url'>): Promise<void>;
|
|
4
|
+
export declare function readJsonBody(req: IncomingMessage): Promise<Record<string, unknown>>;
|
|
5
|
+
//# sourceMappingURL=router.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../../src/server/router.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAmBjE,OAAO,KAAK,EAAE,UAAU,EAAa,MAAM,SAAS,CAAC;AAoCrD,wBAAsB,SAAS,CAC9B,GAAG,EAAE,eAAe,EACpB,GAAG,EAAE,cAAc,EACnB,OAAO,EAAE,IAAI,CAAC,UAAU,EAAE,KAAK,GAAG,KAAK,GAAG,KAAK,CAAC,GAC9C,OAAO,CAAC,IAAI,CAAC,CA6Bf;AAED,wBAAsB,YAAY,CACjC,GAAG,EAAE,eAAe,GAClB,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAoBlC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serve-static.d.ts","sourceRoot":"","sources":["../../../src/server/serve-static.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAgCjE,wBAAgB,kBAAkB,CAAC,OAAO,CAAC,EAAE,MAAM,IAIjD,KAAK,eAAe,EACpB,KAAK,cAAc,KACjB,OAAO,CAsCV"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { IncomingMessage, ServerResponse } from 'node:http';
|
|
2
|
+
import type { CorsairInternalConfig } from 'corsair/core';
|
|
3
|
+
export type HandlerCtx = {
|
|
4
|
+
req: IncomingMessage;
|
|
5
|
+
res: ServerResponse;
|
|
6
|
+
url: URL;
|
|
7
|
+
cwd: string;
|
|
8
|
+
getCorsair: () => Promise<CorsairHandle>;
|
|
9
|
+
};
|
|
10
|
+
export type CorsairHandle = {
|
|
11
|
+
instance: unknown;
|
|
12
|
+
internal: CorsairInternalConfig;
|
|
13
|
+
/**
|
|
14
|
+
* Returns a concrete single-tenant client (the target of API calls).
|
|
15
|
+
* If the instance is multi-tenant, uses the provided tenantId.
|
|
16
|
+
*/
|
|
17
|
+
resolveClient: (tenantId?: string) => Record<string, unknown>;
|
|
18
|
+
};
|
|
19
|
+
/** Handlers return JSON-serializable data; the router stringifies it for the response. */
|
|
20
|
+
export type HandlerFn = (ctx: HandlerCtx) => Promise<unknown>;
|
|
21
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/server/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AACjE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAE1D,MAAM,MAAM,UAAU,GAAG;IACxB,GAAG,EAAE,eAAe,CAAC;IACrB,GAAG,EAAE,cAAc,CAAC;IACpB,GAAG,EAAE,GAAG,CAAC;IACT,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,EAAE,MAAM,OAAO,CAAC,aAAa,CAAC,CAAC;CACzC,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC3B,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,qBAAqB,CAAC;IAChC;;;OAGG;IACH,aAAa,EAAE,CAAC,QAAQ,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC9D,CAAC;AAEF,0FAA0F;AAC1F,MAAM,MAAM,SAAS,GAAG,CAAC,GAAG,EAAE,UAAU,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC"}
|