lucid-extension-sdk 0.0.138 → 0.0.140

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.
Files changed (231) hide show
  1. package/{sdk/dataconnector → dataconnector}/dataconnector.d.ts +3 -1
  2. package/{sdk/dataconnector → dataconnector}/dataconnector.js +5 -1
  3. package/{sdk/dataconnector → dataconnector}/dataconnectorclient.js +4 -4
  4. package/{sdk/dataconnector → dataconnector}/datasourceclient.js +3 -3
  5. package/{sdk/dataconnector → dataconnector}/throwunsuccessful.js +1 -1
  6. package/document/blockclasses/customblockproxy.d.ts +21 -0
  7. package/document/blockclasses/customblockproxy.js +58 -0
  8. package/{sdk/editorclient.js → editorclient.js} +5 -1
  9. package/package.json +3 -3
  10. package/sdk/document/blockclasses/customblockproxy.d.ts +0 -6
  11. package/sdk/document/blockclasses/customblockproxy.js +0 -24
  12. /package/{sdk/commandtypes.d.ts → commandtypes.d.ts} +0 -0
  13. /package/{sdk/commandtypes.js → commandtypes.js} +0 -0
  14. /package/{sdk/core → core}/base64.d.ts +0 -0
  15. /package/{sdk/core → core}/base64.js +0 -0
  16. /package/{sdk/core → core}/cardintegration/cardfielddisplaysettings.d.ts +0 -0
  17. /package/{sdk/core → core}/cardintegration/cardfielddisplaysettings.js +0 -0
  18. /package/{sdk/core → core}/cardintegration/cardintegrationconfig.d.ts +0 -0
  19. /package/{sdk/core → core}/cardintegration/cardintegrationconfig.js +0 -0
  20. /package/{sdk/core → core}/cardintegration/cardintegrationdefinitions.d.ts +0 -0
  21. /package/{sdk/core → core}/cardintegration/cardintegrationdefinitions.js +0 -0
  22. /package/{sdk/core → core}/cardintegration/lucidcardintegration.d.ts +0 -0
  23. /package/{sdk/core → core}/cardintegration/lucidcardintegration.js +0 -0
  24. /package/{sdk/core → core}/cardintegration/lucidcardintegrationdefinitions.d.ts +0 -0
  25. /package/{sdk/core → core}/cardintegration/lucidcardintegrationdefinitions.js +0 -0
  26. /package/{sdk/core → core}/cardintegration/lucidcardintegrationregistry.d.ts +0 -0
  27. /package/{sdk/core → core}/cardintegration/lucidcardintegrationregistry.js +0 -0
  28. /package/{sdk/core → core}/checks.d.ts +0 -0
  29. /package/{sdk/core → core}/checks.js +0 -0
  30. /package/{sdk/core → core}/data/datasource/datasourcetype.d.ts +0 -0
  31. /package/{sdk/core → core}/data/datasource/datasourcetype.js +0 -0
  32. /package/{sdk/core → core}/data/datasource/metadatatypes.d.ts +0 -0
  33. /package/{sdk/core → core}/data/datasource/metadatatypes.js +0 -0
  34. /package/{sdk/core → core}/data/datasource/serializeddatasourceproperties.d.ts +0 -0
  35. /package/{sdk/core → core}/data/datasource/serializeddatasourceproperties.js +0 -0
  36. /package/{sdk/core → core}/data/datasource/serializedimporteddatasource.d.ts +0 -0
  37. /package/{sdk/core → core}/data/datasource/serializedimporteddatasource.js +0 -0
  38. /package/{sdk/core → core}/data/datasource/serializedupstreamconfig.d.ts +0 -0
  39. /package/{sdk/core → core}/data/datasource/serializedupstreamconfig.js +0 -0
  40. /package/{sdk/core → core}/data/datasource/upstreampatchtype.d.ts +0 -0
  41. /package/{sdk/core → core}/data/datasource/upstreampatchtype.js +0 -0
  42. /package/{sdk/core → core}/data/datasource/upstreamupdatetype.d.ts +0 -0
  43. /package/{sdk/core → core}/data/datasource/upstreamupdatetype.js +0 -0
  44. /package/{sdk/core → core}/data/fieldspecification.d.ts +0 -0
  45. /package/{sdk/core → core}/data/fieldspecification.js +0 -0
  46. /package/{sdk/core → core}/data/fieldtypedefinition/basefieldtypedefinition.d.ts +0 -0
  47. /package/{sdk/core → core}/data/fieldtypedefinition/basefieldtypedefinition.js +0 -0
  48. /package/{sdk/core → core}/data/fieldtypedefinition/collectionenumfieldtype.d.ts +0 -0
  49. /package/{sdk/core → core}/data/fieldtypedefinition/collectionenumfieldtype.js +0 -0
  50. /package/{sdk/core → core}/data/fieldtypedefinition/fieldtypearray.d.ts +0 -0
  51. /package/{sdk/core → core}/data/fieldtypedefinition/fieldtypearray.js +0 -0
  52. /package/{sdk/core → core}/data/fieldtypedefinition/fieldtypedefinition.d.ts +0 -0
  53. /package/{sdk/core → core}/data/fieldtypedefinition/fieldtypedefinition.js +0 -0
  54. /package/{sdk/core → core}/data/fieldtypedefinition/literalfieldtype.d.ts +0 -0
  55. /package/{sdk/core → core}/data/fieldtypedefinition/literalfieldtype.js +0 -0
  56. /package/{sdk/core → core}/data/fieldtypedefinition/ndimensionalfieldtypearray.d.ts +0 -0
  57. /package/{sdk/core → core}/data/fieldtypedefinition/ndimensionalfieldtypearray.js +0 -0
  58. /package/{sdk/core → core}/data/fieldtypedefinition/scalarfieldtype.d.ts +0 -0
  59. /package/{sdk/core → core}/data/fieldtypedefinition/scalarfieldtype.js +0 -0
  60. /package/{sdk/core → core}/data/fieldtypedefinition/semantickind.d.ts +0 -0
  61. /package/{sdk/core → core}/data/fieldtypedefinition/semantickind.js +0 -0
  62. /package/{sdk/core → core}/data/referencekeys/serializedreferencekey.d.ts +0 -0
  63. /package/{sdk/core → core}/data/referencekeys/serializedreferencekey.js +0 -0
  64. /package/{sdk/core → core}/data/serializedfield/serializeddataitems.d.ts +0 -0
  65. /package/{sdk/core → core}/data/serializedfield/serializeddataitems.js +0 -0
  66. /package/{sdk/core → core}/data/serializedfield/serializedfielddefinition.d.ts +0 -0
  67. /package/{sdk/core → core}/data/serializedfield/serializedfielddefinition.js +0 -0
  68. /package/{sdk/core → core}/data/serializedfield/serializedfields.d.ts +0 -0
  69. /package/{sdk/core → core}/data/serializedfield/serializedfields.js +0 -0
  70. /package/{sdk/core → core}/data/serializedfield/serializedschema.d.ts +0 -0
  71. /package/{sdk/core → core}/data/serializedfield/serializedschema.js +0 -0
  72. /package/{sdk/core → core}/dataerrortype.d.ts +0 -0
  73. /package/{sdk/core → core}/dataerrortype.js +0 -0
  74. /package/{sdk/core → core}/guards.d.ts +0 -0
  75. /package/{sdk/core → core}/guards.js +0 -0
  76. /package/{sdk/core → core}/humanreadableerror.d.ts +0 -0
  77. /package/{sdk/core → core}/humanreadableerror.js +0 -0
  78. /package/{sdk/core → core}/iframe/iframeutils.d.ts +0 -0
  79. /package/{sdk/core → core}/iframe/iframeutils.js +0 -0
  80. /package/{sdk/core → core}/jsonserializable.d.ts +0 -0
  81. /package/{sdk/core → core}/jsonserializable.js +0 -0
  82. /package/{sdk/core → core}/lucidproduct.d.ts +0 -0
  83. /package/{sdk/core → core}/lucidproduct.js +0 -0
  84. /package/{sdk/core → core}/object.d.ts +0 -0
  85. /package/{sdk/core → core}/object.js +0 -0
  86. /package/{sdk/core → core}/offsettype.d.ts +0 -0
  87. /package/{sdk/core → core}/offsettype.js +0 -0
  88. /package/{sdk/core → core}/optionalkey.d.ts +0 -0
  89. /package/{sdk/core → core}/optionalkey.js +0 -0
  90. /package/{sdk/core → core}/properties/datagraphic/badgeposition.d.ts +0 -0
  91. /package/{sdk/core → core}/properties/datagraphic/badgeposition.js +0 -0
  92. /package/{sdk/core → core}/properties/datagraphic/datagraphicindexes.d.ts +0 -0
  93. /package/{sdk/core → core}/properties/datagraphic/datagraphicindexes.js +0 -0
  94. /package/{sdk/core → core}/properties/datagraphic/staticdatagraphicsettings.d.ts +0 -0
  95. /package/{sdk/core → core}/properties/datagraphic/staticdatagraphicsettings.js +0 -0
  96. /package/{sdk/core → core}/properties/fillcolor.d.ts +0 -0
  97. /package/{sdk/core → core}/properties/fillcolor.js +0 -0
  98. /package/{sdk/core → core}/properties/shadow.d.ts +0 -0
  99. /package/{sdk/core → core}/properties/shadow.js +0 -0
  100. /package/{sdk/core → core}/serializeddataerror.d.ts +0 -0
  101. /package/{sdk/core → core}/serializeddataerror.js +0 -0
  102. /package/{sdk/core → core}/shapedatainheritance.d.ts +0 -0
  103. /package/{sdk/core → core}/shapedatainheritance.js +0 -0
  104. /package/{sdk/core → core}/spreadsheetintegration/lucidspreadsheetintegration.d.ts +0 -0
  105. /package/{sdk/core → core}/spreadsheetintegration/lucidspreadsheetintegration.js +0 -0
  106. /package/{sdk/core → core}/spreadsheetintegration/lucidspreadsheetintegrationregistry.d.ts +0 -0
  107. /package/{sdk/core → core}/spreadsheetintegration/lucidspreadsheetintegrationregistry.js +0 -0
  108. /package/{sdk/core → core}/unfurl/unfurlcallbacks.d.ts +0 -0
  109. /package/{sdk/core → core}/unfurl/unfurlcallbacks.js +0 -0
  110. /package/{sdk/core → core}/unfurl/unfurldetails.d.ts +0 -0
  111. /package/{sdk/core → core}/unfurl/unfurldetails.js +0 -0
  112. /package/{sdk/core → core}/unfurl/unfurliframe.d.ts +0 -0
  113. /package/{sdk/core → core}/unfurl/unfurliframe.js +0 -0
  114. /package/{sdk/core → core}/unfurl/unfurlrefresherrortype.d.ts +0 -0
  115. /package/{sdk/core → core}/unfurl/unfurlrefresherrortype.js +0 -0
  116. /package/{sdk/core → core}/unfurl/unfurlthumbnail.d.ts +0 -0
  117. /package/{sdk/core → core}/unfurl/unfurlthumbnail.js +0 -0
  118. /package/{sdk/core → core}/validators/validators.d.ts +0 -0
  119. /package/{sdk/core → core}/validators/validators.js +0 -0
  120. /package/{sdk/core → core}/xhr.d.ts +0 -0
  121. /package/{sdk/core → core}/xhr.js +0 -0
  122. /package/{sdk/data → data}/branchedcollectionid.d.ts +0 -0
  123. /package/{sdk/data → data}/branchedcollectionid.js +0 -0
  124. /package/{sdk/data → data}/collectiondefinition.d.ts +0 -0
  125. /package/{sdk/data → data}/collectiondefinition.js +0 -0
  126. /package/{sdk/data → data}/collectionproxy.d.ts +0 -0
  127. /package/{sdk/data → data}/collectionproxy.js +0 -0
  128. /package/{sdk/data → data}/dataerror.d.ts +0 -0
  129. /package/{sdk/data → data}/dataerror.js +0 -0
  130. /package/{sdk/data → data}/dataitemproxy.d.ts +0 -0
  131. /package/{sdk/data → data}/dataitemproxy.js +0 -0
  132. /package/{sdk/data → data}/dataproxy.d.ts +0 -0
  133. /package/{sdk/data → data}/dataproxy.js +0 -0
  134. /package/{sdk/data → data}/datasourceproxy.d.ts +0 -0
  135. /package/{sdk/data → data}/datasourceproxy.js +0 -0
  136. /package/{sdk/data → data}/dataupdatefiltertype.d.ts +0 -0
  137. /package/{sdk/data → data}/dataupdatefiltertype.js +0 -0
  138. /package/{sdk/data → data}/patchcollectionproxy.d.ts +0 -0
  139. /package/{sdk/data → data}/patchcollectionproxy.js +0 -0
  140. /package/{sdk/data → data}/referencekeydefinition.d.ts +0 -0
  141. /package/{sdk/data → data}/referencekeydefinition.js +0 -0
  142. /package/{sdk/data → data}/referencekeyproxy.d.ts +0 -0
  143. /package/{sdk/data → data}/referencekeyproxy.js +0 -0
  144. /package/{sdk/data → data}/schemadefinition.d.ts +0 -0
  145. /package/{sdk/data → data}/schemadefinition.js +0 -0
  146. /package/{sdk/dataconnector → dataconnector}/actions/action.d.ts +0 -0
  147. /package/{sdk/dataconnector → dataconnector}/actions/action.js +0 -0
  148. /package/{sdk/dataconnector → dataconnector}/actions/dataconnectoractionkeys.d.ts +0 -0
  149. /package/{sdk/dataconnector → dataconnector}/actions/dataconnectoractionkeys.js +0 -0
  150. /package/{sdk/dataconnector → dataconnector}/actions/managewebhookresponsebody.d.ts +0 -0
  151. /package/{sdk/dataconnector → dataconnector}/actions/managewebhookresponsebody.js +0 -0
  152. /package/{sdk/dataconnector → dataconnector}/actions/patchresponsebody.d.ts +0 -0
  153. /package/{sdk/dataconnector → dataconnector}/actions/patchresponsebody.js +0 -0
  154. /package/{sdk/dataconnector → dataconnector}/actions/serializedactions.d.ts +0 -0
  155. /package/{sdk/dataconnector → dataconnector}/actions/serializedactions.js +0 -0
  156. /package/{sdk/dataconnector → dataconnector}/dataconnectorclient.d.ts +0 -0
  157. /package/{sdk/dataconnector → dataconnector}/datasourceclient.d.ts +0 -0
  158. /package/{sdk/dataconnector → dataconnector}/datasourcemetadatatypes.d.ts +0 -0
  159. /package/{sdk/dataconnector → dataconnector}/datasourcemetadatatypes.js +0 -0
  160. /package/{sdk/dataconnector → dataconnector}/datasourceupdatetypes.d.ts +0 -0
  161. /package/{sdk/dataconnector → dataconnector}/datasourceupdatetypes.js +0 -0
  162. /package/{sdk/dataconnector → dataconnector}/debugserver.d.ts +0 -0
  163. /package/{sdk/dataconnector → dataconnector}/debugserver.js +0 -0
  164. /package/{sdk/dataconnector → dataconnector}/defaultfetchfunction.d.ts +0 -0
  165. /package/{sdk/dataconnector → dataconnector}/defaultfetchfunction.js +0 -0
  166. /package/{sdk/dataconnector → dataconnector}/signaturevalidator.d.ts +0 -0
  167. /package/{sdk/dataconnector → dataconnector}/signaturevalidator.js +0 -0
  168. /package/{sdk/dataconnector → dataconnector}/throwunsuccessful.d.ts +0 -0
  169. /package/{sdk/document → document}/blockclasses/blockproxyregistry.d.ts +0 -0
  170. /package/{sdk/document → document}/blockclasses/blockproxyregistry.js +0 -0
  171. /package/{sdk/document → document}/blockclasses/cardblockproxy.d.ts +0 -0
  172. /package/{sdk/document → document}/blockclasses/cardblockproxy.js +0 -0
  173. /package/{sdk/document → document}/blockclasses/erdblockproxy.d.ts +0 -0
  174. /package/{sdk/document → document}/blockclasses/erdblockproxy.js +0 -0
  175. /package/{sdk/document → document}/blockclasses/linkunfurlblockproxy.d.ts +0 -0
  176. /package/{sdk/document → document}/blockclasses/linkunfurlblockproxy.js +0 -0
  177. /package/{sdk/document → document}/blockdefinition.d.ts +0 -0
  178. /package/{sdk/document → document}/blockdefinition.js +0 -0
  179. /package/{sdk/document → document}/blockproxy.d.ts +0 -0
  180. /package/{sdk/document → document}/blockproxy.js +0 -0
  181. /package/{sdk/document → document}/documentelement/cardconfigproxy.d.ts +0 -0
  182. /package/{sdk/document → document}/documentelement/cardconfigproxy.js +0 -0
  183. /package/{sdk/document → document}/documentelement/documentelementproxy.d.ts +0 -0
  184. /package/{sdk/document → document}/documentelement/documentelementproxy.js +0 -0
  185. /package/{sdk/document → document}/documentelement/documentelementtype.d.ts +0 -0
  186. /package/{sdk/document → document}/documentelement/documentelementtype.js +0 -0
  187. /package/{sdk/document → document}/documentproxy.d.ts +0 -0
  188. /package/{sdk/document → document}/documentproxy.js +0 -0
  189. /package/{sdk/document → document}/elementproxy.d.ts +0 -0
  190. /package/{sdk/document → document}/elementproxy.js +0 -0
  191. /package/{sdk/document → document}/groupproxy.d.ts +0 -0
  192. /package/{sdk/document → document}/groupproxy.js +0 -0
  193. /package/{sdk/document → document}/itemproxy.d.ts +0 -0
  194. /package/{sdk/document → document}/itemproxy.js +0 -0
  195. /package/{sdk/document → document}/linedefinition.d.ts +0 -0
  196. /package/{sdk/document → document}/linedefinition.js +0 -0
  197. /package/{sdk/document → document}/lineproxy.d.ts +0 -0
  198. /package/{sdk/document → document}/lineproxy.js +0 -0
  199. /package/{sdk/document → document}/linetextareapositioning.d.ts +0 -0
  200. /package/{sdk/document → document}/linetextareapositioning.js +0 -0
  201. /package/{sdk/document → document}/mapproxy.d.ts +0 -0
  202. /package/{sdk/document → document}/mapproxy.js +0 -0
  203. /package/{sdk/document → document}/pagedefinition.d.ts +0 -0
  204. /package/{sdk/document → document}/pagedefinition.js +0 -0
  205. /package/{sdk/document → document}/pageproxy.d.ts +0 -0
  206. /package/{sdk/document → document}/pageproxy.js +0 -0
  207. /package/{sdk/document → document}/propertystoreproxy.d.ts +0 -0
  208. /package/{sdk/document → document}/propertystoreproxy.js +0 -0
  209. /package/{sdk/document → document}/shapedataproxy.d.ts +0 -0
  210. /package/{sdk/document → document}/shapedataproxy.js +0 -0
  211. /package/{sdk/document → document}/text/textstyle.d.ts +0 -0
  212. /package/{sdk/document → document}/text/textstyle.js +0 -0
  213. /package/{sdk/editorclient.d.ts → editorclient.d.ts} +0 -0
  214. /package/{sdk/index.d.ts → index.d.ts} +0 -0
  215. /package/{sdk/index.js → index.js} +0 -0
  216. /package/{sdk/math.d.ts → math.d.ts} +0 -0
  217. /package/{sdk/math.js → math.js} +0 -0
  218. /package/{sdk/message → message}/unfurleventmessage.d.ts +0 -0
  219. /package/{sdk/message → message}/unfurleventmessage.js +0 -0
  220. /package/{sdk/ui → ui}/alertmodal.d.ts +0 -0
  221. /package/{sdk/ui → ui}/alertmodal.js +0 -0
  222. /package/{sdk/ui → ui}/iframeui.d.ts +0 -0
  223. /package/{sdk/ui → ui}/iframeui.js +0 -0
  224. /package/{sdk/ui → ui}/menu.d.ts +0 -0
  225. /package/{sdk/ui → ui}/menu.js +0 -0
  226. /package/{sdk/ui → ui}/modal.d.ts +0 -0
  227. /package/{sdk/ui → ui}/modal.js +0 -0
  228. /package/{sdk/ui → ui}/panel.d.ts +0 -0
  229. /package/{sdk/ui → ui}/panel.js +0 -0
  230. /package/{sdk/ui → ui}/viewport.d.ts +0 -0
  231. /package/{sdk/ui → ui}/viewport.js +0 -0
