lucid-extension-sdk 0.0.112 → 0.0.113
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/package.json +1 -1
- package/sdk/commandtypes.d.ts +13 -0
- package/sdk/commandtypes.js +1 -0
- package/sdk/editorclient.d.ts +2 -1
- package/sdk/editorclient.js +5 -0
package/package.json
CHANGED
package/sdk/commandtypes.d.ts
CHANGED
|
@@ -103,6 +103,7 @@ export declare const enum CommandName {
|
|
|
103
103
|
StartDragBlockToCanvas = "sdc",
|
|
104
104
|
StartPDFUploadRequest = "pdf",
|
|
105
105
|
ThrowForTestCase = "throw",
|
|
106
|
+
TriggerAuthFlow = "tauth",
|
|
106
107
|
UnhookCreateItems = "uci",
|
|
107
108
|
UnhookDeleteItems = "udi",
|
|
108
109
|
UnhookSelection = "us",
|
|
@@ -452,6 +453,10 @@ export declare type CommandArgs = {
|
|
|
452
453
|
query: ThrowForTestCaseQuery;
|
|
453
454
|
result: ThrowForTestCaseResult;
|
|
454
455
|
};
|
|
456
|
+
[CommandName.TriggerAuthFlow]: {
|
|
457
|
+
query: TriggerAuthFlowQuery;
|
|
458
|
+
result: TriggerAuthFlowResult;
|
|
459
|
+
};
|
|
455
460
|
[CommandName.UnhookCreateItems]: {
|
|
456
461
|
query: UnhookCreateItemsQuery;
|
|
457
462
|
result: UnhookCreateItemsResult;
|
|
@@ -1108,6 +1113,14 @@ export declare type StartPDFUploadRequestQuery = string;
|
|
|
1108
1113
|
export declare type StartPDFUploadRequestResponse = Promise<string>;
|
|
1109
1114
|
export declare type ThrowForTestCaseQuery = number;
|
|
1110
1115
|
export declare type ThrowForTestCaseResult = undefined | Promise<void>;
|
|
1116
|
+
export declare type TriggerAuthFlowQuery = {
|
|
1117
|
+
/** OAuth or merge provider name as specified in the package manifest */
|
|
1118
|
+
'p': string;
|
|
1119
|
+
};
|
|
1120
|
+
export declare type TriggerAuthFlowResult = Promise<RawTriggerAuthFlowResult>;
|
|
1121
|
+
export declare type RawTriggerAuthFlowResult = {
|
|
1122
|
+
's': boolean;
|
|
1123
|
+
};
|
|
1111
1124
|
export declare type UnhookCreateItemsQuery = {
|
|
1112
1125
|
/** Name of the action passed to HookCreateItems */
|
|
1113
1126
|
'n': string;
|
package/sdk/commandtypes.js
CHANGED
|
@@ -84,6 +84,7 @@ exports.commandTitles = new Map([
|
|
|
84
84
|
["sdc" /* CommandName.StartDragBlockToCanvas */, 'StartDragBlockToCanvas'],
|
|
85
85
|
["pdf" /* CommandName.StartPDFUploadRequest */, 'StartPDFUploadRequest'],
|
|
86
86
|
["throw" /* CommandName.ThrowForTestCase */, 'ThrowForTestCase'],
|
|
87
|
+
["tauth" /* CommandName.TriggerAuthFlow */, 'TriggerAuthFlow'],
|
|
87
88
|
["uci" /* CommandName.UnhookCreateItems */, 'UnhookCreateItems'],
|
|
88
89
|
["udi" /* CommandName.UnhookDeleteItems */, 'UnhookDeleteItems'],
|
|
89
90
|
["us" /* CommandName.UnhookSelection */, 'UnhookSelection'],
|
package/sdk/editorclient.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CommandArgs, CommandName, UnionToIntersection } from './commandtypes';
|
|
1
|
+
import { CommandArgs, CommandName, TriggerAuthFlowResult, UnionToIntersection } from './commandtypes';
|
|
2
2
|
import { JsonSerializable } from './core/jsonserializable';
|
|
3
3
|
import { UnfurlCallbacks } from './core/unfurl/unfurlcallbacks';
|
|
4
4
|
import { BinaryXHRResponse, OAuthXHRRequest, TextXHRResponse, XHRRequest, XHRResponse } from './core/xhr';
|
|
@@ -115,6 +115,7 @@ export declare class EditorClient {
|
|
|
115
115
|
responseFormat: 'binary';
|
|
116
116
|
}): Promise<BinaryXHRResponse>;
|
|
117
117
|
oauthXhr(providerName: string, request: OAuthXHRRequest): Promise<XHRResponse>;
|
|
118
|
+
triggerAuthFlow(providerName: string): TriggerAuthFlowResult;
|
|
118
119
|
/**
|
|
119
120
|
* Make a request with a permanent token like a merge account token or API key.
|
|
120
121
|
* @param providerName The name of the authorization provider from the manifest
|
package/sdk/editorclient.js
CHANGED
|
@@ -195,6 +195,11 @@ class EditorClient {
|
|
|
195
195
|
throw parseRawXHRResponse(responseFormat, raw);
|
|
196
196
|
});
|
|
197
197
|
}
|
|
198
|
+
triggerAuthFlow(providerName) {
|
|
199
|
+
return this.sendCommand("tauth" /* CommandName.TriggerAuthFlow */, {
|
|
200
|
+
'p': providerName,
|
|
201
|
+
});
|
|
202
|
+
}
|
|
198
203
|
permanentTokenXhr(providerName, request) {
|
|
199
204
|
const responseFormat = request.responseFormat || 'utf8';
|
|
200
205
|
return this.sendCommand("perm" /* CommandName.SendPermanentTokenRequest */, {
|