lucid-extension-sdk 0.0.161 → 0.0.163

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.
@@ -6,8 +6,26 @@ import { EditorClient } from '../../editorclient';
6
6
  import { SerializedFieldType } from '../data/serializedfield/serializedfields';
7
7
  import { CardIntegrationConfig } from './cardintegrationconfig';
8
8
  import { ExtensionCardFieldDefinition } from './cardintegrationdefinitions';
9
+ /**
10
+ * Result of searching for data in the import modal
11
+ */
12
+ export interface SearchResult {
13
+ partialImportMetadata?: {
14
+ collectionId: string;
15
+ syncDataSourceId?: string;
16
+ };
17
+ data: CollectionDefinition;
18
+ fields: ExtensionCardFieldDefinition[];
19
+ }
20
+ /**
21
+ * Result of importing data from the import modal
22
+ */
23
+ export interface ImportResult {
24
+ collection: CollectionProxy;
25
+ primaryKeys: string[];
26
+ }
9
27
  export declare abstract class LucidCardIntegration {
10
- private readonly client;
28
+ protected readonly client: EditorClient;
11
29
  constructor(client: EditorClient);
12
30
  /**
13
31
  * Label used to identify the integration, e.g. "Jira", which will be used in menu items, etc.
@@ -100,18 +118,8 @@ export declare abstract class LucidCardIntegration {
100
118
  */
101
119
  importModal?: {
102
120
  getSearchFields: (searchSoFar: Map<string, SerializedFieldType>) => Promise<ExtensionCardFieldDefinition[]>;
103
- search: (fields: Map<string, SerializedFieldType>) => Promise<{
104
- partialImportMetadata?: {
105
- collectionId: string;
106
- syncDataSourceId?: string;
107
- };
108
- data: CollectionDefinition;
109
- fields: ExtensionCardFieldDefinition[];
110
- }>;
111
- import: (primaryKeys: string[], searchFields: Map<string, SerializedFieldType>) => Promise<{
112
- collection: CollectionProxy;
113
- primaryKeys: string[];
114
- }>;
121
+ search: (fields: Map<string, SerializedFieldType>) => Promise<SearchResult>;
122
+ import: (primaryKeys: string[], searchFields: Map<string, SerializedFieldType>) => Promise<ImportResult>;
115
123
  onSetup?: () => Promise<void>;
116
124
  };
117
125
  /**
@@ -21,8 +21,7 @@ class SignatureValidator {
21
21
  * @returns true if the request is valid
22
22
  */
23
23
  validate(body, headers, url) {
24
- const parts = url.split('?');
25
- const params = parts.length > 0 ? parts[1] : '';
24
+ const [, params = ''] = url.split('?');
26
25
  const nonce = headers['x-lucid-rsa-nonce'];
27
26
  const signature = this.dependencies.Buffer.from(headers['x-lucid-signature'], 'base64');
28
27
  const data = this.dependencies.Buffer.from(JSON.stringify(body) + nonce + params);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lucid-extension-sdk",
3
- "version": "0.0.161",
3
+ "version": "0.0.163",
4
4
  "description": "Utility classes for writing Lucid Software editor extensions",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",