@@ -28,7 +28,9 @@ export declare class DataConnectorRunError extends Error {
28
28
  export declare class DataConnectorRequestError extends Error {
29
29
  status: number;
30
30
  response: string;
31
- constructor(status: number, message: string, response: string);
31
+ statusText?: string | undefined;
32
+ constructor(status: number, message: string, response: string, statusText?: string | undefined);
33
+ toString(): string;
32
34
  }
33
35
  /** Thrown by any APIs the client didn't recognize when parsing */
34
36
  export declare class DataConnectorResponseError extends Error {
@@ -22,10 +22,14 @@ class DataConnectorRunError extends Error {
22
22
  exports.DataConnectorRunError = DataConnectorRunError;
23
23
  /** Thrown by any failable http APIs */
24
24
  class DataConnectorRequestError extends Error {
25
- constructor(status, message, response) {
25
+ constructor(status, message, response, statusText) {
26
26
  super(message);
27
27
  this.status = status;
28
28
  this.response = response;
29
+ this.statusText = statusText;
30
+ }
31
+ toString() {
32
+ return `${this.message} ${this.statusText ? this.statusText + ' ' : ''}(${this.status}) ${this.response}`;
29
33
  }
30
34
  }
31
35
  exports.DataConnectorRequestError = DataConnectorRequestError;
@@ -31,7 +31,7 @@ class DataConnectorClient {
31
31
  if (!this.cachedPublicKey) {
32
32
  const url = `${this.urls.main}.well-known/pem/TPCP`;
33
33
  const result = await this.fetchMethod(url);
34
- await (0, throwunsuccessful_1.throwUnsuccessful)(result, 'Error getting public key');
34
+ await (0, throwunsuccessful_1.throwUnsuccessful)(result, 'getting public key');
35
35
  this.cachedPublicKey = await result.text();
36
36
  }
37
37
  return this.cachedPublicKey;
@@ -55,7 +55,7 @@ class DataConnectorClient {
55
55
  'webhook-validation-secret': JSON.stringify(WebhookValidationSecret),
56
56
  },
57
57
  });
58
- await (0, throwunsuccessful_1.throwUnsuccessful)(result, 'Error getting secret from webhook');
58
+ await (0, throwunsuccessful_1.throwUnsuccessful)(result, 'getting secret from webhook');
59
59
  const responseBody = await result.json();
60
60
  if ((0, checks_1.isString)(responseBody)) {
61
61
  return responseBody;
@@ -69,7 +69,7 @@ class DataConnectorClient {
69
69
  const result = await this.fetchMethod(`${this.urls.dataSync}customWebhookData`, {
70
70
  headers: { 'data-update-token': webhookUpdateToken },
71
71
  });
72
- await (0, throwunsuccessful_1.throwUnsuccessful)(result, 'Error getting custom webhook data');
72
+ await (0, throwunsuccessful_1.throwUnsuccessful)(result, 'getting custom webhook data');
73
73
  return (await result.json());
74
74
  }
75
75
  /** @ignore */
@@ -84,7 +84,7 @@ class DataConnectorClient {
84
84
  },
85
85
  body: JSON.stringify(patch),
86
86
  });
87
- await (0, throwunsuccessful_1.throwUnsuccessful)(result, 'Error patching custom webhook data');
87
+ await (0, throwunsuccessful_1.throwUnsuccessful)(result, 'patching custom webhook data');
88
88
  return (await result.json());
89
89
  }
90
90
  }
