lucid-extension-sdk 0.0.54 → 0.0.56

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lucid-extension-sdk",
3
- "version": "0.0.54",
3
+ "version": "0.0.56",
4
4
  "description": "Utility classes for writing Lucid Software editor extensions",
5
5
  "main": "sdk/index.js",
6
6
  "types": "sdk/index.d.ts",
@@ -90,6 +90,7 @@ export declare const enum CommandName {
90
90
  ShowPanel = "spn",
91
91
  SleepForTestCase = "sleep",
92
92
  StartDragBlockToCanvas = "sdc",
93
+ StartPDFUploadRequest = "pdf",
93
94
  ThrowForTestCase = "throw",
94
95
  UnhookCreateItems = "uci",
95
96
  UnhookSelection = "us",
@@ -395,6 +396,10 @@ export declare type CommandArgs = {
395
396
  query: StartDragBlockToCanvasQuery;
396
397
  result: StartDragBlockToCanvasResult;
397
398
  };
399
+ [CommandName.StartPDFUploadRequest]: {
400
+ query: StartPDFUploadRequestQuery;
401
+ result: StartPDFUploadRequestResponse;
402
+ };
398
403
  [CommandName.ThrowForTestCase]: {
399
404
  query: ThrowForTestCaseQuery;
400
405
  result: ThrowForTestCaseResult;
@@ -993,6 +998,13 @@ export declare type StartDragBlockToCanvasQuery = {
993
998
  's'?: JsonSerializable | undefined;
994
999
  };
995
1000
  export declare type StartDragBlockToCanvasResult = Promise<string | undefined>;
1001
+ export declare type StartPDFUploadRequestQuery = string;
1002
+ /**
1003
+ * @ignore
1004
+ * A signed URL you can upload the pdf to. You can do this manually (via the client, your own service) or via the
1005
+ * oauth proxy.
1006
+ */
1007
+ export declare type StartPDFUploadRequestResponse = Promise<string>;
996
1008
  export declare type ThrowForTestCaseQuery = number;
997
1009
  export declare type ThrowForTestCaseResult = undefined | Promise<void>;
998
1010
  export declare type UnhookCreateItemsQuery = {
@@ -74,6 +74,7 @@ exports.commandTitles = new Map([
74
74
  ["spn" /* CommandName.ShowPanel */, 'ShowPanel'],
75
75
  ["sleep" /* CommandName.SleepForTestCase */, 'SleepForTestCase'],
76
76
  ["sdc" /* CommandName.StartDragBlockToCanvas */, 'StartDragBlockToCanvas'],
77
+ ["pdf" /* CommandName.StartPDFUploadRequest */, 'StartPDFUploadRequest'],
77
78
  ["throw" /* CommandName.ThrowForTestCase */, 'ThrowForTestCase'],
78
79
  ["uci" /* CommandName.UnhookCreateItems */, 'UnhookCreateItems'],
79
80
  ["us" /* CommandName.UnhookSelection */, 'UnhookSelection'],
@@ -4,7 +4,7 @@ import { LiteralFieldType, SerializedLiteralFieldType } from './literalfieldtype
4
4
  import { NDimensionalFieldTypeArray, SerializedNDimensionalFieldTypeArray } from './ndimensionalfieldtypearray';
5
5
  import { ScalarFieldTypeEnum } from './scalarfieldtype';
6
6
  export declare type AnyFieldTypeArrayDefinition = FieldTypeArray | NDimensionalFieldTypeArray;
7
- export declare type BaseFieldTypeDefinition = ScalarFieldTypeEnum | LiteralFieldType | FieldTypeArray | NDimensionalFieldTypeArray | CollectionEnumFieldType;
7
+ export declare type BaseFieldTypeDefinition = ScalarFieldTypeEnum | LiteralFieldType | FieldTypeArray<any> | NDimensionalFieldTypeArray | CollectionEnumFieldType;
8
8
  export declare type SerializedBaseFieldTypeDefinition = ScalarFieldTypeEnum | SerializedLiteralFieldType | SerializedFieldTypeArray | SerializedNDimensionalFieldTypeArray | SerializedCollectionEnumFieldType;
9
9
  export declare function isBaseFieldTypeDefinition(fieldType: any): fieldType is BaseFieldTypeDefinition;
10
10
  export declare function serializeBaseFieldTypeDefinition(baseFieldType: BaseFieldTypeDefinition): SerializedBaseFieldTypeDefinition;
@@ -9,9 +9,9 @@ export declare abstract class BaseFieldTypeArray<Type> {
9
9
  getInnerNonArrayTypes(): Exclude<Type, BaseFieldTypeArray<Type>>[];
10
10
  serialize(): SerializedFieldTypeArray;
11
11
  }
12
- export declare type FieldTypeArraySubTypes = ScalarFieldTypeEnum | CollectionEnumFieldType | LiteralFieldType | FieldTypeArray;
12
+ export declare type FieldTypeArraySubTypes = ScalarFieldTypeEnum | CollectionEnumFieldType | LiteralFieldType | FieldTypeArray<any>;
13
13
  export declare type SerializedFieldTypeArraySubTypes = ScalarFieldTypeEnum | SerializedLiteralFieldType | SerializedFieldTypeArray | SerializedCollectionEnumFieldType;
14
- export declare class FieldTypeArray extends BaseFieldTypeArray<FieldTypeArraySubTypes> {
14
+ export declare class FieldTypeArray<SubTypes extends FieldTypeArraySubTypes = FieldTypeArraySubTypes> extends BaseFieldTypeArray<SubTypes> {
15
15
  protected serializeType(t: FieldTypeArraySubTypes): string | SerializedCollectionEnumFieldType | ScalarFieldTypeEnum | SerializedFieldTypeArray;
16
16
  }
17
17
  export declare type SerializedFieldTypeArray = {
@@ -1,3 +1,4 @@
1
+ import { StartPDFUploadRequestResponse } from '../../commandtypes';
1
2
  import { UnfurlIframe } from '../../core/unfurl/unfurliframe';
2
3
  import { BlockProxy } from '../blockproxy';
3
4
  /**
@@ -50,7 +51,7 @@ export declare class ExperimentalLinkUnfurlBlockProxy extends BlockProxy {
50
51
  * The PDF uploaded at that url will be assocaite with this block (and any copy of it) in the editor until it is refreshed.
51
52
  * @param options The options for the upload
52
53
  */
53
- experimentalStartPDFUpload(options: LinkUnfurlPDFOptions): Promise<LinkUnfurlPDFResult>;
54
+ experimentalStartPDFUpload(options: LinkUnfurlPDFOptions): Promise<StartPDFUploadRequestResponse>;
54
55
  }
55
56
  /**
56
57
  * @ignore
@@ -64,21 +65,3 @@ export interface LinkUnfurlPDFOptions {
64
65
  */
65
66
  expectedNumberOfPages: number;
66
67
  }
67
- /**
68
- * @ignore
69
- * The result of initiating the PDF upload process.
70
- */
71
- export interface LinkUnfurlPDFResult {
72
- /**
73
- * @ignore
74
- * A signed URL you can upload the pdf to. You can do this manually (via the client, your own service) or via the
75
- * oauth proxy.
76
- */
77
- uploadUrl: string;
78
- /**
79
- * @ignore
80
- * The internal identifier to the PDF upload which is associated with the block.
81
- * TODO: Determine if we show this to the extension, or keep internal
82
- */
83
- blobId: string;
84
- }
@@ -73,8 +73,9 @@ class ExperimentalLinkUnfurlBlockProxy extends blockproxy_1.BlockProxy {
73
73
  * The PDF uploaded at that url will be assocaite with this block (and any copy of it) in the editor until it is refreshed.
74
74
  * @param options The options for the upload
75
75
  */
76
- experimentalStartPDFUpload(options) {
77
- throw new Error('Not yet implemented');
76
+ async experimentalStartPDFUpload(options) {
77
+ const result = await this.client.sendCommand("pdf" /* CommandName.StartPDFUploadRequest */, this.id);
78
+ return result;
78
79
  }
79
80
  }
80
81
  exports.ExperimentalLinkUnfurlBlockProxy = ExperimentalLinkUnfurlBlockProxy;