@balena/open-balena-api 31.1.0 → 31.1.1-build-device-types-jsons-sync-only-dts-in-the-db-41dd2d9778d853beca2b387713ba49525ec517af-1

Sign up to get free protection for your applications and to get access to all the features.
@@ -44,6 +44,11 @@ type SyncSettings = {
44
44
  [contractType: string]: SyncSetting;
45
45
  };
46
46
  export declare function setSyncSettings(syncSettings: SyncSettings): void;
47
+ declare const contractTypes: readonly ["arch.sw", "hw.device-manufacturer", "hw.device-family", "hw.device-type"];
48
+ declare let onContractsSynced: ((stats: Partial<Record<(typeof contractTypes)[number], {
49
+ added: unknown[];
50
+ }>>) => void) | undefined;
51
+ export declare const setOnContractsSynced: (callback: typeof onContractsSynced) => void;
47
52
  export declare const synchronizeContracts: (contractRepos: RepositoryInfo[]) => Promise<void>;
48
53
  export declare const startContractSynchronization: () => void;
49
54
  export {};
@@ -61,6 +61,7 @@ const mapModel = async (contractEntry, { includeRawContract, map }, rootApi) =>
61
61
  };
62
62
  const getReversePropMapEntries = (map) => Object.entries(map).filter((entry) => entry[1].isReferencedBy != null);
63
63
  const upsertEntries = async (rootApi, { resource, uniqueKey, map }, reversePropMapEntries, existingData, newData) => {
64
+ const addedContractSlugs = [];
64
65
  await Bluebird.map(newData, async (fullEntry) => {
65
66
  // Has only the fields that the DB's resource has (primitives & FK),
66
67
  // by removing the ReverseNavigationResource properties.
@@ -92,6 +93,7 @@ const upsertEntries = async (rootApi, { resource, uniqueKey, map }, reversePropM
92
93
  body: entryFieldData,
93
94
  options: { returnResource: reversePropMapEntries.length > 0 },
94
95
  });
96
+ addedContractSlugs.push(uniqueFieldValue);
95
97
  }
96
98
  // upsert reverse navigation resources defined inline in the contract
97
99
  for (const [propKey, { isReferencedBy }] of reversePropMapEntries) {
@@ -144,6 +146,7 @@ const upsertEntries = async (rootApi, { resource, uniqueKey, map }, reversePropM
144
146
  console.error(`Failed to synchronize ${fullEntry[uniqueKey]}, skipping...`, err.message);
145
147
  }
146
148
  }, { concurrency: 10 });
149
+ return addedContractSlugs;
147
150
  };
148
151
  const syncContractsToDb = async (type, contracts, syncSettings) => {
149
152
  const typeMap = syncSettings?.[type];
@@ -167,7 +170,17 @@ const syncContractsToDb = async (type, contracts, syncSettings) => {
167
170
  existingEntry[typeMap.uniqueKey],
168
171
  existingEntry,
169
172
  ]));
170
- await upsertEntries(rootApi, typeMap, reversePropMapEntries, existingData, mappedModel);
173
+ return await upsertEntries(rootApi, typeMap, reversePropMapEntries, existingData, mappedModel);
174
+ };
175
+ const contractTypes = [
176
+ 'arch.sw',
177
+ 'hw.device-manufacturer',
178
+ 'hw.device-family',
179
+ 'hw.device-type',
180
+ ];
181
+ let onContractsSynced;
182
+ export const setOnContractsSynced = (callback) => {
183
+ onContractsSynced = callback;
171
184
  };
