lucid-extension-sdk 0.0.175 → 0.0.177
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
CHANGED
|
@@ -60,6 +60,7 @@ export declare const enum CommandName {
|
|
|
60
60
|
GetElementType = "get",
|
|
61
61
|
GetItemPageId = "gip",
|
|
62
62
|
GetItemsAt = "gia",
|
|
63
|
+
GetOAuthToken = "got",
|
|
63
64
|
GetPackageSettings = "gps",
|
|
64
65
|
GetProduct = "gpr",
|
|
65
66
|
GetProperty = "gp",
|
|
@@ -298,6 +299,10 @@ export type CommandArgs = {
|
|
|
298
299
|
query: GetItemsAtQuery;
|
|
299
300
|
result: GetItemsAtResult;
|
|
300
301
|
};
|
|
302
|
+
[CommandName.GetOAuthToken]: {
|
|
303
|
+
query: GetOAuthTokenQuery;
|
|
304
|
+
result: GetOAuthTokenResult;
|
|
305
|
+
};
|
|
301
306
|
[CommandName.GetPackageSettings]: {
|
|
302
307
|
query: GetPackageSettingsQuery;
|
|
303
308
|
result: GetPackageSettingsResult;
|
|
@@ -964,6 +969,11 @@ export type GetReferenceKeyQuery = {
|
|
|
964
969
|
'k': number | string;
|
|
965
970
|
};
|
|
966
971
|
export type GetReferenceKeyResult = SerializedReferenceKeyType;
|
|
972
|
+
export type GetOAuthTokenQuery = {
|
|
973
|
+
/** OAuth provider name as specified in the package manifest */
|
|
974
|
+
'p': string;
|
|
975
|
+
};
|
|
976
|
+
export type GetOAuthTokenResult = Promise<string | undefined>;
|
|
967
977
|
export type GetProductQuery = undefined;
|
|
968
978
|
export type GetProductResult = LucidProduct;
|
|
969
979
|
export type GetPropertyQuery = {
|
package/commandtypes.js
CHANGED
|
@@ -41,6 +41,7 @@ exports.commandTitles = new Map([
|
|
|
41
41
|
["get" /* CommandName.GetElementType */, 'GetElementType'],
|
|
42
42
|
["gip" /* CommandName.GetItemPageId */, 'GetItemPageId'],
|
|
43
43
|
["gia" /* CommandName.GetItemsAt */, 'GetItemsAt'],
|
|
44
|
+
["got" /* CommandName.GetOAuthToken */, 'GetOAuthToken'],
|
|
44
45
|
["gps" /* CommandName.GetPackageSettings */, 'GetPackageSettings'],
|
|
45
46
|
["gpr" /* CommandName.GetProduct */, 'GetProduct'],
|
|
46
47
|
["gp" /* CommandName.GetProperty */, 'GetProperty'],
|
|
@@ -10,13 +10,13 @@ export interface SerializedReferenceKey {
|
|
|
10
10
|
'f'?: {
|
|
11
11
|
'ts': number;
|
|
12
12
|
'pd': TypedSerializedFlattenedReference;
|
|
13
|
-
'md'?: SerializedFields;
|
|
14
|
-
'e'?: string;
|
|
13
|
+
'md'?: SerializedFields | undefined;
|
|
14
|
+
'e'?: string | undefined;
|
|
15
15
|
} | undefined;
|
|
16
16
|
}
|
|
17
17
|
export type TypedSerializedFlattenedReference = {
|
|
18
18
|
'sc': SerializedSchema;
|
|
19
|
-
'n'?: string;
|
|
19
|
+
'n'?: string | undefined;
|
|
20
20
|
'd': {
|
|
21
21
|
[index: string]: SerializedFieldType;
|
|
22
22
|
};
|
package/editorclient.d.ts
CHANGED
|
@@ -138,6 +138,13 @@ export declare class EditorClient {
|
|
|
138
138
|
}): Promise<BinaryXHRResponse>;
|
|
139
139
|
oauthXhr(providerName: string, request: OAuthXHRRequest): Promise<XHRResponse>;
|
|
140
140
|
triggerAuthFlow(providerName: string): TriggerAuthFlowResult;
|
|
141
|
+
/**
|
|
142
|
+
* Fetch the OAuth token if there is one
|
|
143
|
+
*
|
|
144
|
+
* @param providerName Name of the OAuth provider
|
|
145
|
+
* @returns An oauth token or undefined if it doesn't exist
|
|
146
|
+
*/
|
|
147
|
+
getOAuthToken(providerName: string): Promise<string | undefined>;
|
|
141
148
|
/**
|
|
142
149
|
* Make a request with a permanent token like a merge account token or API key.
|
|
143
150
|
* @param providerName The name of the authorization provider from the manifest
|
package/editorclient.js
CHANGED
|
@@ -206,6 +206,15 @@ class EditorClient {
|
|
|
206
206
|
'p': providerName,
|
|
207
207
|
});
|
|
208
208
|
}
|
|
209
|
+
/**
|
|
210
|
+
* Fetch the OAuth token if there is one
|
|
211
|
+
*
|
|
212
|
+
* @param providerName Name of the OAuth provider
|
|
213
|
+
* @returns An oauth token or undefined if it doesn't exist
|
|
214
|
+
*/
|
|
215
|
+
async getOAuthToken(providerName) {
|
|
216
|
+
return await this.sendCommand("got" /* CommandName.GetOAuthToken */, { 'p': providerName });
|
|
217
|
+
}
|
|
209
218
|
permanentTokenXhr(providerName, request) {
|
|
210
219
|
const responseFormat = request.responseFormat || 'utf8';
|
|
211
220
|
return this.sendCommand("perm" /* CommandName.SendPermanentTokenRequest */, {
|