@@ -50,7 +50,7 @@ class DataSourceClient {
50
50
  },
51
51
  'body': JSON.stringify(this.formatBody(request)),
52
52
  });
53
- await (0, throwunsuccessful_1.throwUnsuccessful)(response, 'Error updating data source');
53
+ await (0, throwunsuccessful_1.throwUnsuccessful)(response, 'updating data source');
54
54
  // webhooks return 200 with an empty body
55
55
  // document updates return valid json
56
56
  // we can't use .json because that will fail for webhooks
@@ -76,7 +76,7 @@ class DataSourceClient {
76
76
  'Lucid-Api-Version': '1',
77
77
  },
78
78
  });
79
- await (0, throwunsuccessful_1.throwUnsuccessful)(response, 'Error getting data source`s metadata');
79
+ await (0, throwunsuccessful_1.throwUnsuccessful)(response, 'getting data source`s metadata');
80
80
  const responseBody = await response.json();
81
81
  if ((0, validators_1.arrayValidator)(datasourcemetadatatypes_1.isSerializedMetadataRecord)(responseBody)) {
82
82
  return responseBody.map((rawResponse) => {
@@ -126,7 +126,7 @@ class DataSourceClient {
126
126
  }
127
127
  throw new dataconnector_1.DataConnectorResponseError(`Invalid conflict response to query at '${this.metadataUrl}'! Expected an array of serialized metadata records`, JSON.stringify(responseBody));
128
128
  }
129
- await (0, throwunsuccessful_1.throwUnsuccessful)(response, 'Error patching data source`s metadata');
129
+ await (0, throwunsuccessful_1.throwUnsuccessful)(response, 'patching data source`s metadata');
130
130
  return { status: 'NoContent' };
131
131
  }
132
132
  }
