@interopio/fdc3 2.7.1 → 2.8.0

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/dist/fdc3.es.js CHANGED
@@ -4990,6 +4990,9 @@ Decoder$1.lazy;
4990
4990
 
4991
4991
  const nonEmptyStringDecoder$1 = string$1().where((s) => s.length > 0, "Expected a non-empty string");
4992
4992
  const nonNegativeNumberDecoder = number$1().where((num) => num >= 0, "Expected a non-negative number");
4993
+ const regexDecoder = anyJson$1().andThen((value) => {
4994
+ return value instanceof RegExp ? anyJson$1() : fail(`expected a regex, got a ${typeof value}`);
4995
+ });
4993
4996
 
4994
4997
  const intentDefinitionDecoder = object$1({
4995
4998
  name: nonEmptyStringDecoder$1,
@@ -5316,7 +5319,8 @@ class FDC3Service {
5316
5319
  const decoders$1 = {
5317
5320
  common: {
5318
5321
  nonEmptyStringDecoder: nonEmptyStringDecoder$1,
5319
- nonNegativeNumberDecoder
5322
+ nonNegativeNumberDecoder,
5323
+ regexDecoder
5320
5324
  },
5321
5325
  fdc3: {
5322
5326
  allDefinitionsDecoder,
@@ -6248,9 +6252,6 @@ const FDC3StartupContextDecoder = object({
6248
6252
  })
6249
6253
  })
6250
6254
  });
6251
- object({
6252
- channelId: optional(nonEmptyStringDecoder)
6253
- });
6254
6255
  const privateChannelEventTypesDecoder = oneOf(constant("addContextListener"), constant("unsubscribe"), constant("disconnect"));
6255
6256
  const optionalPrivateChannelEventTypesDecoder = optional(privateChannelEventTypesDecoder);
6256
6257
  const optionalFdc3EventTypesDecoder = optional(constant("userChannelChanged"));
@@ -6303,12 +6304,12 @@ class GlueController {
6303
6304
  interopInstance() {
6304
6305
  return this.glue.interop.instance;
6305
6306
  }
6306
- async getApplication(name) {
6307
+ async getApplication(options) {
6307
6308
  const isAppsAPIAvailable = this.isAppsAPIAvailable();
6308
6309
  if (!isAppsAPIAvailable) {
6309
- return this.glue.appManager.application(name);
6310
+ return this.glue.appManager.application(options.name);
6310
6311
  }
6311
- const app = await this.glue.apps.registry.get({ name });
6312
+ const app = await this.glue.apps.registry.get(options);
6312
6313
  return app ?? undefined;
6313
6314
  }
6314
6315
  async getApplicationInstances(appName) {
@@ -6327,6 +6328,21 @@ class GlueController {
6327
6328
  const appInstance = await this.glue.apps.instances.get({ id });
6328
6329
  return appInstance ?? undefined;
6329
6330
  }
6331
+ async getIoCDAppConfiguration(app) {
6332
+ const isAppsAPIAvailable = this.isAppsAPIAvailable();
6333
+ if (!isAppsAPIAvailable) {
6334
+ return app.getConfiguration();
6335
+ }
6336
+ const definition = app.definition;
6337
+ if (definition) {
6338
+ return definition;
6339
+ }
6340
+ const appWithDefinition = await this.glue.apps.registry.get({ name: app.name, includeDefinition: true });
6341
+ if (!appWithDefinition?.definition) {
6342
+ throw new Error(`Application definition for app '${app.name}' could not be found`);
6343
+ }
6344
+ return appWithDefinition.definition;
6345
+ }
6330
6346
  async startApplication({ app, context, waitForInstanceReady }) {
6331
6347
  const isAppsAPIAvailable = this.isAppsAPIAvailable();
6332
6348
  if (!isAppsAPIAvailable) {
@@ -6344,13 +6360,14 @@ class GlueController {
6344
6360
  return this.glue.intents.find(intentFilter);
6345
6361
  }
6346
6362
  async raiseIntent(request) {
6347
- return this.glue.intents.raise(request);
6363
+ const result = await this.glue.intents.raise(request);
6364
+ return result;
6348
6365
  }
6349
6366
  doesFilterHandlersExist() {
6350
6367
  return !!this.glue.intents.filterHandlers;
6351
6368
  }
6352
6369
  async filterHandlers(handlerFilter) {
6353
- if (!this.glue.intents.filterHandlers) {
6370
+ if (!this.doesFilterHandlersExist()) {
6354
6371
  throw new Error("Intents method 'filterHandlers' does not exist");
6355
6372
  }
6356
6373
  return this.glue.intents.filterHandlers(handlerFilter);
@@ -6372,10 +6389,10 @@ class GlueController {
6372
6389
  return myWin.getContext();
6373
6390
  }
6374
6391
  async addIntentListener(intent, handler) {
6375
- if (typeof this.glue.intents.register === "function") {
6376
- return await this.glue.intents.register(intent, handler);
6392
+ if (typeof this.glue.intents.register !== "function") {
6393
+ return this.glue.intents.addIntentListener(intent, handler);
6377
6394
  }
6378
- return this.glue.intents.addIntentListener(intent, handler);
6395
+ return this.glue.intents.register(intent, handler);
6379
6396
  }
6380
6397
  getAllContexts() {
6381
6398
  return this.glue.contexts.all();
@@ -6400,7 +6417,7 @@ class GlueController {
6400
6417
  async getMyChannels() {
6401
6418
  if (!this.glue.channels.getMyChannels) {
6402
6419
  const myChannel = await this.glue.channels.getMy();
6403
- return [myChannel];
6420
+ return myChannel ? [myChannel] : [];
6404
6421
  }
6405
6422
  return this.glue.channels.getMyChannels();
6406
6423
  }
@@ -6449,12 +6466,16 @@ class GlueController {
6449
6466
  return this.glue.channels.get(channelId);
6450
6467
  }
6451
6468
  getMyWindow() {
6452
- const win = this.glue.windows.my();
6453
- const isValidWindow = isValidNonEmptyObject(win);
6469
+ const myWindow = this.glue.windows.my();
6470
+ const isValidWindow = isValidNonEmptyObject(myWindow);
6454
6471
  if (isValidWindow) {
6455
- return win;
6472
+ return myWindow;
6473
+ }
6474
+ const myInstance = this.getMyInteropInstance();
6475
+ if (!myInstance?.instance) {
6476
+ return;
6456
6477
  }
6457
- return this.glue.windows.findById(this.glue.interop.instance.instance);
6478
+ return this.glue.windows.findById(myInstance.instance);
6458
6479
  }
6459
6480
  getMyInteropInstance() {
6460
6481
  return this.glue.interop.instance;
@@ -6548,8 +6569,8 @@ class GlueController {
6548
6569
  async checkIsFdc3DataWrappingSupported() {
6549
6570
  const inBrowserNamespace = this.isRunningInBrowser();
6550
6571
  const methodName = inBrowserNamespace ? BrowserClientControlMethodName : DesktopClientControlMethodName;
6551
- const myServer = this.glue.interop.servers().find((server) => server.instance === this.glue.interop.instance.instance);
6552
- if (!myServer) {
6572
+ const myServer = this.getInteropServers().find((server) => server.instance === this.glue.interop.instance.instance && server.isLocal);
6573
+ if (!myServer || typeof myServer.getMethods !== "function") {
6553
6574
  return false;
6554
6575
  }
6555
6576
  const registersControlMethod = myServer.getMethods().some((method) => method.name === methodName);
@@ -6576,13 +6597,13 @@ class GlueController {
6576
6597
  return this.glue.interop.instance.peerId === updaterId;
6577
6598
  }
6578
6599
  getContextMetadata(updaterId) {
6579
- const instanceServer = this.glue.interop.servers().find((server) => server.peerId === updaterId);
6600
+ const instanceServer = this.getInteropServers().find((server) => server.peerId === updaterId);
6580
6601
  if (!instanceServer) {
6581
6602
  return;
6582
6603
  }
6583
6604
  return {
6584
6605
  source: {
6585
- appId: instanceServer.application ?? instanceServer.applicationName,
6606
+ appId: (instanceServer.application ?? instanceServer.applicationName),
6586
6607
  instanceId: instanceServer.instance
6587
6608
  }
6588
6609
  };
@@ -8423,9 +8444,9 @@ class DesktopAgent {
8423
8444
  async getCurrentChannels() {
8424
8445
  return this.channelsController.getCurrentChannels(generateCommandId());
8425
8446
  }
8426
- async leaveChannel(channelId) {
8427
- nonEmptyStringDecoder.runWithException(channelId);
8428
- return this.channelsController.leave(generateCommandId(), { channelId });
8447
+ async leaveChannel(channel) {
8448
+ nonEmptyStringDecoder.runWithException(channel);
8449
+ return this.channelsController.leave(generateCommandId(), { channel });
8429
8450
  }
8430
8451
  async leaveCurrentChannels() {
8431
8452
  return this.channelsController.leave(generateCommandId());
@@ -8653,7 +8674,7 @@ class IntentsController {
8653
8674
  if (!context && !resultType) {
8654
8675
  return this.convertGlue42IntentToFDC3Intent(searchedGlueIntent);
8655
8676
  }
8656
- const contextType = (context && context.type === fdc3NothingContextType) ? undefined : context?.type;
8677
+ const contextType = context?.type === fdc3NothingContextType ? undefined : context?.type;
8657
8678
  const filteredIntent = this.getGlueIntentWithFilteredHandlers(searchedGlueIntent, { contextType, resultType });
8658
8679
  if (!filteredIntent.handlers.length) {
8659
8680
  throw new Error(ResolveError.NoAppsFound);
@@ -8776,7 +8797,7 @@ class IntentsController {
8776
8797
  this._logger?.warn(`Cannot get prefs due to the following error: ${error}`);
8777
8798
  return;
8778
8799
  }
8779
- const intentPrefs = prefs.data?.intents;
8800
+ const intentPrefs = prefs?.data?.intents;
8780
8801
  if (!intentPrefs) {
8781
8802
  return;
8782
8803
  }
@@ -8805,7 +8826,7 @@ class IntentsController {
8805
8826
  const appName = typeof target === "string" ? target : target.appId;
8806
8827
  const instanceId = typeof target === "string" ? undefined : target.instanceId;
8807
8828
  this.logger?.info(`[${commandId}] - Checking if application with name ${appName} exists`);
8808
- const app = await this.glueController.getApplication(appName);
8829
+ const app = await this.glueController.getApplication({ name: appName, includeDefinition: true, includeInstances: true });
8809
8830
  const serverInstances = this.serverInstanceAsIntentHandler(intent.name);
8810
8831
  if (!app && (typeof target === "string" || !target.instanceId || !serverInstances.length)) {
8811
8832
  throw new Error(ResolveError.TargetAppUnavailable);
@@ -8819,8 +8840,9 @@ class IntentsController {
8819
8840
  this.logger?.log(`[${commandId}] - returning all handlers for intent ${intent.name} and target: ${JSON.stringify(target)}`);
8820
8841
  return { name: intent.name, handlers: validHandlersByApplicationName };
8821
8842
  }
8843
+ const appInstances = app?.instances ?? await (this.glueController.getApplicationInstances(appName));
8822
8844
  const isValidInstanceOfTheApp = app
8823
- ? app.instances.find((inst) => inst.id === instanceId)
8845
+ ? appInstances.find((inst) => inst.id === instanceId)
8824
8846
  : serverInstances.find((inst) => inst.instance === instanceId);
8825
8847
  if (!isValidInstanceOfTheApp) {
8826
8848
  throw new Error(ResolveError.TargetInstanceUnavailable);
@@ -8887,17 +8909,23 @@ class IntentsController {
8887
8909
  }
8888
8910
  async convertGlue42IntentToFDC3Intent(glueIntent) {
8889
8911
  const { name, handlers } = glueIntent;
8912
+ const displayName = handlers.find((handler) => handler.displayName)?.displayName ?? name;
8890
8913
  const apps = await Promise.all(handlers.map(async (handler) => {
8891
8914
  const appName = handler.applicationName;
8892
- const app = await this.glueController.getApplication(appName);
8893
- const icons = (handler.applicationIcon ? [handler.applicationIcon, ...(app?.userProperties.icons ?? [])] : (app?.userProperties.icons ?? [])).filter((icon) => !!icon).map((icon) => ({ src: icon }));
8894
- const images = (app?.userProperties.images ?? []).filter((image) => !!image).map((image) => ({ src: image }));
8915
+ const app = await this.glueController.getApplication({ name: appName, includeDefinition: true });
8916
+ const icons = [app?.icon, ...(app?.userProperties?.icons ?? []), ...(app?.customProperties?.icons ?? [])]
8917
+ .filter((icon) => !!icon)
8918
+ .map((icon) => ({ src: icon }));
8919
+ const images = [...(app?.userProperties?.images ?? []), ...(app?.customProperties?.images ?? [])]
8920
+ .filter((image) => !!image)
8921
+ .map((image) => ({ src: image }));
8922
+ const tooltip = app?.title || app?.userProperties?.tooltip || `${appName} (${handler.type})`;
8895
8923
  return {
8896
8924
  appId: appName,
8897
8925
  instanceId: handler.instanceId,
8898
8926
  name: appName,
8899
8927
  title: handler.applicationTitle || handler.instanceTitle || appName,
8900
- tooltip: app?.userProperties.tooltip ?? `${appName} (${handler.type})`,
8928
+ tooltip,
8901
8929
  description: handler.applicationDescription,
8902
8930
  icons,
8903
8931
  images,
@@ -8905,7 +8933,7 @@ class IntentsController {
8905
8933
  };
8906
8934
  }));
8907
8935
  const appIntent = {
8908
- intent: { name, displayName: handlers[0].displayName || "" },
8936
+ intent: { name, displayName },
8909
8937
  apps
8910
8938
  };
8911
8939
  return appIntent;
@@ -9019,7 +9047,7 @@ class ApplicationsController {
9019
9047
  await this.glueController.gluePromise;
9020
9048
  this.logger?.log(`[${commandId}] - open() invoked with target ${JSON.stringify(target)} ${context ? `and contextType ${context.type}` : ""}`);
9021
9049
  const name = typeof target === "object" ? target.appId : target;
9022
- const app = await this.glueController.getApplication(name);
9050
+ const app = await this.glueController.getApplication({ name });
9023
9051
  if (!app) {
9024
9052
  throw new Error(OpenError.AppNotFound);
9025
9053
  }
@@ -9042,12 +9070,12 @@ class ApplicationsController {
9042
9070
  await this.glueController.gluePromise;
9043
9071
  this.logger?.info(`[${commandId}] - findInstances() invoked with appIdentifier ${JSON.stringify(appIdentifier)}`);
9044
9072
  const { appId } = appIdentifier;
9045
- const app = await this.glueController.getApplication(appId);
9073
+ const app = await this.glueController.getApplication({ name: appId, includeInstances: true, includeDefinition: true });
9046
9074
  if (!app) {
9047
9075
  throw new Error(ResolveError.NoAppsFound);
9048
9076
  }
9049
- const glueInstances = await this.glueController.getApplicationInstances(appId);
9050
- const fdc3Instances = glueInstances.map(glueInst => this.parseGlueInstToAppIdentifier(glueInst));
9077
+ const appInstances = app.instances ?? await this.glueController.getApplicationInstances(appId);
9078
+ const fdc3Instances = appInstances.map(glueInst => this.parseGlueInstToAppIdentifier(glueInst));
9051
9079
  this.logger?.info(`[${commandId}] - ids of opened instances for appIdentifier ${JSON.stringify(appIdentifier)}: ${JSON.stringify(fdc3Instances.map(inst => inst.instanceId))}`);
9052
9080
  return fdc3Instances;
9053
9081
  }
@@ -9055,7 +9083,7 @@ class ApplicationsController {
9055
9083
  await this.glueController.gluePromise;
9056
9084
  this.logger?.info(`[${commandId}] - getAppMetadata() invoked with appIdentifier ${JSON.stringify(appIdentifier)}`);
9057
9085
  const { appId, instanceId } = appIdentifier;
9058
- const app = await this.glueController.getApplication(appId);
9086
+ const app = await this.glueController.getApplication({ name: appId, includeDefinition: true, includeInstances: true });
9059
9087
  if (!app) {
9060
9088
  throw new Error(OpenError.AppNotFound);
9061
9089
  }
@@ -9089,7 +9117,7 @@ class ApplicationsController {
9089
9117
  async getCurrentAppMetadata() {
9090
9118
  const myInstance = this.glueController.interopInstance();
9091
9119
  const myInstanceApplicationName = myInstance.application ?? myInstance.applicationName;
9092
- const myApp = await this.glueController.getApplication(myInstanceApplicationName);
9120
+ const myApp = await this.glueController.getApplication({ name: myInstanceApplicationName, includeDefinition: true });
9093
9121
  if (myApp) {
9094
9122
  return { appId: myApp.name, instanceId: myInstance.instance };
9095
9123
  }
@@ -9103,40 +9131,43 @@ class ApplicationsController {
9103
9131
  };
9104
9132
  }
9105
9133
  async parseGlueAppToAppMetadata(app, instance) {
9106
- const appMetadata = await this.getBaseGlueAppToAppMetadata(app);
9134
+ const inBrowserNamespace = this.glueController.isRunningInBrowser();
9135
+ const appMetadata = inBrowserNamespace
9136
+ ? await this.getBaseGlueAppToAppMetadataInBrowser(app)
9137
+ : await this.getBaseGlueAppToAppMetadataInDesktop(app);
9107
9138
  if (!instance) {
9108
9139
  return appMetadata;
9109
9140
  }
9110
- return this.addInstanceMetadataToAppMetadata(appMetadata, instance);
9141
+ const instanceData = {
9142
+ instanceId: instance.id,
9143
+ instanceMetadata: this.isApplicationInstance(instance) ? instance.interopInstance : instance.agm
9144
+ };
9145
+ return { ...appMetadata, ...instanceData };
9111
9146
  }
9112
- async getBaseGlueAppToAppMetadata(app) {
9113
- const inBrowserNamespace = this.glueController.isRunningInBrowser();
9114
- const appConfiguration = inBrowserNamespace
9115
- ? app.userProperties
9116
- : await app.getConfiguration();
9117
- const icon = inBrowserNamespace
9118
- ? app.icon
9119
- : (await app.getConfiguration()).icon;
9120
- const desktopScreenshots = appConfiguration.customProperties?.screenshots ?? appConfiguration.userProperties?.screenshots;
9121
- const screenshots = inBrowserNamespace
9122
- ? appConfiguration.screenshots
9123
- : desktopScreenshots;
9147
+ async getBaseGlueAppToAppMetadataInDesktop(app) {
9148
+ const appConfiguration = await this.glueController.getIoCDAppConfiguration(app);
9149
+ const screenshots = appConfiguration.customProperties?.screenshots ?? appConfiguration.userProperties?.screenshots;
9124
9150
  return {
9125
- appId: app.name,
9126
- name: app.name,
9127
- version: app.version,
9151
+ appId: appConfiguration.name,
9152
+ name: appConfiguration.name,
9153
+ version: appConfiguration.version,
9128
9154
  description: appConfiguration.description,
9129
- title: app.title,
9130
- icons: icon ? [{ src: icon }] : [],
9155
+ title: appConfiguration.title,
9156
+ icons: appConfiguration.icon ? [{ src: appConfiguration.icon }] : [],
9131
9157
  tooltip: appConfiguration.tooltip,
9132
9158
  screenshots
9133
9159
  };
9134
9160
  }
9135
- addInstanceMetadataToAppMetadata(appMetadata, instance) {
9161
+ async getBaseGlueAppToAppMetadataInBrowser(app) {
9136
9162
  return {
9137
- ...appMetadata,
9138
- instanceId: instance.id,
9139
- instanceMetadata: this.isApplicationInstance(instance) ? instance.interopInstance : instance.agm
9163
+ appId: app.name,
9164
+ name: app.name,
9165
+ version: app.version,
9166
+ description: app.userProperties.description,
9167
+ title: app.title,
9168
+ icons: app.icon ? [{ src: app.icon }] : [],
9169
+ tooltip: app.userProperties.tooltip,
9170
+ screenshots: app.userProperties.screenshots
9140
9171
  };
9141
9172
  }
9142
9173
  isApplicationInstance(instance) {
@@ -9145,7 +9176,7 @@ class ApplicationsController {
9145
9176
  async openAppWithContext(app, context) {
9146
9177
  const guid = nanoid();
9147
9178
  const startContext = this.buildStartContext(context, guid);
9148
- const wrappedPromise = this.createContextListenerWrappedPromise(app);
9179
+ const wrappedPromise = this.createContextListenerWrappedPromise(app.name);
9149
9180
  this.appsStateStore.addOpenAppPromise(guid, wrappedPromise);
9150
9181
  try {
9151
9182
  const glueInst = await this.glueController.startApplication({
@@ -9179,15 +9210,16 @@ class ApplicationsController {
9179
9210
  }
9180
9211
  };
9181
9212
  }
9182
- createContextListenerWrappedPromise(app) {
9213
+ createContextListenerWrappedPromise(appName) {
9183
9214
  let resolve = () => { };
9184
9215
  let reject = () => { };
9216
+ const timeoutMessage = `Timeout of ${this.defaultContextListenerInvokedPromiseTimeout}ms hit waiting for application with appId: ${appName} to register context listener`;
9185
9217
  const promise = promisePlus(() => {
9186
9218
  return new Promise((res, rej) => {
9187
9219
  resolve = res;
9188
9220
  reject = rej;
9189
9221
  });
9190
- }, this.defaultContextListenerInvokedPromiseTimeout, `Timeout of ${this.defaultContextListenerInvokedPromiseTimeout}ms hit waiting for application with appId: ${app.name} to register context listener`);
9222
+ }, this.defaultContextListenerInvokedPromiseTimeout, timeoutMessage);
9191
9223
  return { promise, resolve, reject };
9192
9224
  }
9193
9225
  }
@@ -10045,12 +10077,12 @@ class ChannelsBaseController {
10045
10077
  async leave(commandId, options) {
10046
10078
  await this.initDonePromise;
10047
10079
  this.logger?.info(`[${commandId}] - leave() invoked with options: ${JSON.stringify(options)}`);
10048
- if (!options?.channelId) {
10080
+ if (!options?.channel) {
10049
10081
  this.logger?.info(`[${commandId}] - leaving all channels`);
10050
10082
  return this.glueController.leaveChannel();
10051
10083
  }
10052
10084
  const allIoChannels = await this.glueController.listAllChannels();
10053
- const ioChannelToLeave = allIoChannels.find((ch) => ch.meta.fdc3?.id === options.channelId);
10085
+ const ioChannelToLeave = allIoChannels.find((ch) => ch.meta.fdc3?.id === options.channel);
10054
10086
  if (!ioChannelToLeave) {
10055
10087
  throw new Error(ChannelError.NoChannelFound);
10056
10088
  }
@@ -10249,7 +10281,11 @@ class LegacyDataWrappingChannelsController {
10249
10281
  return context.latest_fdc3_type ? this.parser.parseContextsDataToInitialFDC3Data(context) : null;
10250
10282
  }
10251
10283
  const parsedType = this.parser.mapFDC3TypeToChannelsDelimiter(contextType);
10252
- const { data } = await this.glueController.getChannel(ioChannelName);
10284
+ const ioChannel = await this.glueController.getChannel(ioChannelName);
10285
+ if (!ioChannel) {
10286
+ return null;
10287
+ }
10288
+ const { data } = ioChannel;
10253
10289
  return data?.[`fdc3_${parsedType}`]
10254
10290
  ? this.parser.parseContextsDataToInitialFDC3Data({ data, latest_fdc3_type: parsedType })
10255
10291
  : null;
@@ -10298,6 +10334,9 @@ class NewDataWrappingChannelsController {
10298
10334
  throw new Error(ChannelError.AccessDenied);
10299
10335
  }
10300
10336
  const ioChannel = await this.glueController.getChannel(ioChannelName);
10337
+ if (!ioChannel) {
10338
+ return null;
10339
+ }
10301
10340
  if (!contextType) {
10302
10341
  return ioChannel.data.fdc3 || null;
10303
10342
  }
@@ -10524,9 +10563,10 @@ const fdc3Factory = () => {
10524
10563
  return ioc.fdc3;
10525
10564
  };
10526
10565
 
10527
- var version = "2.7.1";
10566
+ var version = "2.8.0";
10528
10567
 
10529
- const globalScope = typeof process !== "undefined" ? process : window;
10568
+ const inNodeEnv = typeof process !== "undefined" && typeof window === "undefined" && typeof document === "undefined";
10569
+ const globalScope = inNodeEnv ? process : window;
10530
10570
  globalScope.fdc3Info = {
10531
10571
  provider: "io.Connect",
10532
10572
  providerVersion: version,