@appsemble/cli 0.30.14-test.3 → 0.30.14-test.5

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/README.md CHANGED
@@ -1,9 +1,9 @@
1
- # ![](https://gitlab.com/appsemble/appsemble/-/raw/0.30.14-test.3/config/assets/logo.svg) Appsemble CLI
1
+ # ![](https://gitlab.com/appsemble/appsemble/-/raw/0.30.14-test.5/config/assets/logo.svg) Appsemble CLI
2
2
 
3
3
  > Manage apps and blocks from the command line.
4
4
 
5
5
  [![npm](https://img.shields.io/npm/v/@appsemble/cli)](https://www.npmjs.com/package/@appsemble/cli)
6
- [![GitLab CI](https://gitlab.com/appsemble/appsemble/badges/0.30.14-test.3/pipeline.svg)](https://gitlab.com/appsemble/appsemble/-/releases/0.30.14-test.3)
6
+ [![GitLab CI](https://gitlab.com/appsemble/appsemble/badges/0.30.14-test.5/pipeline.svg)](https://gitlab.com/appsemble/appsemble/-/releases/0.30.14-test.5)
7
7
  [![Prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://prettier.io)
8
8
 
9
9
  ## Table of Contents
@@ -323,5 +323,5 @@ appsemble run-cronjobs --interval 30
323
323
 
324
324
  ## License
325
325
 
326
- [LGPL-3.0-only](https://gitlab.com/appsemble/appsemble/-/blob/0.30.14-test.3/LICENSE.md) ©
326
+ [LGPL-3.0-only](https://gitlab.com/appsemble/appsemble/-/blob/0.30.14-test.5/LICENSE.md) ©
327
327
  [Appsemble](https://appsemble.com)
package/commands/serve.js CHANGED
@@ -54,13 +54,12 @@ export function builder(yargs) {
54
54
  });
55
55
  }
56
56
  export async function handler(argv) {
57
- var _a;
58
57
  setArgv(argv);
59
58
  const appPath = join(process.cwd(), argv.path);
60
59
  const [, , , appsembleApp] = await traverseAppDirectory(appPath, 'development', new FormData());
61
60
  const appRoles = getAppRoles(appsembleApp.definition.security);
62
61
  const passedUserRole = argv['user-role'];
63
- if (passedUserRole && !(appRoles === null || appRoles === void 0 ? void 0 : appRoles.includes(passedUserRole))) {
62
+ if (passedUserRole && !appRoles?.includes(passedUserRole)) {
64
63
  throw appRoles
65
64
  ? new AppsembleError(`The specified role "${passedUserRole}" is not supported by this app. Supported roles are [${appRoles}]`)
66
65
  : new AppsembleError('This app does not support roles');
@@ -71,7 +70,7 @@ export async function handler(argv) {
71
70
  name: 'dev',
72
71
  email: 'dev@example.com',
73
72
  email_verified: true,
74
- role: passedUserRole || ((_a = appSecurity === null || appSecurity === void 0 ? void 0 : appSecurity.default) === null || _a === void 0 ? void 0 : _a.role),
73
+ role: passedUserRole || appSecurity?.default?.role,
75
74
  demo: false,
76
75
  zoneinfo: '',
77
76
  properties: {},
package/lib/app.js CHANGED
@@ -64,7 +64,7 @@ export async function traverseAppDirectory(path, context, formData) {
64
64
  formData.append('iconBackground', rc.iconBackground);
65
65
  gatheredData.iconBackground = rc.iconBackground;
66
66
  }
67
- if (context && has(rc === null || rc === void 0 ? void 0 : rc.context, context)) {
67
+ if (context && has(rc?.context, context)) {
68
68
  discoveredContext = rc.context[context];
69
69
  logger.verbose(`Using context: ${inspect(discoveredContext, { colors: true })}`);
70
70
  }
@@ -169,7 +169,7 @@ async function retrieveContext(path, context) {
169
169
  case '.appsemblerc.yaml':
170
170
  logger.info(`Reading app settings from ${filepath}`);
171
171
  [rc] = await readData(filepath);
172
- if (context && has(rc === null || rc === void 0 ? void 0 : rc.context, context)) {
172
+ if (context && has(rc?.context, context)) {
173
173
  discoveredContext = rc.context[context];
174
174
  logger.verbose(`Using context: ${inspect(discoveredContext, { colors: true })}`);
175
175
  }
@@ -272,7 +272,6 @@ export async function deleteApp({ clientCredentials, id, remote }) {
272
272
  }
273
273
  }
274
274
  export async function publishSeedResources(path, app, remote) {
275
- var _a, _b;
276
275
  const resourcesPath = join(path, 'resources');
277
276
  logger.info(`Publishing seed resources from ${resourcesPath}`);
278
277
  if (existsSync(resourcesPath)) {
@@ -288,7 +287,7 @@ export async function publishSeedResources(path, app, remote) {
288
287
  resourcesToPublish.push({
289
288
  appId: app.id,
290
289
  path: join(resourcesPath, resource.name),
291
- definition: (_a = app.definition.resources) === null || _a === void 0 ? void 0 : _a[name],
290
+ definition: app.definition.resources?.[name],
292
291
  type: name,
293
292
  });
294
293
  }
@@ -300,7 +299,7 @@ export async function publishSeedResources(path, app, remote) {
300
299
  resourcesToPublish.push({
301
300
  appId: app.id,
302
301
  path: join(resourcesPath, resource.name, subResource.name),
303
- definition: (_b = app.definition.resources) === null || _b === void 0 ? void 0 : _b[resource.name],
302
+ definition: app.definition.resources?.[resource.name],
304
303
  type: resource.name,
305
304
  });
306
305
  }
@@ -541,7 +540,6 @@ export async function publishAppConfig(path, app, remote) {
541
540
  * @param format The file format that should be used for the output.
542
541
  */
543
542
  export async function writeAppMessages(path, languages, verify, format) {
544
- var _a, _b;
545
543
  logger.info(`Extracting messages from ${path}`);
546
544
  let app;
547
545
  let i18nDir = join(path, 'i18n');
@@ -640,7 +638,7 @@ export async function writeAppMessages(path, languages, verify, format) {
640
638
  newAppMessages[key] = message;
641
639
  }
642
640
  }
643
- const coreMessages = (_a = oldMessages.core) !== null && _a !== void 0 ? _a : {};
641
+ const coreMessages = oldMessages.core ?? {};
644
642
  for (const [key, value] of Object.entries(coreMessages)) {
645
643
  if (!value || typeof value !== 'string') {
646
644
  throw new AppsembleError(`Invalid translation key: core.${key}`);
@@ -655,7 +653,7 @@ export async function writeAppMessages(path, languages, verify, format) {
655
653
  }
656
654
  }
657
655
  for (const [blockName] of Object.entries(blockMessageKeys)) {
658
- if ((_b = oldMessages.blocks) === null || _b === void 0 ? void 0 : _b[blockName]) {
656
+ if (oldMessages.blocks?.[blockName]) {
659
657
  blockMessages[blockName] = {};
660
658
  for (const [version, oldValues] of Object.entries(oldMessages.blocks[blockName])) {
661
659
  if (!has(blockMessageKeys[blockName], version)) {
@@ -693,17 +691,16 @@ This block version is not used in the app`);
693
691
  * @returns The resolved app ID and remote.
694
692
  */
695
693
  export async function resolveAppIdAndRemote(appPath, name, defaultRemote, defaultAppId) {
696
- var _a;
697
694
  let id = defaultAppId;
698
695
  let resolvedRemote = defaultRemote;
699
696
  if (appPath) {
700
697
  const rcPath = join(appPath, '.appsemblerc.yaml');
701
698
  const [rc] = await readData(rcPath);
702
- const context = (_a = rc.context) === null || _a === void 0 ? void 0 : _a[name];
703
- if (context === null || context === void 0 ? void 0 : context.id) {
704
- id = context === null || context === void 0 ? void 0 : context.id;
699
+ const context = rc.context?.[name];
700
+ if (context?.id) {
701
+ id = context?.id;
705
702
  }
706
- if (context === null || context === void 0 ? void 0 : context.remote) {
703
+ if (context?.remote) {
707
704
  resolvedRemote = context.remote;
708
705
  }
709
706
  }
@@ -721,14 +718,13 @@ export async function resolveAppIdAndRemote(appPath, name, defaultRemote, defaul
721
718
  * @param options The options to use for publishing an app.
722
719
  */
723
720
  export async function publishApp({ clientCredentials, context, dryRun, modifyContext, path, ...options }) {
724
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0;
725
721
  const file = await stat(path);
726
722
  const formData = new FormData();
727
723
  const appsembleContext = await retrieveContext(path, context);
728
724
  let rc;
729
725
  let yaml;
730
726
  let filename = relative(process.cwd(), path);
731
- const variant = (_b = (_a = appsembleContext.variant) !== null && _a !== void 0 ? _a : options.variant) !== null && _b !== void 0 ? _b : context;
727
+ const variant = appsembleContext.variant ?? options.variant ?? context;
732
728
  let appVariantPath = path;
733
729
  if (variant && existsSync(join(path, 'variants', variant))) {
734
730
  await applyAppVariant(path, variant);
@@ -754,20 +750,20 @@ export async function publishApp({ clientCredentials, context, dryRun, modifyCon
754
750
  }
755
751
  filename = join(filename, 'app-definition.yaml');
756
752
  }
757
- const remote = (_c = appsembleContext.remote) !== null && _c !== void 0 ? _c : options.remote;
758
- const organizationId = (_d = appsembleContext.organization) !== null && _d !== void 0 ? _d : options.organization;
759
- const template = (_f = (_e = appsembleContext.template) !== null && _e !== void 0 ? _e : options.template) !== null && _f !== void 0 ? _f : false;
760
- const assetsClonable = (_h = (_g = appsembleContext.assetsClonable) !== null && _g !== void 0 ? _g : options.assetsClonable) !== null && _h !== void 0 ? _h : false;
761
- const demoMode = (_k = (_j = appsembleContext.demoMode) !== null && _j !== void 0 ? _j : options.demoMode) !== null && _k !== void 0 ? _k : false;
762
- const visibility = (_l = appsembleContext.visibility) !== null && _l !== void 0 ? _l : options.visibility;
763
- const iconBackground = (_m = appsembleContext.iconBackground) !== null && _m !== void 0 ? _m : options.iconBackground;
764
- const icon = (_o = options.icon) !== null && _o !== void 0 ? _o : appsembleContext.icon;
765
- const maskableIcon = (_p = options.maskableIcon) !== null && _p !== void 0 ? _p : appsembleContext.maskableIcon;
766
- const sentryDsn = (_q = appsembleContext.sentryDsn) !== null && _q !== void 0 ? _q : options.sentryDsn;
767
- const sentryEnvironment = (_r = appsembleContext.sentryEnvironment) !== null && _r !== void 0 ? _r : options.sentryEnvironment;
768
- const googleAnalyticsId = (_s = appsembleContext.googleAnalyticsId) !== null && _s !== void 0 ? _s : options.googleAnalyticsId;
769
- const assets = (_t = appsembleContext.assets) !== null && _t !== void 0 ? _t : options.assets;
770
- const resources = (_u = appsembleContext.resources) !== null && _u !== void 0 ? _u : options.resources;
753
+ const remote = appsembleContext.remote ?? options.remote;
754
+ const organizationId = appsembleContext.organization ?? options.organization;
755
+ const template = appsembleContext.template ?? options.template ?? false;
756
+ const assetsClonable = appsembleContext.assetsClonable ?? options.assetsClonable ?? false;
757
+ const demoMode = appsembleContext.demoMode ?? options.demoMode ?? false;
758
+ const visibility = appsembleContext.visibility ?? options.visibility;
759
+ const iconBackground = appsembleContext.iconBackground ?? options.iconBackground;
760
+ const icon = options.icon ?? appsembleContext.icon;
761
+ const maskableIcon = options.maskableIcon ?? appsembleContext.maskableIcon;
762
+ const sentryDsn = appsembleContext.sentryDsn ?? options.sentryDsn;
763
+ const sentryEnvironment = appsembleContext.sentryEnvironment ?? options.sentryEnvironment;
764
+ const googleAnalyticsId = appsembleContext.googleAnalyticsId ?? options.googleAnalyticsId;
765
+ const assets = appsembleContext.assets ?? options.assets;
766
+ const resources = appsembleContext.resources ?? options.resources;
771
767
  const appLock = appsembleContext.appLock || 'unlocked';
772
768
  logger.verbose(`App remote: ${remote}`);
773
769
  logger.verbose(`App organization: ${organizationId}`);
@@ -785,12 +781,12 @@ export async function publishApp({ clientCredentials, context, dryRun, modifyCon
785
781
  formData.append('locked', appLock);
786
782
  if (icon) {
787
783
  const realIcon = typeof icon === 'string' ? createReadStream(icon) : icon;
788
- logger.info(`Using icon from ${(_v = realIcon.path) !== null && _v !== void 0 ? _v : 'stdin'}`);
784
+ logger.info(`Using icon from ${realIcon.path ?? 'stdin'}`);
789
785
  formData.append('icon', realIcon);
790
786
  }
791
787
  if (maskableIcon) {
792
788
  const realIcon = typeof maskableIcon === 'string' ? createReadStream(maskableIcon) : maskableIcon;
793
- logger.info(`Using maskable icon from ${(_w = realIcon.path) !== null && _w !== void 0 ? _w : 'stdin'}`);
789
+ logger.info(`Using maskable icon from ${realIcon.path ?? 'stdin'}`);
794
790
  formData.append('maskableIcon', realIcon);
795
791
  }
796
792
  if (sentryDsn) {
@@ -823,7 +819,7 @@ export async function publishApp({ clientCredentials, context, dryRun, modifyCon
823
819
  if (!axios.isAxiosError(error)) {
824
820
  throw error;
825
821
  }
826
- if (((_y = (_x = error.response) === null || _x === void 0 ? void 0 : _x.data) === null || _y === void 0 ? void 0 : _y.message) !== 'App validation failed') {
822
+ if (error.response?.data?.message !== 'App validation failed') {
827
823
  throw error;
828
824
  }
829
825
  throw new AppsembleError(printAxiosError(filename, yaml, error.response.data.data.errors));
@@ -855,7 +851,7 @@ export async function publishApp({ clientCredentials, context, dryRun, modifyCon
855
851
  logger.info(`Successfully published app ${data.definition.name}! 🙌`);
856
852
  logger.info(`App URL: ${protocol}//${data.path}.${data.OrganizationId}.${host}`);
857
853
  logger.info(`App store page: ${new URL(`/apps/${data.id}`, remote)}`);
858
- const rcCollections = (_0 = (_z = rc === null || rc === void 0 ? void 0 : rc.context) === null || _z === void 0 ? void 0 : _z[context]) === null || _0 === void 0 ? void 0 : _0.collections;
854
+ const rcCollections = rc?.context?.[context]?.collections;
859
855
  if (Array.isArray(rcCollections)) {
860
856
  for (const collectionId of rcCollections) {
861
857
  try {
@@ -883,13 +879,12 @@ export async function publishApp({ clientCredentials, context, dryRun, modifyCon
883
879
  * @param argv The command line options used for updating the app.
884
880
  */
885
881
  export async function updateApp({ clientCredentials, context, force, path, ...options }) {
886
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
887
882
  const file = await stat(path);
888
883
  const formData = new FormData();
889
884
  const appsembleContext = await retrieveContext(path, context);
890
885
  let yaml;
891
886
  let filename = relative(process.cwd(), path);
892
- const variant = (_b = (_a = appsembleContext.variant) !== null && _a !== void 0 ? _a : options.variant) !== null && _b !== void 0 ? _b : context;
887
+ const variant = appsembleContext.variant ?? options.variant ?? context;
893
888
  let appVariantPath = path;
894
889
  if (variant && existsSync(join(path, 'variants', variant))) {
895
890
  await applyAppVariant(path, variant);
@@ -914,20 +909,20 @@ export async function updateApp({ clientCredentials, context, force, path, ...op
914
909
  }
915
910
  filename = join(filename, 'app-definition.yaml');
916
911
  }
917
- const remote = (_c = appsembleContext.remote) !== null && _c !== void 0 ? _c : options.remote;
918
- const id = (_d = appsembleContext.id) !== null && _d !== void 0 ? _d : options.id;
919
- const template = (_f = (_e = appsembleContext.template) !== null && _e !== void 0 ? _e : options.template) !== null && _f !== void 0 ? _f : false;
920
- const assetsClonable = (_h = (_g = appsembleContext.assetsClonable) !== null && _g !== void 0 ? _g : options.assetsClonable) !== null && _h !== void 0 ? _h : false;
921
- const demoMode = (_k = (_j = appsembleContext.demoMode) !== null && _j !== void 0 ? _j : options.demoMode) !== null && _k !== void 0 ? _k : false;
922
- const visibility = (_l = appsembleContext.visibility) !== null && _l !== void 0 ? _l : options.visibility;
923
- const iconBackground = (_m = appsembleContext.iconBackground) !== null && _m !== void 0 ? _m : options.iconBackground;
924
- const icon = (_o = options.icon) !== null && _o !== void 0 ? _o : appsembleContext.icon;
925
- const maskableIcon = (_p = options.maskableIcon) !== null && _p !== void 0 ? _p : appsembleContext.maskableIcon;
926
- const sentryDsn = (_q = appsembleContext.sentryDsn) !== null && _q !== void 0 ? _q : options.sentryDsn;
927
- const sentryEnvironment = (_r = appsembleContext.sentryEnvironment) !== null && _r !== void 0 ? _r : options.sentryEnvironment;
928
- const googleAnalyticsId = (_s = appsembleContext.googleAnalyticsId) !== null && _s !== void 0 ? _s : options.googleAnalyticsId;
929
- const resources = (_t = appsembleContext.resources) !== null && _t !== void 0 ? _t : options.resources;
930
- const assets = (_u = appsembleContext.assets) !== null && _u !== void 0 ? _u : options.assets;
912
+ const remote = appsembleContext.remote ?? options.remote;
913
+ const id = appsembleContext.id ?? options.id;
914
+ const template = appsembleContext.template ?? options.template ?? false;
915
+ const assetsClonable = appsembleContext.assetsClonable ?? options.assetsClonable ?? false;
916
+ const demoMode = appsembleContext.demoMode ?? options.demoMode ?? false;
917
+ const visibility = appsembleContext.visibility ?? options.visibility;
918
+ const iconBackground = appsembleContext.iconBackground ?? options.iconBackground;
919
+ const icon = options.icon ?? appsembleContext.icon;
920
+ const maskableIcon = options.maskableIcon ?? appsembleContext.maskableIcon;
921
+ const sentryDsn = appsembleContext.sentryDsn ?? options.sentryDsn;
922
+ const sentryEnvironment = appsembleContext.sentryEnvironment ?? options.sentryEnvironment;
923
+ const googleAnalyticsId = appsembleContext.googleAnalyticsId ?? options.googleAnalyticsId;
924
+ const resources = appsembleContext.resources ?? options.resources;
925
+ const assets = appsembleContext.assets ?? options.assets;
931
926
  const { appLock } = appsembleContext;
932
927
  logger.info(`App id: ${id}`);
933
928
  logger.verbose(`App remote: ${remote}`);
@@ -945,12 +940,12 @@ export async function updateApp({ clientCredentials, context, force, path, ...op
945
940
  formData.append('iconBackground', iconBackground);
946
941
  if (icon) {
947
942
  const realIcon = typeof icon === 'string' ? createReadStream(icon) : icon;
948
- logger.info(`Using icon from ${(_v = realIcon.path) !== null && _v !== void 0 ? _v : 'stdin'}`);
943
+ logger.info(`Using icon from ${realIcon.path ?? 'stdin'}`);
949
944
  formData.append('icon', realIcon);
950
945
  }
951
946
  if (maskableIcon) {
952
947
  const realIcon = typeof maskableIcon === 'string' ? createReadStream(maskableIcon) : maskableIcon;
953
- logger.info(`Using maskable icon from ${(_w = realIcon.path) !== null && _w !== void 0 ? _w : 'stdin'}`);
948
+ logger.info(`Using maskable icon from ${realIcon.path ?? 'stdin'}`);
954
949
  formData.append('maskableIcon', realIcon);
955
950
  }
956
951
  if (sentryDsn) {
@@ -992,7 +987,7 @@ export async function updateApp({ clientCredentials, context, force, path, ...op
992
987
  if (!axios.isAxiosError(error)) {
993
988
  throw error;
994
989
  }
995
- if (((_y = (_x = error.response) === null || _x === void 0 ? void 0 : _x.data) === null || _y === void 0 ? void 0 : _y.message) !== 'App validation failed') {
990
+ if (error.response?.data?.message !== 'App validation failed') {
996
991
  throw error;
997
992
  }
998
993
  throw new AppsembleError(printAxiosError(filename, yaml, error.response.data.data.errors));
package/lib/config.js CHANGED
@@ -135,18 +135,17 @@ function getNodeComments(checker, node) {
135
135
  * @returns A record created from the returned key/value pairs.
136
136
  */
137
137
  function processInterface(iface, checker, convert) {
138
- if (!(iface === null || iface === void 0 ? void 0 : iface.members.length)) {
138
+ if (!iface?.members.length) {
139
139
  return;
140
140
  }
141
141
  const source = iface.getSourceFile().getText();
142
142
  return Object.fromEntries(iface.members.map((member) => {
143
- var _a;
144
143
  const description = getNodeComments(checker, member);
145
144
  if (ts.isIndexSignatureDeclaration(member)) {
146
145
  // Comments aren’t properly extracted for index signatures.
147
146
  const commentRanges = ts.getLeadingCommentRanges(source, member.pos);
148
147
  if (commentRanges) {
149
- const comments = (_a = commentRanges === null || commentRanges === void 0 ? void 0 : commentRanges.map((r) => source.slice(r.pos, r.end))) !== null && _a !== void 0 ? _a : [];
148
+ const comments = commentRanges?.map((r) => source.slice(r.pos, r.end)) ?? [];
150
149
  const [block] = parse(comments[0]);
151
150
  const processedDescription = block.source
152
151
  .map((src) => src.tokens.description)
@@ -178,7 +177,7 @@ function processInterface(iface, checker, convert) {
178
177
  * @returns The action manifest to upload.
179
178
  */
180
179
  function processActions(iface, checker) {
181
- return processInterface(iface, checker, (name, description) => [name !== null && name !== void 0 ? name : '$any', { description }]);
180
+ return processInterface(iface, checker, (name, description) => [name ?? '$any', { description }]);
182
181
  }
183
182
  /**
184
183
  * Get an events object based on TypeScript interface nodes.
@@ -190,11 +189,11 @@ function processActions(iface, checker) {
190
189
  */
191
190
  function processEvents(eventListenerInterface, eventEmitterInterface, checker) {
192
191
  const listen = processInterface(eventListenerInterface, checker, (name, description) => [
193
- name !== null && name !== void 0 ? name : '$any',
192
+ name ?? '$any',
194
193
  { description },
195
194
  ]);
196
195
  const emit = processInterface(eventEmitterInterface, checker, (name, description) => [
197
- name !== null && name !== void 0 ? name : '$any',
196
+ name ?? '$any',
198
197
  { description },
199
198
  ]);
200
199
  return (emit || listen) && { emit, listen };
@@ -67,13 +67,12 @@ export async function updateOrganization({ description, email, icon, id, name, w
67
67
  }
68
68
  }
69
69
  export async function upsertOrganization({ description, email, icon, id, name, website, }) {
70
- var _a;
71
70
  try {
72
71
  await axios.get(`/api/organizations/${id}`);
73
72
  await updateOrganization({ description, email, icon, id, name, website });
74
73
  }
75
74
  catch (error) {
76
- if (axios.isAxiosError(error) && ((_a = error.response) === null || _a === void 0 ? void 0 : _a.status) === 404) {
75
+ if (axios.isAxiosError(error) && error.response?.status === 404) {
77
76
  await createOrganization({ description, email, icon, id, name, website });
78
77
  }
79
78
  else {
package/lib/resource.js CHANGED
@@ -28,11 +28,10 @@ export async function publishResource({ appId, definition, path, publishedResour
28
28
  }
29
29
  else {
30
30
  const response = await axios.post(endpoint, resources.map((resource) => {
31
- var _a, _b, _c;
32
31
  const resourceWithReferences = { ...resource };
33
- for (const [referencedProperty, resourceReference] of Object.entries((_a = definition === null || definition === void 0 ? void 0 : definition.references) !== null && _a !== void 0 ? _a : {})) {
32
+ for (const [referencedProperty, resourceReference] of Object.entries(definition?.references ?? {})) {
34
33
  resourceWithReferences[referencedProperty] =
35
- (_b = publishedResourcesIds[resourceReference.resource]) === null || _b === void 0 ? void 0 : _b[Number((_c = resource[`$${resourceReference.resource}`]) !== null && _c !== void 0 ? _c : -1)];
34
+ publishedResourcesIds[resourceReference.resource]?.[Number(resource[`$${resourceReference.resource}`] ?? -1)];
36
35
  }
37
36
  return resourceWithReferences;
38
37
  }), {
@@ -15,7 +15,6 @@ ${PROMPT} ${COMMAND} @appsemble/server
15
15
  * @returns The exported member.
16
16
  */
17
17
  export async function serverImport(...members) {
18
- var _a;
19
18
  try {
20
19
  // eslint-disable-next-line @typescript-eslint/prefer-ts-expect-error
21
20
  // @ts-ignore Because the the server isn’t built and published, an error is expected here at
@@ -30,7 +29,7 @@ export async function serverImport(...members) {
30
29
  }
31
30
  catch (error) {
32
31
  if (error.code !== 'MODULE_NOT_FOUND' ||
33
- ((_a = error.requireStack) === null || _a === void 0 ? void 0 : _a[0]) !== __filename) {
32
+ error.requireStack?.[0] !== __filename) {
34
33
  throw error;
35
34
  }
36
35
  throw new AppsembleError(INSTALL_MESSAGE);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appsemble/cli",
3
- "version": "0.30.14-test.3",
3
+ "version": "0.30.14-test.5",
4
4
  "description": "The CLI for developing with Appsemble apps and blocks",
5
5
  "keywords": [
6
6
  "app",
@@ -42,9 +42,9 @@
42
42
  "test": "vitest"
43
43
  },
44
44
  "dependencies": {
45
- "@appsemble/node-utils": "0.30.14-test.3",
46
- "@appsemble/types": "0.30.14-test.3",
47
- "@appsemble/utils": "0.30.14-test.3",
45
+ "@appsemble/node-utils": "0.30.14-test.5",
46
+ "@appsemble/types": "0.30.14-test.5",
47
+ "@appsemble/utils": "0.30.14-test.5",
48
48
  "@fortawesome/fontawesome-common-types": "^6.0.0",
49
49
  "@koa/cors": "^4.0.0",
50
50
  "@odata/parser": "^0.2.0",
@@ -87,8 +87,8 @@
87
87
  "yargs": "^17.0.0"
88
88
  },
89
89
  "devDependencies": {
90
- "@appsemble/types": "0.30.14-test.3",
91
- "@appsemble/server": "0.30.14-test.3",
90
+ "@appsemble/types": "0.30.14-test.5",
91
+ "@appsemble/server": "0.30.14-test.5",
92
92
  "bcrypt": "^5.0.0",
93
93
  "axios-test-instance": "^7.0.0",
94
94
  "@types/concat-stream": "^2.0.0",
@@ -105,6 +105,6 @@
105
105
  "keytar": "^7.0.0"
106
106
  },
107
107
  "engines": {
108
- "node": ">=18"
108
+ "node": ">=20"
109
109
  }
110
110
  }
@@ -75,7 +75,7 @@ function parseOdataOrder(query) {
75
75
  }
76
76
  return query.split(/,/g).map((line) => {
77
77
  const [name, direction] = line.split(' ');
78
- return [renameOData(name), direction === null || direction === void 0 ? void 0 : direction.toUpperCase()];
78
+ return [renameOData(name), direction?.toUpperCase()];
79
79
  });
80
80
  }
81
81
  export function parseQuery({ $filter, $orderby }) {
@@ -6,7 +6,7 @@ pages:
6
6
  - name: Example Page A
7
7
  blocks:
8
8
  - type: action-button
9
- version: 0.30.14-test.3
9
+ version: 0.30.14-test.5
10
10
  parameters:
11
11
  icon: arrow-right
12
12
  actions:
@@ -17,7 +17,7 @@ pages:
17
17
  - name: Example Page B
18
18
  blocks:
19
19
  - type: action-button
20
- version: 0.30.14-test.3
20
+ version: 0.30.14-test.5
21
21
  parameters:
22
22
  icon: arrow-left
23
23
  actions:
@@ -2,7 +2,7 @@
2
2
  "private": true,
3
3
  "type": "module",
4
4
  "dependencies": {
5
- "@appsemble/sdk": "0.30.14-test.3",
5
+ "@appsemble/sdk": "0.30.14-test.5",
6
6
  "mini-jsx": "^4.0.0"
7
7
  }
8
8
  }
@@ -2,8 +2,8 @@
2
2
  "private": true,
3
3
  "type": "module",
4
4
  "dependencies": {
5
- "@appsemble/preact": "0.30.14-test.3",
6
- "@appsemble/sdk": "0.30.14-test.3",
5
+ "@appsemble/preact": "0.30.14-test.5",
6
+ "@appsemble/sdk": "0.30.14-test.5",
7
7
  "preact": "^10.0.0"
8
8
  }
9
9
  }
@@ -2,6 +2,6 @@
2
2
  "private": true,
3
3
  "type": "module",
4
4
  "dependencies": {
5
- "@appsemble/sdk": "0.30.14-test.3"
5
+ "@appsemble/sdk": "0.30.14-test.5"
6
6
  }
7
7
  }
@@ -1 +0,0 @@
1
- Test App