lucid-extension-sdk 0.0.303 → 0.0.306
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/commandtypes.d.ts +24 -1
- package/commandtypes.js +6 -1
- package/core/authorizationflowhandlerregistry.d.ts +16 -0
- package/core/authorizationflowhandlerregistry.js +29 -0
- package/core/cardintegration/lucidcardintegration.d.ts +2 -2
- package/core/data/datasource/serializeddatasourceproperties.d.ts +1 -0
- package/core/data/datasource/serializedimporteddatasource.d.ts +2 -0
- package/core/data/datasource/serializedupstreamconfig.d.ts +2 -0
- package/core/data/datasource/serializedupstreamconfig.js +1 -0
- package/core/data/datasource/upstreamconfig.d.ts +1 -0
- package/core/data/datasource/upstreamconfig.js +2 -6
- package/package.json +1 -1
package/commandtypes.d.ts
CHANGED
|
@@ -25,6 +25,7 @@ import { PanelLocation } from './ui/panel';
|
|
|
25
25
|
* Before you add a new command bring it up in #api-committee to get feedback.
|
|
26
26
|
*/
|
|
27
27
|
export declare const enum CommandName {
|
|
28
|
+
AddAuthorizationFlowHandler = "aafh",
|
|
28
29
|
AddCardIntegration = "aci",
|
|
29
30
|
AddDiagramFromMermaid = "adfm",
|
|
30
31
|
AddDiagramFromText = "adft",
|
|
@@ -166,6 +167,10 @@ export declare const commandTitles: Map<CommandName, string>;
|
|
|
166
167
|
* IMPORTANT - Before you add a new command bring it up in #api-committee to get feedback
|
|
167
168
|
*/
|
|
168
169
|
export type CommandArgs = {
|
|
170
|
+
[CommandName.AddAuthorizationFlowHandler]: {
|
|
171
|
+
query: AddAuthorizationFlowHandlerQuery;
|
|
172
|
+
result: AddAuthorizationFlowHandlerResult;
|
|
173
|
+
};
|
|
169
174
|
[CommandName.AddCardIntegration]: {
|
|
170
175
|
query: AddCardIntegrationQuery;
|
|
171
176
|
result: AddCardIntegrationResult;
|
|
@@ -687,6 +692,22 @@ export type CommandArgs = {
|
|
|
687
692
|
result: ZOrderResult;
|
|
688
693
|
};
|
|
689
694
|
};
|
|
695
|
+
export type AuthorizationFlowHandlerProvider = string;
|
|
696
|
+
export declare enum AuthorizationFlowHandlerStage {
|
|
697
|
+
OnFailure = "onFailure"
|
|
698
|
+
}
|
|
699
|
+
export type AddAuthorizationFlowHandlerQuery = {
|
|
700
|
+
/**
|
|
701
|
+
* Specifies the callback function to run when the handler is triggered.
|
|
702
|
+
* String, not a function itself; this is the name of the client's registered action hook
|
|
703
|
+
*/
|
|
704
|
+
'c': string;
|
|
705
|
+
/** The name of the auth provider (as specified in the package's manifest.json) that triggers this handler. */
|
|
706
|
+
'p': AuthorizationFlowHandlerProvider;
|
|
707
|
+
/** The stage during the auth flow when this handler is triggered. */
|
|
708
|
+
's': AuthorizationFlowHandlerStage;
|
|
709
|
+
};
|
|
710
|
+
export type AddAuthorizationFlowHandlerResult = undefined;
|
|
690
711
|
export type AddCardIntegrationQuery = {
|
|
691
712
|
/** Title/name */
|
|
692
713
|
'n': string;
|
|
@@ -709,7 +730,9 @@ export type AddCardIntegrationQuery = {
|
|
|
709
730
|
/** Field name -> callback name tuples for searching for legal field values in an enum */
|
|
710
731
|
'fvsc'?: [string, string][] | undefined;
|
|
711
732
|
};
|
|
712
|
-
/** Show intro if user has not yet authorized this integration
|
|
733
|
+
/** Show intro if user has not yet authorized this integration
|
|
734
|
+
* String, not function; this is the name of the client's registered action hook
|
|
735
|
+
*/
|
|
713
736
|
'i'?: string | undefined;
|
|
714
737
|
/** Get default config action */
|
|
715
738
|
'gdc': string;
|
package/commandtypes.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ZOrderOperation = exports.isRawSendXHRResponse = exports.MermaidDiagramType = exports.GetLLMContextType = exports.GetItemsAtSearchType = exports.GetDocumentChunksType = exports.HashAlgorithmEnum = exports.commandTitles = void 0;
|
|
3
|
+
exports.ZOrderOperation = exports.isRawSendXHRResponse = exports.MermaidDiagramType = exports.GetLLMContextType = exports.GetItemsAtSearchType = exports.GetDocumentChunksType = exports.HashAlgorithmEnum = exports.AuthorizationFlowHandlerStage = exports.commandTitles = void 0;
|
|
4
4
|
const checks_1 = require("./core/checks");
|
|
5
5
|
/** @ignore */
|
|
6
6
|
exports.commandTitles = new Map([
|
|
7
|
+
["aafh" /* CommandName.AddAuthorizationFlowHandler */, 'AddAuthorizationFlowHandler'],
|
|
7
8
|
["aci" /* CommandName.AddCardIntegration */, 'AddCardIntegration'],
|
|
8
9
|
["adfm" /* CommandName.AddDiagramFromMermaid */, 'AddDiagramFromMermaid'],
|
|
9
10
|
["adft" /* CommandName.AddDiagramFromText */, 'AddDiagramFromText'],
|
|
@@ -129,6 +130,10 @@ exports.commandTitles = new Map([
|
|
|
129
130
|
["wsa" /* CommandName.WithSilentActions */, 'WithSilentActions'],
|
|
130
131
|
["z" /* CommandName.ZOrder */, 'ZOrder'],
|
|
131
132
|
]);
|
|
133
|
+
var AuthorizationFlowHandlerStage;
|
|
134
|
+
(function (AuthorizationFlowHandlerStage) {
|
|
135
|
+
AuthorizationFlowHandlerStage["OnFailure"] = "onFailure";
|
|
136
|
+
})(AuthorizationFlowHandlerStage || (exports.AuthorizationFlowHandlerStage = AuthorizationFlowHandlerStage = {}));
|
|
132
137
|
var HashAlgorithmEnum;
|
|
133
138
|
(function (HashAlgorithmEnum) {
|
|
134
139
|
/** Use the SHA 256 hashing algorithm */
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { AuthorizationFlowHandlerProvider, AuthorizationFlowHandlerStage } from '../commandtypes';
|
|
2
|
+
import { EditorClient } from '../editorclient';
|
|
3
|
+
export declare class AuthorizationFlowHandlerRegistry {
|
|
4
|
+
private static nextHookId;
|
|
5
|
+
private static nextHookName;
|
|
6
|
+
/**
|
|
7
|
+
* Register a function to be run at a given stage of the authorization flow for a provider.
|
|
8
|
+
*
|
|
9
|
+
* @param client A reference to the editor client.
|
|
10
|
+
* @param callback The function to run when the handler is triggered.
|
|
11
|
+
* @param stage The stage during the auth flow when this handler is triggered.
|
|
12
|
+
* @param provider The name of the auth provider (as specified in the package's manifest.json)
|
|
13
|
+
* that triggers this handler.
|
|
14
|
+
*/
|
|
15
|
+
static registerAuthorizationFlowHandler(client: EditorClient, callback: () => void, stage: AuthorizationFlowHandlerStage, provider: AuthorizationFlowHandlerProvider): void;
|
|
16
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AuthorizationFlowHandlerRegistry = void 0;
|
|
4
|
+
class AuthorizationFlowHandlerRegistry {
|
|
5
|
+
static nextHookName() {
|
|
6
|
+
return '__authorizationflow__hook' + AuthorizationFlowHandlerRegistry.nextHookId++;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Register a function to be run at a given stage of the authorization flow for a provider.
|
|
10
|
+
*
|
|
11
|
+
* @param client A reference to the editor client.
|
|
12
|
+
* @param callback The function to run when the handler is triggered.
|
|
13
|
+
* @param stage The stage during the auth flow when this handler is triggered.
|
|
14
|
+
* @param provider The name of the auth provider (as specified in the package's manifest.json)
|
|
15
|
+
* that triggers this handler.
|
|
16
|
+
*/
|
|
17
|
+
static registerAuthorizationFlowHandler(client, callback, stage, provider) {
|
|
18
|
+
const actionHookName = AuthorizationFlowHandlerRegistry.nextHookName();
|
|
19
|
+
client.registerAction(actionHookName, callback);
|
|
20
|
+
const serialized = {
|
|
21
|
+
'c': actionHookName,
|
|
22
|
+
's': stage,
|
|
23
|
+
'p': provider,
|
|
24
|
+
};
|
|
25
|
+
client.sendCommand("aafh" /* CommandName.AddAuthorizationFlowHandler */, serialized);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
exports.AuthorizationFlowHandlerRegistry = AuthorizationFlowHandlerRegistry;
|
|
29
|
+
AuthorizationFlowHandlerRegistry.nextHookId = 0;
|
|
@@ -63,8 +63,8 @@ export declare abstract class LucidCardIntegration {
|
|
|
63
63
|
fieldValueSearchCallbacks?: Map<string, string>;
|
|
64
64
|
};
|
|
65
65
|
/**
|
|
66
|
-
*
|
|
67
|
-
*
|
|
66
|
+
* @deprecated Use AuthorizationFlowHandlerRegistry.registerAuthorizationFlowHandler.
|
|
67
|
+
* WARNING: Currently unused and does nothing.
|
|
68
68
|
*/
|
|
69
69
|
showIntro?: () => void;
|
|
70
70
|
/**
|
|
@@ -14,6 +14,7 @@ export declare const isSerializedDataSourceProperties: (subject: unknown) => sub
|
|
|
14
14
|
SourceType: (x: unknown) => x is import("./datasourcetype").DataSourceType;
|
|
15
15
|
UpdateType: (x: unknown) => x is import("./upstreamupdatetype").UpstreamUpdateType;
|
|
16
16
|
PatchType: (x: unknown) => x is import("./upstreampatchtype").UpstreamPatchType | null | undefined;
|
|
17
|
+
IsSyncingPaused: (x: unknown) => x is true | undefined;
|
|
17
18
|
SourceConfig: typeof import("../../checks").isObject;
|
|
18
19
|
}> | null | undefined;
|
|
19
20
|
SourceForeignKeys: (x: unknown) => x is import("../../guards").DestructureGuardedTypeObj<{
|
|
@@ -53,6 +53,7 @@ export declare const isSerializedImportedDataSource: (subject: unknown) => subje
|
|
|
53
53
|
SourceType: (x: unknown) => x is import("./datasourcetype").DataSourceType;
|
|
54
54
|
UpdateType: (x: unknown) => x is import("./upstreamupdatetype").UpstreamUpdateType;
|
|
55
55
|
PatchType: (x: unknown) => x is import("./upstreampatchtype").UpstreamPatchType | null | undefined;
|
|
56
|
+
IsSyncingPaused: (x: unknown) => x is true | undefined;
|
|
56
57
|
SourceConfig: typeof isObject;
|
|
57
58
|
}> | null | undefined;
|
|
58
59
|
SourceForeignKeys: (x: unknown) => x is import("../../guards").DestructureGuardedTypeObj<{
|
|
@@ -89,6 +90,7 @@ export declare const isSerializedPreviewData: (subject: unknown) => subject is i
|
|
|
89
90
|
SourceType: (x: unknown) => x is import("./datasourcetype").DataSourceType;
|
|
90
91
|
UpdateType: (x: unknown) => x is import("./upstreamupdatetype").UpstreamUpdateType;
|
|
91
92
|
PatchType: (x: unknown) => x is import("./upstreampatchtype").UpstreamPatchType | null | undefined;
|
|
93
|
+
IsSyncingPaused: (x: unknown) => x is true | undefined;
|
|
92
94
|
SourceConfig: typeof isObject;
|
|
93
95
|
}> | null | undefined;
|
|
94
96
|
SourceForeignKeys: (x: unknown) => x is import("../../guards").DestructureGuardedTypeObj<{
|
|
@@ -7,6 +7,7 @@ export interface SerializedUpstreamConfig {
|
|
|
7
7
|
'SourceType': DataSourceType;
|
|
8
8
|
'UpdateType': UpstreamUpdateType;
|
|
9
9
|
'PatchType'?: UpstreamPatchType | null | undefined;
|
|
10
|
+
'IsSyncingPaused'?: true | undefined;
|
|
10
11
|
'SourceConfig': {
|
|
11
12
|
[index: string]: any;
|
|
12
13
|
};
|
|
@@ -16,5 +17,6 @@ export declare const isSerializedUpstreamConfig: (subject: unknown) => subject i
|
|
|
16
17
|
SourceType: (x: unknown) => x is DataSourceType;
|
|
17
18
|
UpdateType: (x: unknown) => x is UpstreamUpdateType;
|
|
18
19
|
PatchType: (x: unknown) => x is UpstreamPatchType | null | undefined;
|
|
20
|
+
IsSyncingPaused: (x: unknown) => x is true | undefined;
|
|
19
21
|
SourceConfig: typeof isObject;
|
|
20
22
|
}>;
|
|
@@ -11,5 +11,6 @@ exports.isSerializedUpstreamConfig = (0, validators_1.strictObjectValidator)({
|
|
|
11
11
|
'SourceType': (0, validators_1.enumValidator)(datasourcetype_1.DataSourceType),
|
|
12
12
|
'UpdateType': (0, validators_1.enumValidator)(upstreamupdatetype_1.UpstreamUpdateType),
|
|
13
13
|
'PatchType': (0, validators_1.nullableOption)((0, validators_1.enumValidator)(upstreampatchtype_1.UpstreamPatchType)),
|
|
14
|
+
'IsSyncingPaused': (0, validators_1.option)((0, checks_1.isLiteral)(true)),
|
|
14
15
|
'SourceConfig': checks_1.isObject,
|
|
15
16
|
});
|
|
@@ -7,17 +7,13 @@ function serializeUpstreamConfig(config) {
|
|
|
7
7
|
'SourceType': config.dataSourceType,
|
|
8
8
|
'UpdateType': config.updateType,
|
|
9
9
|
'PatchType': config.patchType,
|
|
10
|
+
'IsSyncingPaused': config.isSyncingPaused,
|
|
10
11
|
'SourceConfig': config.sourceConfig,
|
|
11
12
|
};
|
|
12
13
|
}
|
|
13
14
|
exports.serializeUpstreamConfig = serializeUpstreamConfig;
|
|
14
15
|
function deserializeUpstreamConfig(config) {
|
|
15
|
-
return {
|
|
16
|
-
dataSourceType: config['SourceType'],
|
|
17
|
-
updateType: config['UpdateType'],
|
|
18
|
-
patchType: config['PatchType'] === null ? undefined : config['PatchType'],
|
|
19
|
-
sourceConfig: config['SourceConfig'],
|
|
20
|
-
};
|
|
16
|
+
return Object.assign(Object.assign({ dataSourceType: config['SourceType'], updateType: config['UpdateType'], patchType: config['PatchType'] === null ? undefined : config['PatchType'] }, (config['IsSyncingPaused'] && { isSyncingPaused: true })), { sourceConfig: config['SourceConfig'] });
|
|
21
17
|
}
|
|
22
18
|
exports.deserializeUpstreamConfig = deserializeUpstreamConfig;
|
|
23
19
|
function isSerializedSourceConfig(x) {
|