lucid-extension-sdk 0.0.178 → 0.0.180

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
@@ -6,6 +6,7 @@ import { LucidProduct } from './core/lucidproduct';
6
6
  import { LinearOffsetType } from './core/offsettype';
7
7
  import { SerializedDataError } from './core/serializeddataerror';
8
8
  import { ShapeDataInheritance } from './core/shapedatainheritance';
9
+ import { DocumentAccessPermission } from './document/documentaccesspermission';
9
10
  import { DocumentElementType } from './document/documentelement/documentelementtype';
10
11
  import { SerializedLineTextAreaPositioning } from './document/linetextareapositioning';
11
12
  import { TextStyle } from './document/text/textstyle';
@@ -57,6 +58,7 @@ export declare const enum CommandName {
57
58
  GetCurrentPage = "gcp",
58
59
  GetCustomShape = "gcs",
59
60
  GetDataItemField = "gdif",
61
+ GetDocumentAccessPermission = "gdap",
60
62
  GetDocumentId = "gdid",
61
63
  GetElementType = "get",
62
64
  GetItemPageId = "gip",
@@ -288,6 +290,10 @@ export type CommandArgs = {
288
290
  query: GetDataItemFieldQuery;
289
291
  result: GetDataItemFieldResult;
290
292
  };
293
+ [CommandName.GetDocumentAccessPermission]: {
294
+ query: GetDocumentAccessPermissionQuery;
295
+ result: GetDocumentAccessPermissionResult;
296
+ };
291
297
  [CommandName.GetDocumentId]: {
292
298
  query: GetDocumentIdQuery;
293
299
  result: GetDocumentIdResult;
@@ -962,6 +968,8 @@ export type GetDataItemFieldQuery = {
962
968
  'f': string;
963
969
  };
964
970
  export type GetDataItemFieldResult = SerializedFieldType;
971
+ export type GetDocumentAccessPermissionQuery = void;
972
+ export type GetDocumentAccessPermissionResult = DocumentAccessPermission;
965
973
  export type GetDocumentIdQuery = void;
966
974
  export type GetDocumentIdResult = string;
967
975
  export type GetItemPageIdQuery = string;
package/commandtypes.js CHANGED
@@ -38,6 +38,7 @@ exports.commandTitles = new Map([
38
38
  ["gcp" /* CommandName.GetCurrentPage */, 'GetCurrentPage'],
39
39
  ["gcs" /* CommandName.GetCustomShape */, 'GetCustomShape'],
40
40
  ["gdif" /* CommandName.GetDataItemField */, 'GetDataItemField'],
41
+ ["gdap" /* CommandName.GetDocumentAccessPermission */, 'GetDocumentAccessPermission'],
41
42
  ["gdid" /* CommandName.GetDocumentId */, 'GetDocumentId'],
42
43
  ["get" /* CommandName.GetElementType */, 'GetElementType'],
43
44
  ["gip" /* CommandName.GetItemPageId */, 'GetItemPageId'],
@@ -0,0 +1,22 @@
1
+ /**
2
+ * This enumeration represents the access permission a user can have on a document.
3
+ * Note: Additional values may be added to this enumeration.
4
+ */
5
+ export declare enum DocumentAccessPermission {
6
+ /**
7
+ * Can edit, share, and change access permissions.
8
+ */
9
+ EditAndShare = "editAndShare",
10
+ /**
11
+ * Can edit but can't share, or change access permissions.
12
+ */
13
+ Edit = "edit",
14
+ /**
15
+ * Can comment but can't share, edit, or change access permissions.
16
+ */
17
+ Comment = "comment",
18
+ /**
19
+ * Can view but can't share, edit, comment, or change access permissions.
20
+ */
21
+ View = "view"
22
+ }
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DocumentAccessPermission = void 0;
4
+ /**
5
+ * This enumeration represents the access permission a user can have on a document.
6
+ * Note: Additional values may be added to this enumeration.
7
+ */
8
+ var DocumentAccessPermission;
9
+ (function (DocumentAccessPermission) {
10
+ /**
11
+ * Can edit, share, and change access permissions.
12
+ */
13
+ DocumentAccessPermission["EditAndShare"] = "editAndShare";
14
+ /**
15
+ * Can edit but can't share, or change access permissions.
16
+ */
17
+ DocumentAccessPermission["Edit"] = "edit";
18
+ /**
19
+ * Can comment but can't share, edit, or change access permissions.
20
+ */
21
+ DocumentAccessPermission["Comment"] = "comment";
22
+ /**
23
+ * Can view but can't share, edit, comment, or change access permissions.
24
+ */
25
+ DocumentAccessPermission["View"] = "view";
26
+ })(DocumentAccessPermission = exports.DocumentAccessPermission || (exports.DocumentAccessPermission = {}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lucid-extension-sdk",
3
- "version": "0.0.178",
3
+ "version": "0.0.180",
4
4
  "description": "Utility classes for writing Lucid Software editor extensions",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -1,3 +1,4 @@
1
+ import { DocumentAccessPermission } from '../document/documentaccesspermission';
1
2
  import { EditorClient } from '../editorclient';
2
3
  /**
3
4
  * The UserProxy class gives access to the current user on the current Lucid document.
@@ -6,4 +7,8 @@ export declare class UserProxy {
6
7
  private readonly client;
7
8
  readonly id: string;
8
9
  constructor(client: EditorClient);
10
+ /**
11
+ * @returns the permission the user has on the current document.
12
+ */
13
+ getAccessPermssionOnDocument(): DocumentAccessPermission;
9
14
  }
package/user/userproxy.js CHANGED
@@ -9,5 +9,11 @@ class UserProxy {
9
9
  this.client = client;
10
10
  this.id = this.client.sendCommand("guid" /* CommandName.GetUserId */, undefined);
11
11
  }
12
+ /**
13
+ * @returns the permission the user has on the current document.
14
+ */
15
+ getAccessPermssionOnDocument() {
16
+ return this.client.sendCommand("gdap" /* CommandName.GetDocumentAccessPermission */, undefined);
17
+ }
12
18
  }
13
19
  exports.UserProxy = UserProxy;