172
185
  export const synchronizeContracts = async (contractRepos) => {
173
186
  // We want to separate fetching from syncing, since in air-gapped environments the user can
@@ -178,21 +191,20 @@ export const synchronizeContracts = async (contractRepos) => {
178
191
  catch (err) {
179
192
  console.error(`Failed to fetch contracts, skipping...`, err.message);
180
193
  }
194
+ const stats = {};
181
195
  // We don't have automatic dependency resolution, so the order matters here.
182
- for (const contractType of [
183
- 'arch.sw',
184
- 'hw.device-manufacturer',
185
- 'hw.device-family',
186
- 'hw.device-type',
187
- ]) {
196
+ for (const contractType of contractTypes) {
188
197
  try {
189
198
  const contracts = await getContracts(contractType);
190
- await syncContractsToDb(contractType, contracts, globalSyncSettings);
199
+ stats[contractType] = {
200
+ added: await syncContractsToDb(contractType, contracts, globalSyncSettings),
201
+ };
191
202
  }
192
203
  catch (err) {
193
204
  captureException(err, `Failed to synchronize contract type: ${contractType}, skipping...`);
194
205
  }
195
206
  }
207
+ onContractsSynced?.(stats);
196
208
  };
197
209
  export const startContractSynchronization = _.once(() => {
198
210
  const contractRepos = getContractRepos();
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/features/contracts/index.ts"],"names":[],"mappings":"AACA,OAAO,CAAC,MAAM,QAAQ,CAAC;AACvB,OAAO,QAAQ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T,kBAAkB,CAClB;aACD,CAAC;QACH,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACd,gBAAgB,CACf,GAAG,EACH,wCAAwC,YAAY,eAAe,CACnE,CAAC;QACH,CAAC;IACF,CAAC;IACD,iBAAiB,EAAE,CAAC,KAAK,CAAC,CAAC;AAC5B,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE;IACvD,MAAM,aAAa,GAAG,gBAAgB,EAAE,CAAC;IAEzC,kCAAkC;IAClC,WAAW,CACV,cAAc,EACd,aAAa,EACb,KAAK,IAAI,EAAE;QACV,MAAM,oBAAoB,CAAC,aAAa,CAAC,CAAC;IAC3C,CAAC,EACD;QACC,qEAAqE;QACrE,mEAAmE;QACnE,iEAAiE;QACjE,qDAAqD;QACrD,GAAG,EAAE,EAAE,GAAG,OAAO;KACjB,CACD,CAAC;AACH,CAAC,CAAC,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import _ from 'lodash';
2
- import { errors } from '@balena/pinejs';
2
+ import { errors, permissions, sbvrUtils } from '@balena/pinejs';
3
3
  import * as semver from 'balena-semver';
4
4
  const { InternalRequestError } = errors;
5
5
  import { captureException } from '../../infra/error-handling/index.js';
@@ -7,6 +7,7 @@ import { getDeviceTypeJson, getLogoUrl } from './build-info-facade.js';
7
7
  import { getImageKey, IMAGE_STORAGE_PREFIX, listFolders, } from './storage/index.js';
8
8
  import { multiCacheMemoizee } from '../../infra/cache/index.js';
9
9
  import { DEVICE_TYPES_CACHE_LOCAL_TIMEOUT, DEVICE_TYPES_CACHE_TIMEOUT, CONTRACT_ALLOWLIST, IMAGE_STORAGE_DEBUG_REQUEST_ERRORS, } from '../../lib/config.js';
10
+ const { api } = sbvrUtils;
10
11
  function sortBuildIds(ids) {
11
12
  return ids.sort((a, b) => {
12
13
  return (
@@ -39,6 +40,14 @@ const getFirstValidBuild = async (slug, versions) => {
39
40
  export const getDeviceTypes = multiCacheMemoizee(async () => {
40
41
  const result = {};
41
42
  let slugs = await listFolders(IMAGE_STORAGE_PREFIX);
43
+ const rootApi = api.resin.clone({ passthrough: { req: permissions.root } });
44
+ const knownDeviceTypeSlugs = new Set((await rootApi.get({
45
+ resource: 'device_type',
46
+ options: {
47
+ $select: 'slug',
48
+ },
49
+ })).map((dt) => dt.slug));
50
+ slugs = slugs.filter((slug) => knownDeviceTypeSlugs.has(slug));
42
51
  // If there are explicit includes, then everything else is excluded so we need to
43
52
  // filter the slugs list to include only contracts that are in the CONTRACT_ALLOWLIST map
44
53
  if (CONTRACT_ALLOWLIST.size > 0) {
@@ -1 +1 @@
1
- {"version":3,"file":"device-types-list.js","sourceRoot":"","sources":["../../../src/features/device-types/device-types-list.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,QAAQ,CAAC;AAGvB,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,MAAM,EAAE,oBAAoB,EAAE,GAAG,MAAM,CAAC;AAExC,OAAO,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AAEvE,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACvE,OAAO,EACN,WAAW,EACX,oBAAoB,EACpB,WAAW,GACX,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EACN,gCAAgC,EAChC,0BAA0B,EAC1B,kBAAkB,EAClB,kCAAkC,GAClC,MAAM,qBAAqB,CAAC;AAO7B,SAAS,YAAY,CAAC,GAAa;IAClC,OAAO,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;QACxB,OAAO;QACN,4CAA4C;QAC5C,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,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IACtE,CAAC;IACD,OAAO,MAAM,CAAC;AACf,CAAC,EACD;IACC,QAAQ,EAAE,kBAAkB;IAC5B,OAAO,EAAE,IAAI;IACb,SAAS,EAAE,IAAI;IACf,MAAM,EAAE,gCAAgC;CACxC,EACD;IACC,MAAM,EAAE;QACP,QAAQ,EAAE,GAAG;QACb,MAAM,EAAE,0BAA0B;KAClC;IACD,UAAU,EAAE,KAAK;CACjB,CACD,CAAC"}
1
+ {"version":3,"file":"device-types-list.js","sourceRoot":"","sources":["../../../src/features/device-types/device-types-list.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,QAAQ,CAAC;AAGvB,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChE,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,MAAM,EAAE,oBAAoB,EAAE,GAAG,MAAM,CAAC;AAExC,OAAO,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AAEvE,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACvE,OAAO,EACN,WAAW,EACX,oBAAoB,EACpB,WAAW,GACX,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EACN,gCAAgC,EAChC,0BAA0B,EAC1B,kBAAkB,EAClB,kCAAkC,GAClC,MAAM,qBAAqB,CAAC;AAE7B,MAAM,EAAE,GAAG,EAAE,GAAG,SAAS,CAAC;AAO1B,SAAS,YAAY,CAAC,GAAa;IAClC,OAAO,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;QACxB,OAAO;QACN,4CAA4C;QAC5C,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAA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OAAO,CAAC,gBAAgB,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE;gBAC7C,MAAM,CAAC,KAAK,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;YAC9B,CAAC,CAAC,CAAC;QACJ,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACd,gBAAgB,CACf,GAAG,EACH,gDAAgD,IAAI,EAAE,CACtD,CAAC;QACH,CAAC;IACF,CAAC,CAAC,CACF,CAAC;IAEF,IAAI,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QAC5C,MAAM,IAAI,oBAAoB,CAAC,oCAAoC,CAAC,CAAC;IACtE,CAAC;IACD,OAAO,MAAM,CAAC;AACf,CAAC,EACD;IACC,QAAQ,EAAE,kBAAkB;IAC5B,OAAO,EAAE,IAAI;IACb,SAAS,EAAE,IAAI;IACf,MAAM,EAAE,gCAAgC;CACxC,EACD;IACC,MAAM,EAAE;QACP,QAAQ,EAAE,GAAG;QACb,MAAM,EAAE,0BAA0B;KAClC;IACD,UAAU,EAAE,KAAK;CACjB,CACD,CAAC"}
package/dist/index.js CHANGED
@@ -45,7 +45,7 @@ import * as baseAuth from './lib/auth.js';
45
45
  // TODO: This should not be exported
46
46
  import { varListInsert } from './features/device-state/state-get-utils.js';
47
47
  import { setupRequestLogging } from './features/request-logging/index.js';
48
- import { startContractSynchronization } from './features/contracts/index.js';
48
+ import { setOnContractsSynced, startContractSynchronization, } from './features/contracts/index.js';
49
49
  import { addToModel as addUserHasDirectAccessToApplicationToModel } from './features/applications/models/user__has_direct_access_to__application.js';
50
50
  import { getApplicationSlug } from './features/applications/index.js';
51
51
  import * as deviceAdditions from './features/devices/models/device-additions.js';
@@ -160,6 +160,7 @@ export const envVarsConfig = {
160
160
  // Needed so that the augmented `@balena/sbvr-types` typings
161
161
  // automatically become available to consumer projects.
162
162
  import './translations/v6/numeric-big-integer-hack.js';
163
+ import { getDeviceTypes } from './features/device-types/device-types-list.js';
163
164
  export const translations = {
164
165
  v7: {
165
166
  getTranslations: getV7Translations,
@@ -261,6 +262,11 @@ export async function setup(app, options) {
261
262
  // start consuming the API heartbeat state queue...
262
263
  getDeviceOnlineStateManager().start();
263
264
  startContractSynchronization();
265
+ setOnContractsSynced((stats) => {
266
+ if (stats['hw.device-type']?.added.length ?? 0 > 0) {
267
+ void getDeviceTypes.delete();
268
+ }
269
+ });
264
270
  return {
265
271
  app,
266
272
  startServer: _.partial(startServer, app),
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,2CAA2C;AAE3C,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,UAAU,MAAM,aAAa,CAAC;AACrC,OAAO,WAAW,MAAM,kBAAkB,CAAC;AAC3C,OAAO,YAAY,MAAM,cAAc,CAAC;AACxC,OAAO,YAAY,MAAM,eAAe,CAAC;AACzC,OAAO,aAAa,MAAM,gBAAgB,CAAC;AAG3C,OAAO,CAAC,MAAM,QAAQ,CAAC;AACvB,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,KAAK,MAAM,MAAM,cAAc,CAAC;AACvC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAElC,OAAO,KAAK,IAAI,MAAM,gBAAgB,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAO3C,OAAO,KAAK,GAAG,MAAM,8BAA8B,CAAC;AAEpD,MAAM,EAAE,GAAG,EAAE,GAAG,SAAS,CAAC;AAE1B,iCAAiC;AACjC,QAAQ,CAAC,GAAG,CACX,GAAG,CAAC,cAAc,CACjB,KAAK,EAAE,EAAU,EAAE,EAAE,CACpB,MAAM,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC;IACnB,QAAQ,EAAE,MAAM;IAChB,EAAE;IACF,WAAW,EAAE,EAAE,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;IAC3D,CAAC,CAAC,CAAC;IACH,OAAO,CAAC,GAAG,CAAC,uBAAuB,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,iBAAiB,IAAI,EAAE,CAAC,CAAC;IAC1E,OAAO,MAAO,CAAC;AAChB,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@balena/open-balena-api",
3
3
  "description": "Internet of things, Made Simple",
4
- "version": "31.1.0",
4
+ "version": "31.1.1-build-device-types-jsons-sync-only-dts-in-the-db-41dd2d9778d853beca2b387713ba49525ec517af-1",
5
5
  "license": "AGPL-3.0",
6
6
  "repository": {
7
7
  "type": "git",
@@ -166,6 +166,6 @@
166
166
  "loader": "ts-node/esm/transpile-only"
167
167
  },
168
168
  "versionist": {
169
- "publishedAt": "2024-11-08T16:56:44.409Z"
169
+ "publishedAt": "2024-11-08T17:49:40.911Z"
170
170
  }
171
171
  }