@@ -5,7 +5,7 @@ const dataconnector_1 = require("./dataconnector");
5
5
  /** @ignore */
6
6
  async function throwUnsuccessful(result, message) {
7
7
  if (Math.floor(result.status / 100) !== 2) {
8
- throw new dataconnector_1.DataConnectorRequestError(result.status, message, await result.text());
8
+ throw new dataconnector_1.DataConnectorRequestError(result.status, message, await result.text(), result.statusText);
9
9
  }
10
10
  }
11
11
  exports.throwUnsuccessful = throwUnsuccessful;
@@ -0,0 +1,21 @@
1
+ import { EditorClient } from '../../editorclient';
2
+ import { BlockProxy } from '../blockproxy';
3
+ export declare type CustomBlockProxyConstructor = typeof BlockProxy & {
4
+ library: string;
5
+ shape: string;
6
+ };
7
+ /**
8
+ * Custom shapes defined in extension packages (or other stencil-providing means like Visio stencil imports)
9
+ * are represented by a CustomBlockProxy.
10
+ */
11
+ export declare class CustomBlockProxy extends BlockProxy {
12
+ static classNameRegex: RegExp;
13
+ private static subclassRegistry;
14
+ static registerCustomBlockClass(klass: CustomBlockProxyConstructor): void;
15
+ /**
16
+ * @ignore
17
+ */
18
+ static getCustomBlockClass(client: EditorClient, id: string): CustomBlockProxyConstructor | typeof CustomBlockProxy;
19
+ isFromStencil(library: string, shape: string): boolean;
20
+ getStencilTextAreaName(stencilTextAreaName: string): string | undefined;
21
+ }
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CustomBlockProxy = void 0;
4
+ const checks_1 = require("../../core/checks");
5
+ const blockproxy_1 = require("../blockproxy");
6
+ /**
7
+ * Custom shapes defined in extension packages (or other stencil-providing means like Visio stencil imports)
8
+ * are represented by a CustomBlockProxy.
9
+ */
10
+ class CustomBlockProxy extends blockproxy_1.BlockProxy {
11
+ static registerCustomBlockClass(klass) {
12
+ let byLibrary = CustomBlockProxy.subclassRegistry.get(klass.library);
13
+ if (!byLibrary) {
14
+ byLibrary = new Map();
15
+ CustomBlockProxy.subclassRegistry.set(klass.library, byLibrary);
16
+ }
17
+ byLibrary.set(klass.shape, klass);
18
+ }
19
+ /**
20
+ * @ignore
21
+ */
22
+ static getCustomBlockClass(client, id) {
23
+ if (this.subclassRegistry.size > 0) {
24
+ const stencil = client.sendCommand("gp" /* CommandName.GetProperty */, { 'id': id, 'p': 'Stencil' });
25
+ if ((0, checks_1.isObject)(stencil)) {
26
+ const sourceStencil = client.sendCommand("gp" /* CommandName.GetProperty */, { 'p': 'Stencil-' + stencil['id'] });
27
+ if ((0, checks_1.isObject)(sourceStencil) && (0, checks_1.isObject)(sourceStencil['sourcePackage'])) {
28
+ if (sourceStencil['sourcePackage']['packageId'] === lucid.getPackageId()) {
29
+ const byLibrary = CustomBlockProxy.subclassRegistry.get(String(sourceStencil['sourcePackage']['library']));
30
+ const klass = byLibrary === null || byLibrary === void 0 ? void 0 : byLibrary.get(String(sourceStencil['sourcePackage']['shape']));
31
+ if (klass) {
32
+ return klass;
33
+ }
34
+ }
35
+ }
36
+ }
37
+ }
38
+ return CustomBlockProxy;
39
+ }
40
+ isFromStencil(library, shape) {
41
+ const stencil = this.properties.get('Stencil');
42
+ if ((0, checks_1.isObject)(stencil)) {
43
+ const sourceStencil = this.client.sendCommand("gp" /* CommandName.GetProperty */, { 'p': 'Stencil-' + stencil['id'] });
44
+ if ((0, checks_1.isObject)(sourceStencil) && (0, checks_1.isObject)(sourceStencil['sourcePackage'])) {
45
+ return (sourceStencil['sourcePackage']['packageId'] === lucid.getPackageId() &&
46
+ sourceStencil['sourcePackage']['library'] === library &&
47
+ sourceStencil['sourcePackage']['shape'] === shape);
48
+ }
49
+ }
50
+ return false;
51
+ }
52
+ getStencilTextAreaName(stencilTextAreaName) {
53
+ return this.textAreas.keys().find((name) => name.endsWith('_' + stencilTextAreaName));
54
+ }
55
+ }
56
+ exports.CustomBlockProxy = CustomBlockProxy;
57
+ CustomBlockProxy.classNameRegex = /^CustomBlock$/;
58
+ CustomBlockProxy.subclassRegistry = new Map();
@@ -9,6 +9,7 @@ const unfurldetails_1 = require("./core/unfurl/unfurldetails");
9
9
  const unfurlrefresherrortype_1 = require("./core/unfurl/unfurlrefresherrortype");
