lucid-extension-sdk 0.0.435 → 0.0.436

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
@@ -46,6 +46,7 @@ export declare const enum CommandName {
46
46
  CalculateHash = "hsh",
47
47
  CanEditPackageSettings = "ceps",
48
48
  CancelDragBlockToCanvas = "cdc",
49
+ CheckUserFlagAssignment = "cufa",
49
50
  Confirm = "c",
50
51
  CreateBlock = "cb",
51
52
  CreateCards = "ca",
@@ -77,6 +78,7 @@ export declare const enum CommandName {
77
78
  GetCurrentPage = "gcp",
78
79
  GetCustomShape = "gcs",
79
80
  GetDataItemField = "gdif",
81
+ GetDeveloperModeStatus = "gdms",
80
82
  GetDocumentAccessPermission = "gdap",
81
83
  GetDocumentChunks = "gdc",
82
84
  GetDocumentId = "gdid",
@@ -252,6 +254,10 @@ export type CommandArgs = {
252
254
  query: CancelDragBlockToCanvasQuery;
253
255
  result: CancelDragBlockToCanvasResult;
254
256
  };
257
+ [CommandName.CheckUserFlagAssignment]: {
258
+ query: CheckUserFlagAssignmentQuery;
259
+ result: CheckUserFlagAssignmentResult;
260
+ };
255
261
  [CommandName.Confirm]: {
256
262
  query: ConfirmQuery;
257
263
  result: ConfirmResult;
@@ -376,6 +382,10 @@ export type CommandArgs = {
376
382
  query: GetDataItemFieldQuery;
377
383
  result: GetDataItemFieldResult;
378
384
  };
385
+ [CommandName.GetDeveloperModeStatus]: {
386
+ query: GetDeveloperModeStatusQuery;
387
+ result: GetDeveloperModeStatusResult;
388
+ };
379
389
  [CommandName.GetDocumentAccessPermission]: {
380
390
  query: GetDocumentAccessPermissionQuery;
381
391
  result: GetDocumentAccessPermissionResult;
@@ -735,6 +745,11 @@ export type AddCardsActions = {
735
745
  /** Create card action */
736
746
  'cc': string;
737
747
  };
748
+ export type AutoSyncSettings = {
749
+ 'h': string;
750
+ 'gsf': string;
751
+ 'sqs'?: string | undefined;
752
+ };
738
753
  export type SerializedFieldConfiguration = {
739
754
  /** Callback to get field definitions for all fields supported by the card integration */
740
755
  'gf': string;
@@ -799,6 +814,8 @@ export type AddCardIntegrationQuery = {
799
814
  } | undefined;
800
815
  /** If specified, add-card settings */
801
816
  'ac'?: AddCardsActions | undefined;
817
+ /** If specified, auto sync settings */
818
+ 'as'?: AutoSyncSettings | undefined;
802
819
  /** Whether to enable dependency mapping for this integration */
803
820
  'sdm'?: boolean;
804
821
  /**
@@ -884,6 +901,10 @@ export type AddCardIntegrationQuery = {
884
901
  'd': string;
885
902
  'cb': string;
886
903
  } | undefined;
904
+ /**
905
+ * whether the user has access to items
906
+ */
907
+ 'hait'?: string | undefined;
887
908
  };
888
909
  export type AddCardIntegrationResult = undefined;
889
910
  /** @ignore */
@@ -1375,6 +1396,8 @@ export type GetDataItemFieldQuery = {
1375
1396
  'f': string;
1376
1397
  };
1377
1398
  export type GetDataItemFieldResult = SerializedFieldType;
1399
+ export type GetDeveloperModeStatusQuery = void;
1400
+ export type GetDeveloperModeStatusResult = boolean;
1378
1401
  export type GetDocumentAccessPermissionQuery = void;
1379
1402
  export type GetDocumentAccessPermissionResult = DocumentAccessPermission;
1380
1403
  export declare enum GetDocumentChunksType {
@@ -1990,4 +2013,9 @@ export type ZOrderQuery = {
1990
2013
  'o': ZOrderOperation;
1991
2014
  };
1992
2015
  export type ZOrderResult = undefined;
2016
+ export type CheckUserFlagAssignmentQuery = {
2017
+ /** The name of the flag that will be checked */
2018
+ 'f': string;
2019
+ };
2020
+ export type CheckUserFlagAssignmentResult = boolean;
1993
2021
  export {};
package/commandtypes.js CHANGED
@@ -23,6 +23,7 @@ exports.commandTitles = new Map([
23
23
  ["b" /* CommandName.Bootstrap */, 'Bootstrap'],
24
24
  ["ceps" /* CommandName.CanEditPackageSettings */, 'CanEditPackageSettings'],
25
25
  ["cdc" /* CommandName.CancelDragBlockToCanvas */, 'CancelDragBlockToCanvas'],
26
+ ["cufa" /* CommandName.CheckUserFlagAssignment */, 'CheckUserFlagAssignment'],
26
27
  ["c" /* CommandName.Confirm */, 'Confirm'],
27
28
  ["cb" /* CommandName.CreateBlock */, 'CreateBlock'],
28
29
  ["cc" /* CommandName.CreateCollection */, 'CreateCollection'],
@@ -50,6 +51,7 @@ exports.commandTitles = new Map([
50
51
  ["gcp" /* CommandName.GetCurrentPage */, 'GetCurrentPage'],
51
52
  ["gcs" /* CommandName.GetCustomShape */, 'GetCustomShape'],
52
53
  ["gdif" /* CommandName.GetDataItemField */, 'GetDataItemField'],
54
+ ["gdms" /* CommandName.GetDeveloperModeStatus */, 'GetDeveloperModeStatus'],
53
55
  ["gdap" /* CommandName.GetDocumentAccessPermission */, 'GetDocumentAccessPermission'],
54
56
  ["gdc" /* CommandName.GetDocumentChunks */, 'GetDocumentChunks'],
55
57
  ["gdid" /* CommandName.GetDocumentId */, 'GetDocumentId'],
@@ -0,0 +1,23 @@
1
+ import { SerializedFieldType } from '../data/serializedfield/serializedfields';
2
+ import { ExtensionCardFieldDefinition, SearchResult } from '../sharedcardintegration/cardintegrationdefinitions';
3
+ export interface CardIntegrationAutoSyncConfig {
4
+ /**
5
+ * The header to display for the integration. For example, the Jira integration displays "JQL query sync"
6
+ */
7
+ header: string;
8
+ /**
9
+ * Callback that should return a single field that users can use to determine which instance, workspace,
10
+ * organization (or any equivalent field for an extension) so that the data source id can be caluclated
11
+ *
12
+ * The value is the syncDataSourceIdNonce. If this is the same no matter what, return a single ExtensionCardField
13
+ * with a single ExtensionCardFieldOption in ExtensionCardField.options
14
+ */
15
+ getSyncDataSourceIdField: (searchSoFar: Map<string, SerializedFieldType>) => Promise<ExtensionCardFieldDefinition[]>;
16
+ /**
17
+ * Perform a search on the query string. This should support pagination.
18
+ *
19
+ * The syncDataSourceIdNonce is provided in otherFields
20
+ * @returns either an error AutoSyncError or an array of issues / tasks / cards represented as an AutoSyncRow
21
+ */
22
+ searchQueryString?: (queryString: string, otherFields: Map<string, SerializedFieldType>, pageNumber: number, nextPageToken: string | undefined) => Promise<SearchResult>;
23
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -23,6 +23,12 @@ export interface SearchParam {
23
23
  'o': number;
24
24
  'l': number;
25
25
  }
26
+ export interface QuerySearchParam {
27
+ 'qs': string;
28
+ 'of': [string, SerializedFieldType][];
29
+ 'pn': number;
30
+ 'npt': string | undefined;
31
+ }
26
32
  /** @ignore */
27
33
  export interface ImportParam {
28
34
  'pks': string[];
@@ -90,4 +96,9 @@ export interface FieldLabelIconsCallbackParam {
90
96
  export interface ImportFromSerializedFieldsCallbackParam {
91
97
  'sf': SerializedFields[];
92
98
  }
99
+ /** @ignore */
100
+ export interface HasAccessToItemsParam {
101
+ 'ek': string;
102
+ 'dk'?: string;
103
+ }
93
104
  export {};
@@ -0,0 +1,18 @@
1
+ import { SerializedFieldConstraint } from '../data/serializedfield/serializedfielddefinition';
2
+ /**
3
+ * Defines whether the current user has access to an item.
4
+ */
5
+ export interface CardUserAccessResult {
6
+ hasPermission: boolean;
7
+ constraints: {
8
+ fieldName: string;
9
+ constraints?: SerializedFieldConstraint[];
10
+ }[];
11
+ }
12
+ export declare function serializeCardUserAccessResult(result: CardUserAccessResult): {
13
+ hp: boolean;
14
+ c: {
15
+ fn: string;
16
+ cs: SerializedFieldConstraint[] | undefined;
17
+ }[];
18
+ };
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.serializeCardUserAccessResult = void 0;
4
+ function serializeCardUserAccessResult(result) {
5
+ return {
6
+ 'hp': result.hasPermission,
7
+ 'c': result.constraints.map((c) => ({
8
+ 'fn': c.fieldName,
9
+ 'cs': c.constraints,
10
+ })),
11
+ };
12
+ }
13
+ exports.serializeCardUserAccessResult = serializeCardUserAccessResult;
@@ -7,7 +7,9 @@ import { SerializedFieldType, SerializedFields } from '../data/serializedfield/s
7
7
  import { ImportCardFromDetails } from '../importcardfromdetails/importcardfromdetails';
8
8
  import { ImportCardFromPastedLinkCallback } from '../importcardfrompastedlink/importcardfrompastedlinkcallback';
9
9
  import { DependenciesForItems, ExtensionCardFieldDefinition, ExtensionFieldConfiguration, ImportResult } from '../sharedcardintegration/cardintegrationdefinitions';
10
+ import { CardIntegrationAutoSyncConfig } from './cardintegrationautosyncconfig';
10
11
  import { CardIntegrationConfig } from './cardintegrationconfig';
12
+ import { CardUserAccessResult } from './carduseraccessresult';
11
13
  import { DependencyMappingPhrasesType } from './dependencymappingphrases';
12
14
  import { LucidCardIntegrationCustomImportModal } from './lucidcardintegrationcustomimportmodal';
13
15
  import { LucidCardIntegrationStandardImportModal } from './lucidcardintegrationstandardimportmodal';
@@ -115,6 +117,10 @@ export declare abstract class LucidCardIntegration {
115
117
  primaryKey: string;
116
118
  }>;
117
119
  };
120
+ /**
121
+ * If specified, allows the user to use query to sync with timelines.
122
+ */
123
+ autoSync?: CardIntegrationAutoSyncConfig;
118
124
  showCardImport(name: string): import("../../commandtypes").ImportCardsResult;
119
125
  showDependencyMapping?: boolean;
120
126
  /**
@@ -143,4 +149,8 @@ export declare abstract class LucidCardIntegration {
143
149
  * the import.
144
150
  */
145
151
  importFromSerializedFields?: (data: SerializedFields[]) => Promise<ImportCardFromDetails>;
152
+ /**
153
+ * @experimental When defined, allows the extension to make cards that the user doesn't have access to view-only.
154
+ */
155
+ hasAccessToItems?: (editedKey: string, dependencyKey: string | undefined) => Promise<CardUserAccessResult>;
146
156
  }
@@ -10,6 +10,7 @@ const checks_1 = require("../checks");
10
10
  const importcardfromdetails_1 = require("../importcardfromdetails/importcardfromdetails");
11
11
  const cardintegrationdefinitions_1 = require("../sharedcardintegration/cardintegrationdefinitions");
12
12
  const cardintegrationconfig_1 = require("./cardintegrationconfig");
13
+ const carduseraccessresult_1 = require("./carduseraccessresult");
13
14
  const lucidcardintegrationcustomimportmodal_1 = require("./lucidcardintegrationcustomimportmodal");
14
15
  class LucidCardIntegrationRegistry {
15
16
  static nextHookName() {
@@ -172,6 +173,7 @@ class LucidCardIntegrationRegistry {
172
173
  },
173
174
  })),
174
175
  'ipsr': searchResult.itemsPerSearchResult,
176
+ 'e': searchResult.error,
175
177
  };
176
178
  }
177
179
  static registerImportCardFromPastedLinkHandler(client, cardIntegration, serialized) {
@@ -341,6 +343,33 @@ class LucidCardIntegrationRegistry {
341
343
  };
342
344
  });
343
345
  }
346
+ if (cardIntegration.autoSync) {
347
+ const autoSync = cardIntegration.autoSync;
348
+ serialized['as'] = {
349
+ 'h': autoSync.header,
350
+ 'gsf': LucidCardIntegrationRegistry.nextHookName(),
351
+ };
352
+ client.registerAction(serialized['as']['gsf'], async ({ 'i': inputSoFar }) => {
353
+ const result = await autoSync.getSyncDataSourceIdField(new Map(inputSoFar));
354
+ return (0, cardintegrationdefinitions_1.serializeCardFieldArrayDefinition)(result);
355
+ });
356
+ if (autoSync.searchQueryString) {
357
+ serialized['as']['sqs'] = LucidCardIntegrationRegistry.nextHookName();
358
+ client.registerAction(serialized['as']['sqs'], async ({ 'qs': queryString, 'of': otherFields, 'pn': pageNumber, 'npt': nextPageToken, }) => {
359
+ var _a;
360
+ const result = await ((_a = autoSync.searchQueryString) === null || _a === void 0 ? void 0 : _a.call(autoSync, queryString, new Map(otherFields), pageNumber, nextPageToken));
361
+ if (result) {
362
+ return this.serializeSearchResult(result);
363
+ }
364
+ else {
365
+ return this.serializeSearchResult({
366
+ searchResults: [],
367
+ error: 'Unknown Error Occurred',
368
+ });
369
+ }
370
+ });
371
+ }
372
+ }
344
373
  if (cardIntegration.fieldConfiguration.customFieldDisplaySettings) {
345
374
  serialized['fc']['cfds'] = {
346
375
  'd': cardIntegration.fieldConfiguration.customFieldDisplaySettings.defaultToMultilineText,
@@ -358,6 +387,14 @@ class LucidCardIntegrationRegistry {
358
387
  return (0, importcardfromdetails_1.serializeImportCardFromDetails)(result);
359
388
  });
360
389
  }
390
+ if (cardIntegration.hasAccessToItems) {
391
+ const hasAccessToItemsActionName = LucidCardIntegrationRegistry.nextHookName();
392
+ serialized['hait'] = hasAccessToItemsActionName;
393
+ client.registerAction(hasAccessToItemsActionName, async ({ 'ek': editedKey, 'dk': dependencyKey }) => {
394
+ const result = await cardIntegration.hasAccessToItems(editedKey, dependencyKey);
395
+ return (0, carduseraccessresult_1.serializeCardUserAccessResult)(result);
396
+ });
397
+ }
361
398
  client.sendCommand("aci" /* CommandName.AddCardIntegration */, serialized);
362
399
  }
363
400
  }
@@ -1,10 +1,10 @@
1
- import { SerializedLucidDictionary } from './serializedfield/serializedfields';
1
+ import { SerializedLucidIconData } from './serializedfield/serializedfields';
2
2
  /**
3
- * Creates icon data as a SerializedLucidDictionary.
3
+ * Creates icon data as a SerializedLucidIconData.
4
4
  * Useful for creating icons in extensions built on the Lucid Extension SDK that need to be parsed by Lucid's products.
5
5
  * @param icon - The URL or SVG data for the icon
6
6
  * @param ariaLabel - The accessible label for the icon
7
7
  * @param tooltipLabel - Optional tooltip text
8
- * @returns A SerializedLucidDictionary with the keys: icon, ariaLabel, and tooltipLabel (if provided)
8
+ * @returns A SerializedLucidIconData with the keys: icon, ariaLabel, and tooltipLabel (if provided)
9
9
  */
10
- export declare function createLucidIconData(icon: string, ariaLabel: string, tooltipLabel?: string): SerializedLucidDictionary;
10
+ export declare function createLucidIconData(icon: string, ariaLabel: string, tooltipLabel?: string): SerializedLucidIconData;
@@ -2,12 +2,12 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createLucidIconData = void 0;
4
4
  /**
5
- * Creates icon data as a SerializedLucidDictionary.
5
+ * Creates icon data as a SerializedLucidIconData.
6
6
  * Useful for creating icons in extensions built on the Lucid Extension SDK that need to be parsed by Lucid's products.
7
7
  * @param icon - The URL or SVG data for the icon
8
8
  * @param ariaLabel - The accessible label for the icon
9
9
  * @param tooltipLabel - Optional tooltip text
10
- * @returns A SerializedLucidDictionary with the keys: icon, ariaLabel, and tooltipLabel (if provided)
10
+ * @returns A SerializedLucidIconData with the keys: icon, ariaLabel, and tooltipLabel (if provided)
11
11
  */
12
12
  function createLucidIconData(icon, ariaLabel, tooltipLabel) {
13
13
  return {
@@ -139,7 +139,15 @@ export declare const isSerializedTimeObject: (subject: unknown) => subject is im
139
139
  minutes: (x: unknown) => x is number | undefined;
140
140
  seconds: (x: unknown) => x is number | undefined;
141
141
  }>;
142
- export declare const isSerializedLucidIconDataDictionary: (subject: unknown) => subject is import("../../guards").DestructureGuardedTypeObj<{
142
+ export type SerializedLucidIconData = {
143
+ 'dict': {
144
+ 'icon': string;
145
+ 'ariaLabel': string;
146
+ 'tooltipLabel'?: string | undefined;
147
+ 'roundedIcon'?: boolean | undefined;
148
+ };
149
+ };
150
+ export declare const isSerializedLucidIconData: (subject: unknown) => subject is import("../../guards").DestructureGuardedTypeObj<{
143
151
  dict: (subject: unknown) => subject is import("../../guards").DestructureGuardedTypeObj<{
144
152
  icon: typeof isString;
145
153
  ariaLabel: typeof isString;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isSerializedFields = exports.isSerializedJsonFieldType = exports.isSerializedFieldType = exports.isSerializedLucidIconDataDictionary = exports.isSerializedTimeObject = exports.isSerializedLucidDateRangeObject = exports.isSerializedLucidDateObject = exports.isSerializedIsoDateObject = exports.isSerializedMillisecondsDateObject = exports.isSerializedLucidAvatarDataDictionary = exports.isSerializedLucidCurrency = exports.isSerializedLucidDictionary = exports.isJsonSerializedLucidDictionary = exports.isNestedSerializedLucidDictionary = exports.isSerializedColorObjectFieldType = void 0;
3
+ exports.isSerializedFields = exports.isSerializedJsonFieldType = exports.isSerializedFieldType = exports.isSerializedLucidIconData = exports.isSerializedTimeObject = exports.isSerializedLucidDateRangeObject = exports.isSerializedLucidDateObject = exports.isSerializedIsoDateObject = exports.isSerializedMillisecondsDateObject = exports.isSerializedLucidAvatarDataDictionary = exports.isSerializedLucidCurrency = exports.isSerializedLucidDictionary = exports.isJsonSerializedLucidDictionary = exports.isNestedSerializedLucidDictionary = exports.isSerializedColorObjectFieldType = void 0;
4
4
  const checks_1 = require("../../checks");
5
5
  const validators_1 = require("../../validators/validators");
6
6
  function isSerializedColorObjectFieldType(value) {
@@ -44,7 +44,7 @@ exports.isSerializedTimeObject = (0, validators_1.objectValidator)({
44
44
  'minutes': (0, validators_1.option)(checks_1.isNumber),
45
45
  'seconds': (0, validators_1.option)(checks_1.isNumber),
46
46
  });
47
- exports.isSerializedLucidIconDataDictionary = (0, validators_1.objectValidator)({
47
+ exports.isSerializedLucidIconData = (0, validators_1.objectValidator)({
48
48
  'dict': (0, validators_1.objectValidator)({
49
49
  'icon': checks_1.isString,
50
50
  'ariaLabel': checks_1.isString,
@@ -64,7 +64,7 @@ function isSerializedFieldType(value) {
64
64
  (0, exports.isSerializedLucidDateRangeObject)(value) ||
65
65
  (0, exports.isSerializedTimeObject)(value) ||
66
66
  isSerializedColorObjectFieldType(value) ||
67
- (0, exports.isSerializedLucidIconDataDictionary)(value) ||
67
+ (0, exports.isSerializedLucidIconData)(value) ||
68
68
  (0, exports.isSerializedLucidAvatarDataDictionary)(value));
69
69
  }
70
70
  exports.isSerializedFieldType = isSerializedFieldType;
@@ -7,7 +7,7 @@ import { FieldDescriptor } from '../cardintegration/lucidcardintegration';
7
7
  import { isArray, isString } from '../checks';
8
8
  import { isSerializedFieldTypeDefinition } from '../data/fieldtypedefinition/fieldtypedefinition';
9
9
  import { SerializedFieldDefinition } from '../data/serializedfield/serializedfielddefinition';
10
- import { SerializedFieldType, SerializedLucidDictionary, isSerializedFieldType } from '../data/serializedfield/serializedfields';
10
+ import { SerializedFieldType, SerializedLucidIconData, isSerializedFieldType } from '../data/serializedfield/serializedfields';
11
11
  /** For fields with Option or ApiOption type, the label and value for each available option */
12
12
  export interface ExtensionCardFieldOption {
13
13
  label: string;
@@ -161,6 +161,7 @@ export interface SearchResultPerCollection {
161
161
  export interface SearchResult {
162
162
  searchResults: SearchResultPerCollection[];
163
163
  itemsPerSearchResult?: number | undefined;
164
+ error?: string | undefined;
164
165
  }
165
166
  export declare const isSearchResult: (subject: unknown) => subject is import("../guards").DestructureGuardedTypeObj<{
166
167
  searchResults: typeof isArray;
@@ -275,4 +276,4 @@ export type ExtensionFieldConfiguration = {
275
276
  * Maps item field names to icons that show next to the field labels in the card details panel.
276
277
  * Use the `createLucidIconData()` helper to format the icon data in this map.
277
278
  */
278
- export type ExtensionCardFieldLabelIcons = Map<string, SerializedLucidDictionary>;
279
+ export type ExtensionCardFieldLabelIcons = Map<string, SerializedLucidIconData>;
@@ -1,13 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.patchCollectionIdFromPossibleBranchedCollectionId = exports.branchedCollectionId = void 0;
4
- // LAL-1631: make sure references to this method are correct
5
4
  /** @ignore */
6
5
  function branchedCollectionId(upstreamId) {
7
6
  return upstreamId + '_b';
8
7
  }
9
8
  exports.branchedCollectionId = branchedCollectionId;
10
- // LAL-1631: make sure references to this method are correct
11
9
  /** @ignore */
12
10
  function patchCollectionIdFromPossibleBranchedCollectionId(branchId) {
13
11
  if (branchId && branchId.endsWith('_b')) {
@@ -35,6 +35,13 @@ export declare class DataSourceClient {
35
35
  getMetadata(keys: string[], prefixes?: string[]): Promise<MetadataRecord[]>;
36
36
  /** @ignore until metadata endpoints are made part of the public API */
37
37
  patchMetadata(patches: MetadataPatch[]): Promise<MetadataPatchResponse>;
38
+ /**
39
+ * @ignore as this is primarily an internal-use method.
40
+ * Checks the current value of the given feature flag. This cannot take into account any local overrides, and can
41
+ * only be used for feature flags (not other forms of AB test). This method reads feature flag values from our
42
+ * "frontend" selection of feature flags.
43
+ */
44
+ getFeatureFlagValue(flagName: string): Promise<boolean>;
38
45
  }
39
46
  /**
40
47
  * A version of the DataSourceClient that you can use for any automated tests of your data connector.
@@ -204,6 +204,32 @@ class DataSourceClient {
204
204
  await (0, throwunsuccessful_1.throwUnsuccessful)(response, 'patching data source`s metadata');
205
205
  return { status: 'NoContent' };
206
206
  }
207
+ /**
208
+ * @ignore as this is primarily an internal-use method.
209
+ * Checks the current value of the given feature flag. This cannot take into account any local overrides, and can
210
+ * only be used for feature flags (not other forms of AB test). This method reads feature flag values from our
211
+ * "frontend" selection of feature flags.
212
+ */
213
+ async getFeatureFlagValue(flagName) {
214
+ const flagRequest = await this.fetchMethod(`${this.urls.main}features/frontend`, {
215
+ 'method': 'GET',
216
+ 'headers': {
217
+ 'Content-Type': 'application/json',
218
+ },
219
+ });
220
+ if (!flagRequest.ok) {
221
+ return false;
222
+ }
223
+ const response = await flagRequest.json();
224
+ const featureFlagResponseObjectValidator = (0, validators_1.objectValidator)({
225
+ featureFlags: (0, validators_1.objectOfValidator)(checks_1.isBoolean, checks_1.isString),
226
+ });
227
+ if (!featureFlagResponseObjectValidator(response)) {
228
+ return false;
229
+ }
230
+ const flagValue = response.featureFlags[flagName];
231
+ return !!flagValue;
232
+ }
207
233
  }
208
234
  exports.DataSourceClient = DataSourceClient;
209
235
  /**
package/editorclient.d.ts CHANGED
@@ -361,6 +361,12 @@ export declare class EditorClient {
361
361
  * @hidden
362
362
  */
363
363
  protected listenToEditor(): void;
364
+ /**
365
+ * @ignore Until releasing developer mode
366
+ * Check to know if the editor is currently in developer mode
367
+ * @returns true if the editor is in developer mode, false otherwise
368
+ */
369
+ getDeveloperModeStatus(): boolean;
364
370
  /**
365
371
  * Display an alert modal to the user
366
372
  * @param text Body text to display in the alert modal
@@ -431,5 +437,12 @@ export declare class EditorClient {
431
437
  */
432
438
  /** @ignore because our documentation gets generated incorrectly for an as-yet unknown reason. It seems to refer to the HashAlgorithmEnum with an incorrect link. */
433
439
  hash(algorithm: HashAlgorithmEnum, string: string): string;
440
+ /**
441
+ * @ignore as this is primarily an internal-use method.
442
+ *
443
+ * Checks the current value of the given feature flag for the current user. This takes into
444
+ * account any local overrides, and can only be used for feature flags (not other forms of AB test).
445
+ */
446
+ checkUserFlagAssignment(flagName: string): boolean;
434
447
  constructor();
435
448
  }
package/editorclient.js CHANGED
@@ -615,6 +615,14 @@ class EditorClient {
615
615
  return (_a = this.callbacks.get(msg['id'])) === null || _a === void 0 ? void 0 : _a(msg);
616
616
  });
617
617
  }
618
+ /**
619
+ * @ignore Until releasing developer mode
620
+ * Check to know if the editor is currently in developer mode
621
+ * @returns true if the editor is in developer mode, false otherwise
622
+ */
623
+ getDeveloperModeStatus() {
624
+ return this.sendCommand("gdms" /* CommandName.GetDeveloperModeStatus */, undefined);
625
+ }
618
626
  /**
619
627
  * Display an alert modal to the user
620
628
  * @param text Body text to display in the alert modal
@@ -723,6 +731,15 @@ class EditorClient {
723
731
  hash(algorithm, string) {
724
732
  return this.sendCommand("hsh" /* CommandName.CalculateHash */, { 'a': algorithm, 's': string });
725
733
  }
734
+ /**
735
+ * @ignore as this is primarily an internal-use method.
736
+ *
737
+ * Checks the current value of the given feature flag for the current user. This takes into
738
+ * account any local overrides, and can only be used for feature flags (not other forms of AB test).
739
+ */
740
+ checkUserFlagAssignment(flagName) {
741
+ return this.sendCommand("cufa" /* CommandName.CheckUserFlagAssignment */, { 'f': flagName });
742
+ }
726
743
  constructor() {
727
744
  this.nextId = 0;
728
745
  this.callbacks = new Map();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lucid-extension-sdk",
3
- "version": "0.0.435",
3
+ "version": "0.0.436",
4
4
  "description": "Utility classes for writing Lucid Software editor extensions",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",