@iebh/tera-fy 2.3.2 → 2.3.3

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/eslint.config.js CHANGED
@@ -1,4 +1,4 @@
1
- import { globalIgnores} from "eslint/config";
1
+ import {globalIgnores} from 'eslint/config';
2
2
  import RulesMFDC, {JSCommon} from '@momsfriendlydevco/eslint-config';
3
3
  import tseslint from 'typescript-eslint';
4
4
  import globals from 'globals';
@@ -80,7 +80,6 @@ export default tseslint.config(
80
80
  ...(['rhino', 'slab', 'snow'].includes(process.env.NODE_ENV) ? [{
81
81
  rules: {
82
82
  'no-undef': 'warn',
83
- 'no-unused-vars': 'off', // Dupe of '@typescript-eslint/no-unused-vars'
84
83
  'prefer-const': 'off',
85
84
  '@typescript-eslint/ban-ts-comment': 'off', // Allow `// @ts-ignore`
86
85
  '@typescript-eslint/no-explicit-any': 'off', // Stop complaining about `:any` definitions
@@ -89,8 +88,6 @@ export default tseslint.config(
89
88
  '@typescript-eslint/no-unsafe-call': 'off',
90
89
  '@typescript-eslint/no-unsafe-member-access': 'off',
91
90
  '@typescript-eslint/no-unsafe-return': 'off',
92
- '@typescript-eslint/no-unused-vars': 'warn',
93
- '@typescript-eslint/no-unnecessary-type-assertion': 'warn',
94
91
  'unicorn/numeric-separators-style': 'warn',
95
92
  },
96
93
  }] : []),
@@ -134,7 +134,7 @@ export default class Syncro {
134
134
  * @property {Object} context Additional named parameters to pass to callbacks like initState
135
135
  */
136
136
  config = {
137
- heartbeatInterval: 50_000 as number, //~= 50s
137
+ heartbeatInterval: 120_000 as number, //~= 120s / 2m
138
138
  syncroRegistryUrl: 'https://tera-tools.com/api/sync' as string,
139
139
  context: {} as Record<string, any>,
140
140
  };
@@ -745,11 +745,14 @@ export default class TeraFy {
745
745
 
746
746
  /**
747
747
  * Inject all server methods defined in `methods` as local functions wrapped in the `rpc` function
748
+ *
749
+ * @returns {Promise} A promise which resolves when the operation has completed
748
750
  */
749
751
  injectMethods() {
750
752
  this.methods.forEach(method =>
751
753
  (this as any)[method] = this.rpc.bind(this, method)
752
754
  );
755
+ return Promise.resolve();
753
756
  }
754
757
  // }}}
755
758
 
@@ -494,6 +494,7 @@ export default class TeraFyServer {
494
494
  * @returns {Promise<User>} A promise which will resolve if the there is a user and they are logged in
495
495
  */
496
496
  requireUser(): Promise<any> {
497
+ /* eslint-disable @typescript-eslint/only-throw-error */
497
498
  let user: any; // Last getUser() response
498
499
  return Promise.resolve() // NOTE: This promise is upside down, it only continues down the chain if the user is NOT valid, otherwise it throws to exit
499
500
  .then(()=> this.getUser())
@@ -508,6 +509,7 @@ export default class TeraFyServer {
508
509
  })
509
510
  .then(async ()=> { // No user present - try to validate with other methods
510
511
  switch (this.settings.serverMode) {
512
+
511
513
  case TeraFyServer.SERVERMODE_EMBEDDED:
512
514
  /* - Doesn't work because Kinde sets the CSP header `frame-ancestors 'self'` which prevents usage within an iFrame
513
515
  const $auth = app.service('$auth');
@@ -526,6 +528,8 @@ export default class TeraFyServer {
526
528
  // Go back to start of auth checking loop and repull the user data
527
529
  throw 'REDO';
528
530
  }
531
+ break;
532
+
529
533
  default:
530
534
  // Pass - Implied - Cannot authenticate via other method so just fall through to scalding the user
531
535
  }
@@ -648,7 +652,7 @@ export default class TeraFyServer {
648
652
  this.debug('INFO', 3, 'Received user auth from popup window', {'$auth.user': $auth.user});
649
653
 
650
654
  // Store local copy of user image - this only applies to dev mode (localhost connecting to embed) so we can ignore the security implications here
651
- Promise.resolve()
655
+ Promise.resolve() // eslint-disable-line @typescript-eslint/no-floating-promises
652
656
  .then(()=> this.getUser({
653
657
  forceRetry: false, // Avoid loops
654
658
  waitPromises: false, // We have a partially resolved state so we don't care about outer promises resolving
@@ -796,6 +800,8 @@ export default class TeraFyServer {
796
800
  reject(e);
797
801
  }
798
802
  })
803
+
804
+ // eslint-disable-next-line @typescript-eslint/no-floating-promises
799
805
  askProject(); // Kick off intial project loop
800
806
  })
801
807
  .then(async (project: any) => {
@@ -1425,7 +1431,8 @@ export default class TeraFyServer {
1425
1431
 
1426
1432
  return Promise.resolve()
1427
1433
  .then(()=> {
1428
- settings.autoRequire && this.requireProject()
1434
+ if (settings.autoRequire)
1435
+ return this.requireProject();
1429
1436
  })
1430
1437
  .then((): Promise<string> => { // Ensure the promise returns a string (fileId)
1431
1438
  if (settings.id) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iebh/tera-fy",
3
- "version": "2.3.2",
3
+ "version": "2.3.3",
4
4
  "description": "TERA website worker",
5
5
  "scripts": {
6
6
  "dev": "esbuild --platform=browser --format=esm --bundle lib/terafy.client.ts --outfile=dist/terafy.js --minify --serve --servedir=.",
@@ -104,38 +104,38 @@
104
104
  "node": ">=18"
105
105
  },
106
106
  "dependencies": {
107
- "@iebh/supabasey": "^1.1.4",
107
+ "@iebh/supabasey": "^1.1.7",
108
108
  "@momsfriendlydevco/marshal": "^2.2.0",
109
109
  "detect-port": "^2.1.0",
110
- "filesize": "^10.1.6",
110
+ "filesize": "^11.0.13",
111
111
  "http-proxy": "^1.18.1",
112
- "lodash-es": "^4.17.21",
112
+ "lodash-es": "^4.17.23",
113
113
  "mitt": "^3.0.1",
114
- "nanoid": "^5.1.2",
115
- "p-retry": "^6.2.1",
114
+ "nanoid": "^5.1.6",
115
+ "p-retry": "^7.1.1",
116
116
  "release-it": "^19.2.4",
117
- "uuid": "^11.1.0"
117
+ "uuid": "^13.0.0"
118
118
  },
119
119
  "devDependencies": {
120
120
  "@momsfriendlydevco/eslint-config": "^2.3.1",
121
121
  "@release-it/conventional-changelog": "^10.0.5",
122
122
  "@types/detect-port": "^2.0.0",
123
- "@types/http-proxy": "^1.17.16",
123
+ "@types/http-proxy": "^1.17.17",
124
124
  "@types/lodash-es": "^4.17.12",
125
- "@types/node": "^24.3.0",
126
- "@types/uuid": "^10.0.0",
127
- "@typescript-eslint/eslint-plugin": "^8.41.0",
128
- "@typescript-eslint/parser": "^8.41.0",
129
- "concurrently": "^9.1.2",
130
- "conventional-changelog-eslint": "^6.0.0",
125
+ "@types/node": "^25.4.0",
126
+ "@types/uuid": "^11.0.0",
127
+ "@typescript-eslint/eslint-plugin": "^8.57.0",
128
+ "@typescript-eslint/parser": "^8.57.0",
129
+ "concurrently": "^9.2.1",
130
+ "conventional-changelog-eslint": "^6.1.0",
131
131
  "documentation": "^14.0.3",
132
- "esbuild": "^0.25.0",
133
- "eslint": "^9.34.0",
132
+ "esbuild": "^0.27.3",
133
+ "eslint": "^10.0.3",
134
134
  "eslint-plugin": "^1.0.1",
135
- "globals": "^16.5.0",
136
- "nodemon": "^3.1.9",
137
- "typescript": "^5.9.2",
138
- "typescript-eslint": "^8.41.0"
135
+ "globals": "^17.4.0",
136
+ "nodemon": "^3.1.14",
137
+ "typescript": "^5.9.3",
138
+ "typescript-eslint": "^8.57.0"
139
139
  },
140
140
  "peerDependencies": {
141
141
  "@iebh/reflib": "^2.5.4",
@@ -145,7 +145,7 @@
145
145
  },
146
146
  "optionalDependencies": {
147
147
  "just-diff-apply": "^5.5.0",
148
- "vue": "^3.5.13"
148
+ "vue": "^3.5.30"
149
149
  },
150
150
  "release-it": {
151
151
  "git": {