10
10
  const collectionproxy_1 = require("./data/collectionproxy");
11
11
  const blockproxyregistry_1 = require("./document/blockclasses/blockproxyregistry");
12
+ const customblockproxy_1 = require("./document/blockclasses/customblockproxy");
12
13
  const linkunfurlblockproxy_1 = require("./document/blockclasses/linkunfurlblockproxy");
13
14
  const blockproxy_1 = require("./document/blockproxy");
14
15
  const documentproxy_1 = require("./document/documentproxy");
@@ -349,7 +350,10 @@ class EditorClient {
349
350
  */
350
351
  getBlockProxy(id) {
351
352
  const className = this.sendCommand("gp" /* CommandName.GetProperty */, { 'id': id, 'p': 'ClassName' });
352
- const proxy = (0, blockproxyregistry_1.findProxyClass)(className);
353
+ let proxy = (0, blockproxyregistry_1.findProxyClass)(className);
354
+ if (proxy === customblockproxy_1.CustomBlockProxy) {
355
+ proxy = customblockproxy_1.CustomBlockProxy.getCustomBlockClass(this, id);
356
+ }
353
357
  if (proxy) {
354
358
  return new proxy(id, this);
355
359
  }
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "lucid-extension-sdk",
3
- "version": "0.0.138",
3
+ "version": "0.0.140",
4
4
  "description": "Utility classes for writing Lucid Software editor extensions",
5
- "main": "sdk/index.js",
6
- "types": "sdk/index.d.ts",
5
+ "main": "index.js",
6
+ "types": "index.d.ts",
7
7
  "author": "Lucid Software",
8
8
  "license": "Apache-2.0",
9
9
  "declaration": true,
@@ -1,6 +0,0 @@
1
- import { BlockProxy } from '../blockproxy';
2
- export declare class CustomBlockProxy extends BlockProxy {
3
- static classNameRegex: RegExp;
4
- isFromStencil(library: string, shape: string): boolean;
5
- getStencilTextAreaName(stencilTextAreaName: string): string | undefined;
6
- }
@@ -1,24 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CustomBlockProxy = void 0;
4
- const checks_1 = require("../../core/checks");
5
- const blockproxy_1 = require("../blockproxy");
6
- class CustomBlockProxy extends blockproxy_1.BlockProxy {
7
- isFromStencil(library, shape) {
8
- const stencil = this.properties.get('Stencil');
9
- if ((0, checks_1.isObject)(stencil)) {
10
- const sourceStencil = this.client.sendCommand("gp" /* CommandName.GetProperty */, { 'p': 'Stencil-' + stencil['id'] });
11
- if ((0, checks_1.isObject)(sourceStencil) && (0, checks_1.isObject)(sourceStencil['sourcePackage'])) {
12
- return (sourceStencil['sourcePackage']['packageId'] === lucid.getPackageId() &&
13
- sourceStencil['sourcePackage']['library'] === library &&
14
- sourceStencil['sourcePackage']['shape'] === shape);
15
- }
16
- }
17
- return false;
18
- }
19
- getStencilTextAreaName(stencilTextAreaName) {
20
- return this.textAreas.keys().find((name) => name.endsWith('_' + stencilTextAreaName));
21
- }
22
- }
23
- exports.CustomBlockProxy = CustomBlockProxy;
24
- CustomBlockProxy.classNameRegex = /^CustomBlock$/;
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes