@budibase/backend-core 2.28.4 → 2.28.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/dist/index.js CHANGED
@@ -55840,15 +55840,20 @@ function isWorker() {
55840
55840
  function isApps() {
55841
55841
  return environment.SERVICE_TYPE === "apps" /* APPS */;
55842
55842
  }
55843
+ function isQA() {
55844
+ return environment.BUDIBASE_ENVIRONMENT === "QA";
55845
+ }
55843
55846
  var environment = {
55844
55847
  isTest,
55845
55848
  isJest,
55846
55849
  isDev,
55847
55850
  isWorker,
55848
55851
  isApps,
55852
+ isQA,
55849
55853
  isProd: () => {
55850
55854
  return !isDev();
55851
55855
  },
55856
+ BUDIBASE_ENVIRONMENT: process.env.BUDIBASE_ENVIRONMENT,
55852
55857
  JS_BCRYPT: process.env.JS_BCRYPT,
55853
55858
  JWT_SECRET: process.env.JWT_SECRET,
55854
55859
  JWT_SECRET_FALLBACK: process.env.JWT_SECRET_FALLBACK,
@@ -55867,6 +55872,7 @@ var environment = {
55867
55872
  REDIS_CLUSTERED: process.env.REDIS_CLUSTERED,
55868
55873
  MINIO_ACCESS_KEY: process.env.MINIO_ACCESS_KEY,
55869
55874
  MINIO_SECRET_KEY: process.env.MINIO_SECRET_KEY,
55875
+ AWS_SESSION_TOKEN: process.env.AWS_SESSION_TOKEN,
55870
55876
  AWS_REGION: process.env.AWS_REGION,
55871
55877
  MINIO_URL: process.env.MINIO_URL,
55872
55878
  MINIO_ENABLED: process.env.MINIO_ENABLED || 1,
@@ -58610,6 +58616,9 @@ function ObjectStore(bucket, opts = { presigning: false }) {
58610
58616
  Bucket: sanitizeBucket(bucket)
58611
58617
  };
58612
58618
  }
58619
+ if (!environment_default.MINIO_ENABLED && environment_default.AWS_SESSION_TOKEN) {
58620
+ config.sessionToken = environment_default.AWS_SESSION_TOKEN;
58621
+ }
58613
58622
  if (environment_default.MINIO_URL) {
58614
58623
  if (opts.presigning && environment_default.MINIO_ENABLED) {
58615
58624
  config.endpoint = "minio-service";
@@ -59923,13 +59932,21 @@ __export(tenancy_exports, {
59923
59932
  addTenantToUrl: () => addTenantToUrl,
59924
59933
  getTenantDB: () => getTenantDB,
59925
59934
  getTenantIDFromCtx: () => getTenantIDFromCtx,
59926
- isUserInAppTenant: () => isUserInAppTenant
59935
+ isUserInAppTenant: () => isUserInAppTenant,
59936
+ saveTenantInfo: () => saveTenantInfo
59927
59937
  });
59928
59938
 
59929
59939
  // src/tenancy/db.ts
59930
59940
  function getTenantDB(tenantId) {
59931
59941
  return getDB(getGlobalDBName(tenantId));
59932
59942
  }
59943
+ async function saveTenantInfo(tenantInfo) {
59944
+ const db = getTenantDB(tenantInfo.tenantId);
59945
+ return await db.put({
59946
+ _id: "tenant_info",
59947
+ ...tenantInfo
59948
+ });
59949
+ }
59933
59950
 
59934
59951
  // src/tenancy/tenancy.ts
59935
59952
  function addTenantToUrl(url) {
@@ -61776,12 +61793,12 @@ var InMemoryQueue = class {
61776
61793
  * Same callback API as Bull, each callback passed to this will consume messages as they are
61777
61794
  * available. Please note this is a queue service, not a notification service, so each
61778
61795
  * consumer will receive different messages.
61779
- * @param func The callback function which will return a "Job", the same
61780
61796
  * as the Bull API, within this job the property "data" contains the JSON message. Please
61781
61797
  * note this is incredibly limited compared to Bull as in reality the Job would contain
61782
61798
  * a lot more information about the queue and current status of Bull cluster.
61783
61799
  */
61784
- async process(func) {
61800
+ async process(concurrencyOrFunc, func) {
61801
+ func = typeof concurrencyOrFunc === "number" ? func : concurrencyOrFunc;
61785
61802
  this._emitter.on("message", async () => {
61786
61803
  if (this._messages.length <= 0) {
61787
61804
  return;
@@ -62033,6 +62050,7 @@ var cleanupInterval;
62033
62050
  async function cleanup2() {
62034
62051
  for (let queue of QUEUES) {
62035
62052
  await queue.clean(CLEANUP_PERIOD_MS, "completed");
62053
+ await queue.clean(CLEANUP_PERIOD_MS, "failed");
62036
62054
  }
62037
62055
  }
62038
62056
  function createQueue(jobQueue, opts = {}) {