aimeat 1.3.1 → 1.3.2

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.
@@ -3261,17 +3261,12 @@
3261
3261
  var config = loadConfig();
3262
3262
  var aimeatUrl = config.aimeatUrl.replace(/\/+$/, '');
3263
3263
 
3264
- // Get auth token and delete
3265
- fetch(aimeatUrl + '/v1/auth/anonymous', { method: 'POST' })
3266
- .then(function(resp) { return resp.json(); })
3267
- .then(function(authJson) {
3268
- var token = authJson.data && authJson.data.token;
3269
- if (!token) throw new Error('Could not get auth token');
3270
- return fetch(aimeatUrl + '/v1/apps/' + encodeURIComponent(app.publishedFilename), {
3271
- method: 'DELETE',
3272
- headers: { 'Authorization': 'Bearer ' + token }
3273
- });
3274
- })
3264
+ var token = getCortexOwnerToken();
3265
+ if (!token) { alert('You must be logged in to delete apps. Sign in first.'); return; }
3266
+ fetch(aimeatUrl + '/v1/apps/' + encodeURIComponent(app.publishedFilename), {
3267
+ method: 'DELETE',
3268
+ headers: { 'Authorization': 'Bearer ' + token }
3269
+ })
3275
3270
  .then(function(resp) { return resp.json(); })
3276
3271
  .then(function(json) {
3277
3272
  if (json.ok) {
@@ -3297,16 +3292,12 @@
3297
3292
  if (!confirm('Delete "' + filename + '" from the server?')) return;
3298
3293
  var config = loadConfig();
3299
3294
  var aimeatUrl = config.aimeatUrl.replace(/\/+$/, '');
3300
- fetch(aimeatUrl + '/v1/auth/anonymous', { method: 'POST' })
3301
- .then(function(resp) { return resp.json(); })
3302
- .then(function(authJson) {
3303
- var token = authJson.data && authJson.data.token;
3304
- if (!token) throw new Error('Could not get auth token');
3305
- return fetch(aimeatUrl + '/v1/apps/' + encodeURIComponent(filename), {
3306
- method: 'DELETE',
3307
- headers: { 'Authorization': 'Bearer ' + token }
3308
- });
3309
- })
3295
+ var token = getCortexOwnerToken();
3296
+ if (!token) { alert('You must be logged in to delete apps. Sign in first.'); return; }
3297
+ fetch(aimeatUrl + '/v1/apps/' + encodeURIComponent(filename), {
3298
+ method: 'DELETE',
3299
+ headers: { 'Authorization': 'Bearer ' + token }
3300
+ })
3310
3301
  .then(function(resp) { return resp.json(); })
3311
3302
  .then(function(json) {
3312
3303
  if (json.ok) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aimeat",
3
- "version": "1.3.1",
3
+ "version": "1.3.2",
4
4
  "description": "AIME AT — AI Memory Exchange and Action Transfer — reference implementation",
5
5
  "type": "module",
6
6
  "main": "dist/src/index.js",