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.
- package/{sdk/dataconnector → dataconnector}/dataconnector.d.ts +3 -1
- package/{sdk/dataconnector → dataconnector}/dataconnector.js +5 -1
- package/{sdk/dataconnector → dataconnector}/dataconnectorclient.js +4 -4
- package/{sdk/dataconnector → dataconnector}/datasourceclient.js +3 -3
- package/{sdk/dataconnector → dataconnector}/throwunsuccessful.js +1 -1
- package/document/blockclasses/customblockproxy.d.ts +21 -0
- package/document/blockclasses/customblockproxy.js +58 -0
- package/{sdk/editorclient.js → editorclient.js} +5 -1
- package/package.json +3 -3
- package/sdk/document/blockclasses/customblockproxy.d.ts +0 -6
- package/sdk/document/blockclasses/customblockproxy.js +0 -24
- /package/{sdk/commandtypes.d.ts → commandtypes.d.ts} +0 -0
- /package/{sdk/commandtypes.js → commandtypes.js} +0 -0
- /package/{sdk/core → core}/base64.d.ts +0 -0
- /package/{sdk/core → core}/base64.js +0 -0
- /package/{sdk/core → core}/cardintegration/cardfielddisplaysettings.d.ts +0 -0
- /package/{sdk/core → core}/cardintegration/cardfielddisplaysettings.js +0 -0
- /package/{sdk/core → core}/cardintegration/cardintegrationconfig.d.ts +0 -0
- /package/{sdk/core → core}/cardintegration/cardintegrationconfig.js +0 -0
- /package/{sdk/core → core}/cardintegration/cardintegrationdefinitions.d.ts +0 -0
- /package/{sdk/core → core}/cardintegration/cardintegrationdefinitions.js +0 -0
- /package/{sdk/core → core}/cardintegration/lucidcardintegration.d.ts +0 -0
- /package/{sdk/core → core}/cardintegration/lucidcardintegration.js +0 -0
- /package/{sdk/core → core}/cardintegration/lucidcardintegrationdefinitions.d.ts +0 -0
- /package/{sdk/core → core}/cardintegration/lucidcardintegrationdefinitions.js +0 -0
- /package/{sdk/core → core}/cardintegration/lucidcardintegrationregistry.d.ts +0 -0
- /package/{sdk/core → core}/cardintegration/lucidcardintegrationregistry.js +0 -0
- /package/{sdk/core → core}/checks.d.ts +0 -0
- /package/{sdk/core → core}/checks.js +0 -0
- /package/{sdk/core → core}/data/datasource/datasourcetype.d.ts +0 -0
- /package/{sdk/core → core}/data/datasource/datasourcetype.js +0 -0
- /package/{sdk/core → core}/data/datasource/metadatatypes.d.ts +0 -0
- /package/{sdk/core → core}/data/datasource/metadatatypes.js +0 -0
- /package/{sdk/core → core}/data/datasource/serializeddatasourceproperties.d.ts +0 -0
- /package/{sdk/core → core}/data/datasource/serializeddatasourceproperties.js +0 -0
- /package/{sdk/core → core}/data/datasource/serializedimporteddatasource.d.ts +0 -0
- /package/{sdk/core → core}/data/datasource/serializedimporteddatasource.js +0 -0
- /package/{sdk/core → core}/data/datasource/serializedupstreamconfig.d.ts +0 -0
- /package/{sdk/core → core}/data/datasource/serializedupstreamconfig.js +0 -0
- /package/{sdk/core → core}/data/datasource/upstreampatchtype.d.ts +0 -0
- /package/{sdk/core → core}/data/datasource/upstreampatchtype.js +0 -0
- /package/{sdk/core → core}/data/datasource/upstreamupdatetype.d.ts +0 -0
- /package/{sdk/core → core}/data/datasource/upstreamupdatetype.js +0 -0
- /package/{sdk/core → core}/data/fieldspecification.d.ts +0 -0
- /package/{sdk/core → core}/data/fieldspecification.js +0 -0
- /package/{sdk/core → core}/data/fieldtypedefinition/basefieldtypedefinition.d.ts +0 -0
- /package/{sdk/core → core}/data/fieldtypedefinition/basefieldtypedefinition.js +0 -0
- /package/{sdk/core → core}/data/fieldtypedefinition/collectionenumfieldtype.d.ts +0 -0
- /package/{sdk/core → core}/data/fieldtypedefinition/collectionenumfieldtype.js +0 -0
- /package/{sdk/core → core}/data/fieldtypedefinition/fieldtypearray.d.ts +0 -0
- /package/{sdk/core → core}/data/fieldtypedefinition/fieldtypearray.js +0 -0
- /package/{sdk/core → core}/data/fieldtypedefinition/fieldtypedefinition.d.ts +0 -0
- /package/{sdk/core → core}/data/fieldtypedefinition/fieldtypedefinition.js +0 -0
- /package/{sdk/core → core}/data/fieldtypedefinition/literalfieldtype.d.ts +0 -0
- /package/{sdk/core → core}/data/fieldtypedefinition/literalfieldtype.js +0 -0
- /package/{sdk/core → core}/data/fieldtypedefinition/ndimensionalfieldtypearray.d.ts +0 -0
- /package/{sdk/core → core}/data/fieldtypedefinition/ndimensionalfieldtypearray.js +0 -0
- /package/{sdk/core → core}/data/fieldtypedefinition/scalarfieldtype.d.ts +0 -0
- /package/{sdk/core → core}/data/fieldtypedefinition/scalarfieldtype.js +0 -0
- /package/{sdk/core → core}/data/fieldtypedefinition/semantickind.d.ts +0 -0
- /package/{sdk/core → core}/data/fieldtypedefinition/semantickind.js +0 -0
- /package/{sdk/core → core}/data/referencekeys/serializedreferencekey.d.ts +0 -0
- /package/{sdk/core → core}/data/referencekeys/serializedreferencekey.js +0 -0
- /package/{sdk/core → core}/data/serializedfield/serializeddataitems.d.ts +0 -0
- /package/{sdk/core → core}/data/serializedfield/serializeddataitems.js +0 -0
- /package/{sdk/core → core}/data/serializedfield/serializedfielddefinition.d.ts +0 -0
- /package/{sdk/core → core}/data/serializedfield/serializedfielddefinition.js +0 -0
- /package/{sdk/core → core}/data/serializedfield/serializedfields.d.ts +0 -0
- /package/{sdk/core → core}/data/serializedfield/serializedfields.js +0 -0
- /package/{sdk/core → core}/data/serializedfield/serializedschema.d.ts +0 -0
- /package/{sdk/core → core}/data/serializedfield/serializedschema.js +0 -0
- /package/{sdk/core → core}/dataerrortype.d.ts +0 -0
- /package/{sdk/core → core}/dataerrortype.js +0 -0
- /package/{sdk/core → core}/guards.d.ts +0 -0
- /package/{sdk/core → core}/guards.js +0 -0
- /package/{sdk/core → core}/humanreadableerror.d.ts +0 -0
- /package/{sdk/core → core}/humanreadableerror.js +0 -0
- /package/{sdk/core → core}/iframe/iframeutils.d.ts +0 -0
- /package/{sdk/core → core}/iframe/iframeutils.js +0 -0
- /package/{sdk/core → core}/jsonserializable.d.ts +0 -0
- /package/{sdk/core → core}/jsonserializable.js +0 -0
- /package/{sdk/core → core}/lucidproduct.d.ts +0 -0
- /package/{sdk/core → core}/lucidproduct.js +0 -0
- /package/{sdk/core → core}/object.d.ts +0 -0
- /package/{sdk/core → core}/object.js +0 -0
- /package/{sdk/core → core}/offsettype.d.ts +0 -0
- /package/{sdk/core → core}/offsettype.js +0 -0
- /package/{sdk/core → core}/optionalkey.d.ts +0 -0
- /package/{sdk/core → core}/optionalkey.js +0 -0
- /package/{sdk/core → core}/properties/datagraphic/badgeposition.d.ts +0 -0
- /package/{sdk/core → core}/properties/datagraphic/badgeposition.js +0 -0
- /package/{sdk/core → core}/properties/datagraphic/datagraphicindexes.d.ts +0 -0
- /package/{sdk/core → core}/properties/datagraphic/datagraphicindexes.js +0 -0
- /package/{sdk/core → core}/properties/datagraphic/staticdatagraphicsettings.d.ts +0 -0
- /package/{sdk/core → core}/properties/datagraphic/staticdatagraphicsettings.js +0 -0
- /package/{sdk/core → core}/properties/fillcolor.d.ts +0 -0
- /package/{sdk/core → core}/properties/fillcolor.js +0 -0
- /package/{sdk/core → core}/properties/shadow.d.ts +0 -0
- /package/{sdk/core → core}/properties/shadow.js +0 -0
- /package/{sdk/core → core}/serializeddataerror.d.ts +0 -0
- /package/{sdk/core → core}/serializeddataerror.js +0 -0
- /package/{sdk/core → core}/shapedatainheritance.d.ts +0 -0
- /package/{sdk/core → core}/shapedatainheritance.js +0 -0
- /package/{sdk/core → core}/spreadsheetintegration/lucidspreadsheetintegration.d.ts +0 -0
- /package/{sdk/core → core}/spreadsheetintegration/lucidspreadsheetintegration.js +0 -0
- /package/{sdk/core → core}/spreadsheetintegration/lucidspreadsheetintegrationregistry.d.ts +0 -0
- /package/{sdk/core → core}/spreadsheetintegration/lucidspreadsheetintegrationregistry.js +0 -0
- /package/{sdk/core → core}/unfurl/unfurlcallbacks.d.ts +0 -0
- /package/{sdk/core → core}/unfurl/unfurlcallbacks.js +0 -0
- /package/{sdk/core → core}/unfurl/unfurldetails.d.ts +0 -0
- /package/{sdk/core → core}/unfurl/unfurldetails.js +0 -0
- /package/{sdk/core → core}/unfurl/unfurliframe.d.ts +0 -0
- /package/{sdk/core → core}/unfurl/unfurliframe.js +0 -0
- /package/{sdk/core → core}/unfurl/unfurlrefresherrortype.d.ts +0 -0
- /package/{sdk/core → core}/unfurl/unfurlrefresherrortype.js +0 -0
- /package/{sdk/core → core}/unfurl/unfurlthumbnail.d.ts +0 -0
- /package/{sdk/core → core}/unfurl/unfurlthumbnail.js +0 -0
- /package/{sdk/core → core}/validators/validators.d.ts +0 -0
- /package/{sdk/core → core}/validators/validators.js +0 -0
- /package/{sdk/core → core}/xhr.d.ts +0 -0
- /package/{sdk/core → core}/xhr.js +0 -0
- /package/{sdk/data → data}/branchedcollectionid.d.ts +0 -0
- /package/{sdk/data → data}/branchedcollectionid.js +0 -0
- /package/{sdk/data → data}/collectiondefinition.d.ts +0 -0
- /package/{sdk/data → data}/collectiondefinition.js +0 -0
- /package/{sdk/data → data}/collectionproxy.d.ts +0 -0
- /package/{sdk/data → data}/collectionproxy.js +0 -0
- /package/{sdk/data → data}/dataerror.d.ts +0 -0
- /package/{sdk/data → data}/dataerror.js +0 -0
- /package/{sdk/data → data}/dataitemproxy.d.ts +0 -0
- /package/{sdk/data → data}/dataitemproxy.js +0 -0
- /package/{sdk/data → data}/dataproxy.d.ts +0 -0
- /package/{sdk/data → data}/dataproxy.js +0 -0
- /package/{sdk/data → data}/datasourceproxy.d.ts +0 -0
- /package/{sdk/data → data}/datasourceproxy.js +0 -0
- /package/{sdk/data → data}/dataupdatefiltertype.d.ts +0 -0
- /package/{sdk/data → data}/dataupdatefiltertype.js +0 -0
- /package/{sdk/data → data}/patchcollectionproxy.d.ts +0 -0
- /package/{sdk/data → data}/patchcollectionproxy.js +0 -0
- /package/{sdk/data → data}/referencekeydefinition.d.ts +0 -0
- /package/{sdk/data → data}/referencekeydefinition.js +0 -0
- /package/{sdk/data → data}/referencekeyproxy.d.ts +0 -0
- /package/{sdk/data → data}/referencekeyproxy.js +0 -0
- /package/{sdk/data → data}/schemadefinition.d.ts +0 -0
- /package/{sdk/data → data}/schemadefinition.js +0 -0
- /package/{sdk/dataconnector → dataconnector}/actions/action.d.ts +0 -0
- /package/{sdk/dataconnector → dataconnector}/actions/action.js +0 -0
- /package/{sdk/dataconnector → dataconnector}/actions/dataconnectoractionkeys.d.ts +0 -0
- /package/{sdk/dataconnector → dataconnector}/actions/dataconnectoractionkeys.js +0 -0
- /package/{sdk/dataconnector → dataconnector}/actions/managewebhookresponsebody.d.ts +0 -0
- /package/{sdk/dataconnector → dataconnector}/actions/managewebhookresponsebody.js +0 -0
- /package/{sdk/dataconnector → dataconnector}/actions/patchresponsebody.d.ts +0 -0
- /package/{sdk/dataconnector → dataconnector}/actions/patchresponsebody.js +0 -0
- /package/{sdk/dataconnector → dataconnector}/actions/serializedactions.d.ts +0 -0
- /package/{sdk/dataconnector → dataconnector}/actions/serializedactions.js +0 -0
- /package/{sdk/dataconnector → dataconnector}/dataconnectorclient.d.ts +0 -0
- /package/{sdk/dataconnector → dataconnector}/datasourceclient.d.ts +0 -0
- /package/{sdk/dataconnector → dataconnector}/datasourcemetadatatypes.d.ts +0 -0
- /package/{sdk/dataconnector → dataconnector}/datasourcemetadatatypes.js +0 -0
- /package/{sdk/dataconnector → dataconnector}/datasourceupdatetypes.d.ts +0 -0
- /package/{sdk/dataconnector → dataconnector}/datasourceupdatetypes.js +0 -0
- /package/{sdk/dataconnector → dataconnector}/debugserver.d.ts +0 -0
- /package/{sdk/dataconnector → dataconnector}/debugserver.js +0 -0
- /package/{sdk/dataconnector → dataconnector}/defaultfetchfunction.d.ts +0 -0
- /package/{sdk/dataconnector → dataconnector}/defaultfetchfunction.js +0 -0
- /package/{sdk/dataconnector → dataconnector}/signaturevalidator.d.ts +0 -0
- /package/{sdk/dataconnector → dataconnector}/signaturevalidator.js +0 -0
- /package/{sdk/dataconnector → dataconnector}/throwunsuccessful.d.ts +0 -0
- /package/{sdk/document → document}/blockclasses/blockproxyregistry.d.ts +0 -0
- /package/{sdk/document → document}/blockclasses/blockproxyregistry.js +0 -0
- /package/{sdk/document → document}/blockclasses/cardblockproxy.d.ts +0 -0
- /package/{sdk/document → document}/blockclasses/cardblockproxy.js +0 -0
- /package/{sdk/document → document}/blockclasses/erdblockproxy.d.ts +0 -0
- /package/{sdk/document → document}/blockclasses/erdblockproxy.js +0 -0
- /package/{sdk/document → document}/blockclasses/linkunfurlblockproxy.d.ts +0 -0
- /package/{sdk/document → document}/blockclasses/linkunfurlblockproxy.js +0 -0
- /package/{sdk/document → document}/blockdefinition.d.ts +0 -0
- /package/{sdk/document → document}/blockdefinition.js +0 -0
- /package/{sdk/document → document}/blockproxy.d.ts +0 -0
- /package/{sdk/document → document}/blockproxy.js +0 -0
- /package/{sdk/document → document}/documentelement/cardconfigproxy.d.ts +0 -0
- /package/{sdk/document → document}/documentelement/cardconfigproxy.js +0 -0
- /package/{sdk/document → document}/documentelement/documentelementproxy.d.ts +0 -0
- /package/{sdk/document → document}/documentelement/documentelementproxy.js +0 -0
- /package/{sdk/document → document}/documentelement/documentelementtype.d.ts +0 -0
- /package/{sdk/document → document}/documentelement/documentelementtype.js +0 -0
- /package/{sdk/document → document}/documentproxy.d.ts +0 -0
- /package/{sdk/document → document}/documentproxy.js +0 -0
- /package/{sdk/document → document}/elementproxy.d.ts +0 -0
- /package/{sdk/document → document}/elementproxy.js +0 -0
- /package/{sdk/document → document}/groupproxy.d.ts +0 -0
- /package/{sdk/document → document}/groupproxy.js +0 -0
- /package/{sdk/document → document}/itemproxy.d.ts +0 -0
- /package/{sdk/document → document}/itemproxy.js +0 -0
- /package/{sdk/document → document}/linedefinition.d.ts +0 -0
- /package/{sdk/document → document}/linedefinition.js +0 -0
- /package/{sdk/document → document}/lineproxy.d.ts +0 -0
- /package/{sdk/document → document}/lineproxy.js +0 -0
- /package/{sdk/document → document}/linetextareapositioning.d.ts +0 -0
- /package/{sdk/document → document}/linetextareapositioning.js +0 -0
- /package/{sdk/document → document}/mapproxy.d.ts +0 -0
- /package/{sdk/document → document}/mapproxy.js +0 -0
- /package/{sdk/document → document}/pagedefinition.d.ts +0 -0
- /package/{sdk/document → document}/pagedefinition.js +0 -0
- /package/{sdk/document → document}/pageproxy.d.ts +0 -0
- /package/{sdk/document → document}/pageproxy.js +0 -0
- /package/{sdk/document → document}/propertystoreproxy.d.ts +0 -0
- /package/{sdk/document → document}/propertystoreproxy.js +0 -0
- /package/{sdk/document → document}/shapedataproxy.d.ts +0 -0
- /package/{sdk/document → document}/shapedataproxy.js +0 -0
- /package/{sdk/document → document}/text/textstyle.d.ts +0 -0
- /package/{sdk/document → document}/text/textstyle.js +0 -0
- /package/{sdk/editorclient.d.ts → editorclient.d.ts} +0 -0
- /package/{sdk/index.d.ts → index.d.ts} +0 -0
- /package/{sdk/index.js → index.js} +0 -0
- /package/{sdk/math.d.ts → math.d.ts} +0 -0
- /package/{sdk/math.js → math.js} +0 -0
- /package/{sdk/message → message}/unfurleventmessage.d.ts +0 -0
- /package/{sdk/message → message}/unfurleventmessage.js +0 -0
- /package/{sdk/ui → ui}/alertmodal.d.ts +0 -0
- /package/{sdk/ui → ui}/alertmodal.js +0 -0
- /package/{sdk/ui → ui}/iframeui.d.ts +0 -0
- /package/{sdk/ui → ui}/iframeui.js +0 -0
- /package/{sdk/ui → ui}/menu.d.ts +0 -0
- /package/{sdk/ui → ui}/menu.js +0 -0
- /package/{sdk/ui → ui}/modal.d.ts +0 -0
- /package/{sdk/ui → ui}/modal.js +0 -0
- /package/{sdk/ui → ui}/panel.d.ts +0 -0
- /package/{sdk/ui → ui}/panel.js +0 -0
- /package/{sdk/ui → ui}/viewport.d.ts +0 -0
- /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
|
-
|
|
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, '
|
|
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, '
|
|
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, '
|
|
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, '
|
|
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, '
|
|
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, '
|
|
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, '
|
|
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
|
-
|
|
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.
|
|
3
|
+
"version": "0.0.140",
|
|
4
4
|
"description": "Utility classes for writing Lucid Software editor extensions",
|
|
5
|
-
"main": "
|
|
6
|
-
"types": "
|
|
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
|
|
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
|
/package/{sdk/math.js → math.js}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/{sdk/ui → ui}/menu.d.ts
RENAMED
|
File without changes
|
/package/{sdk/ui → ui}/menu.js
RENAMED
|
File without changes
|
|
File without changes
|
/package/{sdk/ui → ui}/modal.js
RENAMED
|
File without changes
|
|
File without changes
|
/package/{sdk/ui → ui}/panel.js
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|