podverse-orm 5.1.0-alpha.1 → 5.1.0-alpha.11

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.
Files changed (39) hide show
  1. package/dist/config/index.d.ts +5 -0
  2. package/dist/config/index.d.ts.map +1 -1
  3. package/dist/config/index.js +5 -0
  4. package/dist/db/index.d.ts.map +1 -1
  5. package/dist/db/index.js +0 -2
  6. package/dist/entities/account/account.d.ts +0 -2
  7. package/dist/entities/account/account.d.ts.map +1 -1
  8. package/dist/entities/account/account.js +0 -5
  9. package/dist/entities/clip.d.ts +1 -0
  10. package/dist/entities/clip.d.ts.map +1 -1
  11. package/dist/entities/clip.js +4 -0
  12. package/dist/factories/loggerService.d.ts +3 -0
  13. package/dist/factories/loggerService.d.ts.map +1 -0
  14. package/dist/factories/loggerService.js +9 -0
  15. package/dist/index.d.ts +1 -1
  16. package/dist/index.d.ts.map +1 -1
  17. package/dist/index.js +1 -1
  18. package/dist/lib/password.d.ts +2 -0
  19. package/dist/lib/password.d.ts.map +1 -0
  20. package/dist/lib/password.js +24 -0
  21. package/dist/services/account/account.d.ts.map +1 -1
  22. package/dist/services/account/account.js +3 -2
  23. package/dist/services/archiver.d.ts +2 -0
  24. package/dist/services/archiver.d.ts.map +1 -1
  25. package/dist/services/archiver.js +40 -9
  26. package/dist/services/base/baseManyService.js +3 -3
  27. package/dist/services/base/baseOneService.d.ts.map +1 -1
  28. package/dist/services/base/baseOneService.js +3 -3
  29. package/dist/services/channel/channel.d.ts +2 -1
  30. package/dist/services/channel/channel.d.ts.map +1 -1
  31. package/dist/services/channel/channel.js +14 -4
  32. package/dist/services/deduplicator.d.ts +17 -0
  33. package/dist/services/deduplicator.d.ts.map +1 -0
  34. package/dist/services/deduplicator.js +97 -0
  35. package/dist/services/stats/statsTrackAccountGuid.d.ts.map +1 -1
  36. package/package.json +5 -3
  37. package/dist/entities/account/accountAdminRoles.d.ts +0 -8
  38. package/dist/entities/account/accountAdminRoles.d.ts.map +0 -1
  39. package/dist/entities/account/accountAdminRoles.js +0 -37
@@ -11,5 +11,10 @@ export declare const config: {
11
11
  database: string;
12
12
  ssl_connection: boolean;
13
13
  };
14
+ log: {
15
+ level: string;
16
+ dir: string;
17
+ timer: boolean;
18
+ };
14
19
  };
15
20
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM;;;;;;;;;;;;;CAalB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;CAkBlB,CAAC"}
@@ -13,5 +13,10 @@ exports.config = {
13
13
  read_write_password: process.env.DB_READ_WRITE_PASSWORD || '',
14
14
  database: process.env.DB_DATABASE || 'db',
15
15
  ssl_connection: process.env.DB_SSL_CONNECTION === 'true',
16
+ },
17
+ log: {
18
+ level: process.env.LOG_LEVEL || 'info',
19
+ dir: process.env.LOG_DIR || 'logs',
20
+ timer: process.env.LOG_TIMER === 'true',
16
21
  }
17
22
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/db/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAqB,MAAM,SAAS,CAAC;AAiOxD,eAAO,MAAM,iBAAiB,YAA6B,CAAC;AAC5D,eAAO,MAAM,sBAAsB,YAAkC,CAAC;AAEtE,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,MAAM,GAAG,YAAY,CAAC;CAC/B"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/db/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAqB,MAAM,SAAS,CAAC;AA+NxD,eAAO,MAAM,iBAAiB,YAA6B,CAAC;AAC5D,eAAO,MAAM,sBAAsB,YAAkC,CAAC;AAEtE,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,MAAM,GAAG,YAAY,CAAC;CAC/B"}
package/dist/db/index.js CHANGED
@@ -5,7 +5,6 @@ const typeorm_1 = require("typeorm");
5
5
  const typeorm_naming_strategies_1 = require("typeorm-naming-strategies");
6
6
  const config_1 = require("@orm/config");
7
7
  const account_1 = require("@orm/entities/account/account");
8
- const accountAdminRoles_1 = require("@orm/entities/account/accountAdminRoles");
9
8
  const accountAppStorePurchase_1 = require("@orm/entities/account/accountAppStorePurchase");
10
9
  const accountCredentials_1 = require("@orm/entities/account/accountCredentials");
11
10
  const accountEmailChangeVerification_1 = require("@orm/entities/account/accountEmailChangeVerification");
@@ -111,7 +110,6 @@ const commonConfig = {
111
110
  logging: false,
112
111
  entities: [
113
112
  account_1.Account,
114
- accountAdminRoles_1.AccountAdminRoles,
115
113
  accountAppStorePurchase_1.AccountAppStorePurchase,
116
114
  accountCredentials_1.AccountCredentials,
117
115
  accountEmailChangeVerification_1.AccountEmailChangeVerification,
@@ -1,6 +1,5 @@
1
1
  import { AccountCredentials } from '@orm/entities/account/accountCredentials';
2
2
  import { SharableStatus } from '@orm/entities/sharableStatus';
3
- import { AccountAdminRoles } from './accountAdminRoles';
4
3
  import { AccountAppStorePurchase } from './accountAppStorePurchase';
5
4
  import { AccountFCMDevice } from './accountFCMDevice';
6
5
  import { AccountFollowingAccount } from './accountFollowingAccount';
@@ -20,7 +19,6 @@ export declare class Account {
20
19
  id_text: string;
21
20
  verified: boolean;
22
21
  sharable_status: SharableStatus;
23
- account_admin_roles: AccountAdminRoles;
24
22
  account_app_store_purchases: AccountAppStorePurchase[];
25
23
  account_credentials: AccountCredentials;
26
24
  account_fcm_devices: AccountFCMDevice[];
@@ -1 +1 @@
1
- {"version":3,"file":"account.d.ts","sourceRoot":"","sources":["../../../src/entities/account/account.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,0CAA0C,CAAC;AAC9E,OA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eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAG5D,qBACa,OAAO;IAElB,EAAE,EAAG,MAAM,CAAC;IAGZ,OAAO,EAAG,MAAM,CAAC;IAGjB,QAAQ,EAAG,OAAO,CAAC;IAInB,eAAe,EAAG,cAAc,CAAC;IAGjC,2BAA2B,EAAG,uBAAuB,EAAE,CAAC;IAGxD,mBAAmB,EAAG,kBAAkB,CAAC;IAGzC,mBAAmB,EAAG,gBAAgB,EAAE,CAAC;IAGzC,0BAA0B,EAAG,uBAAuB,EAAE,CAAC;IAGvD,qCAAqC,EAAG,+BAA+B,EAAE,CAAC;IAG1E,0BAA0B,EAAG,uBAAuB,EAAE,CAAC;IAGvD,2BAA2B,EAAG,wBAAwB,EAAE,CAAC;IAGzD,6BAA6B,EAAG,yBAAyB,EAAE,CAAC;IAG5D,yBAAyB,EAAG,uBAAuB,CAAC;IAGpD,6BAA6B,EAAG,0BAA0B,EAAE,CAAC;IAG7D,qBAAqB,EAAG,kBAAkB,EAAE,CAAC;IAG7C,eAAe,EAAG,cAAc,CAAC;IAGjC,sBAAsB,EAAG,oBAAoB,CAAC;IAG9C,kBAAkB,EAAG,eAAe,EAAE,CAAC;IAGvC,oBAAoB,EAAG,mBAAmB,CAAC;IAG3C,cAAc;CAGf"}
@@ -13,7 +13,6 @@ exports.Account = void 0;
13
13
  const typeorm_1 = require("typeorm");
14
14
  const accountCredentials_1 = require("@orm/entities/account/accountCredentials");
15
15
  const sharableStatus_1 = require("@orm/entities/sharableStatus");
16
- const accountAdminRoles_1 = require("./accountAdminRoles");
17
16
  const accountAppStorePurchase_1 = require("./accountAppStorePurchase");
18
17
  const accountFCMDevice_1 = require("./accountFCMDevice");
19
18
  const accountFollowingAccount_1 = require("./accountFollowingAccount");
@@ -52,10 +51,6 @@ __decorate([
52
51
  (0, typeorm_1.JoinColumn)({ name: 'sharable_status_id' }),
53
52
  __metadata("design:type", sharableStatus_1.SharableStatus)
54
53
  ], Account.prototype, "sharable_status", void 0);
55
- __decorate([
56
- (0, typeorm_1.OneToOne)(() => accountAdminRoles_1.AccountAdminRoles, accountAdminRoles => accountAdminRoles.account),
57
- __metadata("design:type", accountAdminRoles_1.AccountAdminRoles)
58
- ], Account.prototype, "account_admin_roles", void 0);
59
54
  __decorate([
60
55
  (0, typeorm_1.OneToMany)(() => accountAppStorePurchase_1.AccountAppStorePurchase, accountAppStorePurchase => accountAppStorePurchase.account),
61
56
  __metadata("design:type", Array)
@@ -5,6 +5,7 @@ export declare class Clip {
5
5
  id: number;
6
6
  id_text: string;
7
7
  account: Account;
8
+ item_id: string;
8
9
  item: Item;
9
10
  start_time: string;
10
11
  end_time?: string | null;
@@ -1 +1 @@
1
- {"version":3,"file":"clip.d.ts","sourceRoot":"","sources":["../../src/entities/clip.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAE1E,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AACxD,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAK/C,qBACa,IAAI;IAEf,EAAE,EAAG,MAAM,CAAC;IAGZ,OAAO,EAAG,MAAM,CAAC;IAIjB,OAAO,EAAG,OAAO,CAAC;IAIlB,IAAI,EAAG,IAAI,CAAC;IAGZ,UAAU,EAAG,MAAM,CAAC;IAGpB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAGzB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAGtB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAI5B,eAAe,EAAG,kBAAkB,CAAC;IAGrC,cAAc;CAGf"}
1
+ {"version":3,"file":"clip.d.ts","sourceRoot":"","sources":["../../src/entities/clip.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAE1E,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AACxD,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAI/C,qBACa,IAAI;IAEf,EAAE,EAAG,MAAM,CAAC;IAGZ,OAAO,EAAG,MAAM,CAAC;IAIjB,OAAO,EAAG,OAAO,CAAC;IAGlB,OAAO,EAAG,MAAM,CAAC;IAIjB,IAAI,EAAG,IAAI,CAAC;IAGZ,UAAU,EAAG,MAAM,CAAC;IAGpB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAGzB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAGtB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAI5B,eAAe,EAAG,kBAAkB,CAAC;IAGrC,cAAc;CAGf"}
@@ -35,6 +35,10 @@ __decorate([
35
35
  (0, typeorm_1.JoinColumn)({ name: 'account_id' }),
36
36
  __metadata("design:type", account_1.Account)
37
37
  ], Clip.prototype, "account", void 0);
38
+ __decorate([
39
+ (0, typeorm_1.Column)(),
40
+ __metadata("design:type", String)
41
+ ], Clip.prototype, "item_id", void 0);
38
42
  __decorate([
39
43
  (0, typeorm_1.ManyToOne)(() => item_1.Item, item => item.id, { onDelete: 'CASCADE' }),
40
44
  (0, typeorm_1.JoinColumn)({ name: 'item_id' }),
@@ -0,0 +1,3 @@
1
+ import { LoggerService } from 'podverse-helpers/dist/lib/backend/logger';
2
+ export declare const loggerService: LoggerService;
3
+ //# sourceMappingURL=loggerService.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loggerService.d.ts","sourceRoot":"","sources":["../../src/factories/loggerService.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,0CAA0C,CAAC;AAEzE,eAAO,MAAM,aAAa,eAGxB,CAAC"}
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.loggerService = void 0;
4
+ const config_1 = require("@orm/config");
5
+ const logger_1 = require("podverse-helpers/dist/lib/backend/logger");
6
+ exports.loggerService = new logger_1.LoggerService({
7
+ logDir: config_1.config.log.dir,
8
+ logLevel: config_1.config.log.level
9
+ });
package/dist/index.d.ts CHANGED
@@ -2,7 +2,6 @@ import './module-alias-config';
2
2
  export * from './config';
3
3
  export * from './db';
4
4
  export * from './entities/account/account';
5
- export * from './entities/account/accountAdminRoles';
6
5
  export * from './entities/account/accountAppStorePurchase';
7
6
  export * from './entities/account/accountCredentials';
8
7
  export * from './entities/account/accountEmailChangeVerification';
@@ -126,6 +125,7 @@ export * from './services/channel/channelTxt';
126
125
  export * from './services/channel/channelValue';
127
126
  export * from './services/channel/channelValueRecipient';
128
127
  export * from './services/clip';
128
+ export * from './services/deduplicator';
129
129
  export * from './services/feed/feed';
130
130
  export * from './services/feed/feedFlagStatus';
131
131
  export * from './services/feed/feedLog';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,uBAAuB,CAAC;AAE/B,cAAc,UAAU,CAAC;AAEzB,cAAc,MAAM,CAAC;AAErB,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sCAAsC,CAAC;AACrD,cAAc,4CAA4C,CAAC;AAC3D,cAAc,uCAAuC,CAAC;AACtD,cAAc,mDAAmD,CAAC;AAClE,cAAc,qCAAqC,CAAC;AACpD,cAAc,4CAA4C,CAAC;AAC3D,cAAc,oDAAoD,CAAC;AACnE,cAAc,4CAA4C,CAAC;AAC3D,cAAc,6CAA6C,CAAC;AAC5D,cAAc,8CAA8C,CAAC;AAC7D,cAAc,sCAAsC,CAAC;AACrD,cAAc,4CAA4C,CAAC;AAC3D,cAAc,+CAA+C,CAAC;AAC9D,cAAc,uCAAuC,CAAC;AACtD,cAAc,mCAAmC,CAAC;AAClD,cAAc,yCAAyC,CAAC;AACxD,cAAc,oCAAoC,CAAC;AACnD,cAAc,wCAAwC,CAAC;AAEvD,cAAc,4BAA4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;AACvC,cAAc,gCAAgC,CAAC;AAE/C,cAAc,yCAAyC,CAAC;AACxD,cAAc,yCAAyC,CAAC;AACxD,cAAc,sCAAsC,CAAC;AACrD,cAAc,sCAAsC,CAAC;AACrD,cAAc,0CAA0C,CAAC;AACzD,cAAc,wCAAwC,CAAC;AACvD,cAAc,yCAAyC,CAAC;AACxD,cAAc,yCAAyC,CAAC;AACxD,cAAc,sCAAsC,CAAC;AACrD,cAAc,sCAAsC,CAAC;AACrD,cAAc,0CAA0C,CAAC"}
package/dist/index.js CHANGED
@@ -18,7 +18,6 @@ require("./module-alias-config");
18
18
  __exportStar(require("./config"), exports);
19
19
  __exportStar(require("./db"), exports);
20
20
  __exportStar(require("./entities/account/account"), exports);
21
- __exportStar(require("./entities/account/accountAdminRoles"), exports);
22
21
  __exportStar(require("./entities/account/accountAppStorePurchase"), exports);
23
22
  __exportStar(require("./entities/account/accountCredentials"), exports);
24
23
  __exportStar(require("./entities/account/accountEmailChangeVerification"), exports);
@@ -142,6 +141,7 @@ __exportStar(require("./services/channel/channelTxt"), exports);
142
141
  __exportStar(require("./services/channel/channelValue"), exports);
143
142
  __exportStar(require("./services/channel/channelValueRecipient"), exports);
144
143
  __exportStar(require("./services/clip"), exports);
144
+ __exportStar(require("./services/deduplicator"), exports);
145
145
  __exportStar(require("./services/feed/feed"), exports);
146
146
  __exportStar(require("./services/feed/feedFlagStatus"), exports);
147
147
  __exportStar(require("./services/feed/feedLog"), exports);
@@ -0,0 +1,2 @@
1
+ export declare function hashPassword(password: string): Promise<string>;
2
+ //# sourceMappingURL=password.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"password.d.ts","sourceRoot":"","sources":["../../src/lib/password.ts"],"names":[],"mappings":"AAEA,wBAAsB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAKpE"}
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.hashPassword = hashPassword;
16
+ const bcrypt_1 = __importDefault(require("bcrypt"));
17
+ function hashPassword(password) {
18
+ return __awaiter(this, void 0, void 0, function* () {
19
+ const saltRounds = 10;
20
+ const salt = yield bcrypt_1.default.genSalt(saltRounds);
21
+ const hashedPassword = yield bcrypt_1.default.hash(password, salt);
22
+ return hashedPassword;
23
+ });
24
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"account.d.ts","sourceRoot":"","sources":["../../../src/services/account/account.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACtE,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAExD,OAAO,EAAyB,kBAAkB,EAAiD,MAAM,kBAAkB,CAAC;AAQ5H,KAAK,gBAAgB,GAAG;IACtB,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,MAAM,CAAA;CACjB,CAAA;AAED,KAAK,gBAAgB,GAAG;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,eAAe,CAAC,EAAE,kBAAkB,CAAC;CACtC,CAAC;AAEF,qBAAa,cAAc;IACzB,SAAS,CAAC,cAAc,EAAE,UAAU,CAAC,OAAO,CAAC,CA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
15
15
  const db_1 = require("@orm/db");
16
16
  const podverse_helpers_2 = require("podverse-helpers");
17
17
  const sharableStatus_1 = require("@orm/entities/sharableStatus");
18
+ const password_1 = require("@orm/lib/password");
18
19
  const accountCredentials_1 = require("./accountCredentials");
19
20
  const accountMembershipStatus_1 = require("./accountMembershipStatus");
20
21
  const accountVerification_1 = require("./accountVerification");
@@ -79,7 +80,7 @@ class AccountService {
79
80
  verified: false
80
81
  });
81
82
  const account = yield this.repositoryReadWrite.save(accountObj);
82
- const saltedPassword = yield (0, podverse_helpers_2.hashPassword)(dto.password);
83
+ const saltedPassword = yield (0, password_1.hashPassword)(dto.password);
83
84
  yield accountCredentialsService.update(account, {
84
85
  email: dto.email,
85
86
  password: saltedPassword
@@ -137,7 +138,7 @@ class AccountService {
137
138
  if (!account) {
138
139
  throw new Error('Account not found');
139
140
  }
140
- const saltedPassword = yield (0, podverse_helpers_2.hashPassword)(newPassword);
141
+ const saltedPassword = yield (0, password_1.hashPassword)(newPassword);
141
142
  const accountCredentialsService = new accountCredentials_1.AccountCredentialsService();
142
143
  yield accountCredentialsService.update(account, {
143
144
  password: saltedPassword
@@ -12,6 +12,8 @@ export declare class ArchiverService {
12
12
  private processItems;
13
13
  processPendingArchiveFeeds(): Promise<void>;
14
14
  processPendingArchiveItems(): Promise<void>;
15
+ getFeedsWithTakedownStatus(): Promise<Feed[]>;
16
+ removeAllItemsForTakedownFeeds(): Promise<void>;
15
17
  archiveAll(): Promise<void>;
16
18
  }
17
19
  //# sourceMappingURL=archiver.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"archiver.d.ts","sourceRoot":"","sources":["../../src/services/archiver.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAE/C,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAK/C,qBAAa,eAAe;IAC1B,OAAO,CAAC,kBAAkB,CAAyC;IACnE,OAAO,CAAC,uBAAuB,CAA8C;IAC7E,OAAO,CAAC,kBAAkB,CAAyC;IACnE,OAAO,CAAC,uBAAuB,CAA8C;IAC7E,OAAO,CAAC,0BAA0B,CAAqD;IACvF,OAAO,CAAC,cAAc,CAAyC;IAEzD,sBAAsB,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;IAsBzC,sBAAsB,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;YAWjC,YAAY;IAmBpB,0BAA0B,IAAI,OAAO,CAAC,IAAI,CAAC;IAkC3C,0BAA0B,IAAI,OAAO,CAAC,IAAI,CAAC;IAY3C,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;CAIlC"}
1
+ {"version":3,"file":"archiver.d.ts","sourceRoot":"","sources":["../../src/services/archiver.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAE/C,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAK/C,qBAAa,eAAe;IAC1B,OAAO,CAAC,kBAAkB,CAAyC;IACnE,OAAO,CAAC,uBAAuB,CAA8C;IAC7E,OAAO,CAAC,kBAAkB,CAAyC;IACnE,OAAO,CAAC,uBAAuB,CAA8C;IAC7E,OAAO,CAAC,0BAA0B,CAAqD;IACvF,OAAO,CAAC,cAAc,CAAyC;IAMzD,sBAAsB,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;IAsBzC,sBAAsB,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;YAWjC,YAAY;IAmBpB,0BAA0B,IAAI,OAAO,CAAC,IAAI,CAAC;IAqC3C,0BAA0B,IAAI,OAAO,CAAC,IAAI,CAAC;IAY3C,0BAA0B,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;IAW7C,8BAA8B,IAAI,OAAO,CAAC,IAAI,CAAC;IAc/C,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;CAKlC"}
@@ -27,6 +27,8 @@ class ArchiverService {
27
27
  this.playlistResourceRepository = db_1.AppDataSourceRead.getRepository(playlistResource_1.PlaylistResource);
28
28
  this.clipRepository = db_1.AppDataSourceRead.getRepository(clip_1.Clip);
29
29
  }
30
+ // TODO: check if archived items no longer have clip or playlist resource relationships
31
+ // TODO: handle spam items
30
32
  getItemsPendingArchive() {
31
33
  return __awaiter(this, void 0, void 0, function* () {
32
34
  return this.itemRepositoryRead.find({
@@ -65,12 +67,12 @@ class ArchiverService {
65
67
  processItems(items, archivedStatus) {
66
68
  return __awaiter(this, void 0, void 0, function* () {
67
69
  for (const item of items) {
68
- const hasPlaylistResource = yield this.playlistResourceRepository.findOne({
70
+ const hasPlaylistResource = !!(yield this.playlistResourceRepository.findOne({
69
71
  where: { item: { id: item.id } },
70
- });
71
- const hasClip = yield this.clipRepository.findOne({
72
+ }));
73
+ const hasClip = !!(yield this.clipRepository.findOne({
72
74
  where: { item: { id: item.id } },
73
- });
75
+ }));
74
76
  if (hasPlaylistResource || hasClip) {
75
77
  item.item_flag_status = archivedStatus;
76
78
  yield this.itemRepositoryReadWrite.save(item);
@@ -100,13 +102,14 @@ class ArchiverService {
100
102
  },
101
103
  relations: ['item_flag_status']
102
104
  });
103
- if (items.length === 0) {
104
- yield this.feedRepositoryReadWrite.delete(feed.id);
105
- }
106
- else {
107
- const activeOrPendingItems = items.filter(item => [itemFlagStatus_1.ItemFlagStatusStatusEnum.Active, itemFlagStatus_1.ItemFlagStatusStatusEnum.PendingArchive].includes(item.item_flag_status.id));
105
+ if (items.length > 0) {
106
+ const activeOrPendingItems = items.filter(item => [itemFlagStatus_1.ItemFlagStatusStatusEnum.Active, itemFlagStatus_1.ItemFlagStatusStatusEnum.PendingArchive]
107
+ .includes(item.item_flag_status.id));
108
108
  yield this.processItems(activeOrPendingItems, archivedStatus);
109
109
  }
110
+ feed.feed_flag_status = Object.assign(Object.assign({}, feed.feed_flag_status), { id: feedFlagStatus_1.FeedFlagStatusStatusEnum.Archived });
111
+ feed.last_parsed_file_hash = null;
112
+ yield this.feedRepositoryReadWrite.save(feed);
110
113
  }
111
114
  });
112
115
  }
@@ -121,10 +124,38 @@ class ArchiverService {
121
124
  yield this.processItems(items, archivedStatus);
122
125
  });
123
126
  }
127
+ getFeedsWithTakedownStatus() {
128
+ return __awaiter(this, void 0, void 0, function* () {
129
+ return this.feedRepositoryRead.find({
130
+ where: {
131
+ feed_flag_status: {
132
+ id: feedFlagStatus_1.FeedFlagStatusStatusEnum.Takedown,
133
+ },
134
+ },
135
+ relations: ['channel', 'channel.items', 'feed_flag_status'],
136
+ });
137
+ });
138
+ }
139
+ removeAllItemsForTakedownFeeds() {
140
+ return __awaiter(this, void 0, void 0, function* () {
141
+ const feeds = yield this.getFeedsWithTakedownStatus();
142
+ for (const feed of feeds) {
143
+ const channel = feed.channel;
144
+ if (!channel || !channel.items || channel.items.length === 0) {
145
+ continue;
146
+ }
147
+ const itemIds = channel.items.map(item => item.id);
148
+ if (itemIds.length > 0) {
149
+ yield this.itemRepositoryReadWrite.delete(itemIds);
150
+ }
151
+ }
152
+ });
153
+ }
124
154
  archiveAll() {
125
155
  return __awaiter(this, void 0, void 0, function* () {
126
156
  yield this.processPendingArchiveFeeds();
127
157
  yield this.processPendingArchiveItems();
158
+ yield this.removeAllItemsForTakedownFeeds();
128
159
  });
129
160
  }
130
161
  }
@@ -10,10 +10,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.BaseManyService = void 0;
13
- const podverse_helpers_1 = require("podverse-helpers");
14
13
  const db_1 = require("@orm/db");
15
14
  const applyProperties_1 = require("@orm/lib/applyProperties");
16
15
  const hasDifferentValues_1 = require("@orm/lib/hasDifferentValues");
16
+ const loggerService_1 = require("@orm/factories/loggerService");
17
17
  class BaseManyService {
18
18
  constructor(targetEntity, parentEntityKey, transactionalEntityManager) {
19
19
  this.targetEntity = targetEntity;
@@ -56,8 +56,8 @@ class BaseManyService {
56
56
  return entity;
57
57
  }
58
58
  entity = (0, applyProperties_1.applyProperties)(entity, dto);
59
- podverse_helpers_1.logger.debug(`Updating entity ${JSON.stringify(entity)}`);
60
- podverse_helpers_1.logger.debug(`With DTO ${JSON.stringify(dto)}`);
59
+ loggerService_1.loggerService.debug(`Updating entity ${JSON.stringify(entity)}`);
60
+ loggerService_1.loggerService.debug(`With DTO ${JSON.stringify(dto)}`);
61
61
  return ((_a = this.transactionalEntityManager) !== null && _a !== void 0 ? _a : this.repositoryReadWrite).save(entity);
62
62
  });
63
63
  }
@@ -1 +1 @@
1
- {"version":3,"file":"baseOneService.d.ts","sourceRoot":"","sources":["../../../src/services/base/baseOneService.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,cAAc,EAAoB,aAAa,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAKrG,qBAAa,cAAc,CAAC,CAAC,SAAS,aAAa,EAAE,CAAC,SAAS,MAAM,CAAC;IACpE,OAAO,CAAC,eAAe,CAAI;IAC3B,SAAS,CAAC,cAAc,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC;IACxC,SAAS,CAAC,mBAAmB,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC;IAC7C,OAAO,CAAC,0BAA0B,CAAC,CAAgB;gBAEvC,MAAM,EAAE;QAAE,QAAQ,CAAC,CAAA;KAAE,EAAE,eAAe,EAAE,CAAC,EAAE,0BAA0B,CAAC,EAAE,aAAa;IAO3F,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,EAAE,cAAc,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC;IAKvE,OAAO,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,EAAE,cAAc,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;IAkB7E,OAAO,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;CAMxD"}
1
+ {"version":3,"file":"baseOneService.d.ts","sourceRoot":"","sources":["../../../src/services/base/baseOneService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,cAAc,EAAoB,aAAa,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAMrG,qBAAa,cAAc,CAAC,CAAC,SAAS,aAAa,EAAE,CAAC,SAAS,MAAM,CAAC;IACpE,OAAO,CAAC,eAAe,CAAI;IAC3B,SAAS,CAAC,cAAc,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC;IACxC,SAAS,CAAC,mBAAmB,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC;IAC7C,OAAO,CAAC,0BAA0B,CAAC,CAAgB;gBAEvC,MAAM,EAAE;QAAE,QAAQ,CAAC,CAAA;KAAE,EAAE,eAAe,EAAE,CAAC,EAAE,0BAA0B,CAAC,EAAE,aAAa;IAO3F,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,EAAE,cAAc,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC;IAKvE,OAAO,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,EAAE,cAAc,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;IAkB7E,OAAO,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;CAMxD"}
@@ -10,10 +10,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.BaseOneService = void 0;
13
- const podverse_helpers_1 = require("podverse-helpers");
14
13
  const db_1 = require("@orm/db");
15
14
  const applyProperties_1 = require("@orm/lib/applyProperties");
16
15
  const hasDifferentValues_1 = require("@orm/lib/hasDifferentValues");
16
+ const loggerService_1 = require("@orm/factories/loggerService");
17
17
  class BaseOneService {
18
18
  constructor(entity, parentEntityKey, transactionalEntityManager) {
19
19
  this.parentEntityKey = parentEntityKey;
@@ -39,8 +39,8 @@ class BaseOneService {
39
39
  return entity;
40
40
  }
41
41
  entity = (0, applyProperties_1.applyProperties)(entity, dto);
42
- podverse_helpers_1.logger.debug(`Updating entity ${JSON.stringify(entity)}`);
43
- podverse_helpers_1.logger.debug(`With DTO ${JSON.stringify(dto)}`);
42
+ loggerService_1.loggerService.debug(`Updating entity ${JSON.stringify(entity)}`);
43
+ loggerService_1.loggerService.debug(`With DTO ${JSON.stringify(dto)}`);
44
44
  return ((_a = this.transactionalEntityManager) !== null && _a !== void 0 ? _a : this.repositoryReadWrite).save(entity);
45
45
  });
46
46
  }
@@ -25,10 +25,11 @@ export declare class ChannelService {
25
25
  get(id: number, relations?: FindOptionsRelations<Channel>): Promise<Channel | null>;
26
26
  getByIdText(id_text: string, relations?: FindOptionsRelations<Channel>): Promise<Channel | null>;
27
27
  getByIdOrIdText(idOrIdText: string, relations?: FindOptionsRelations<Channel>): Promise<Channel | null>;
28
- getByPodcastIndexId(podcast_index_id: number): Promise<Channel | null>;
28
+ getByPodcastIndexId(podcast_index_id: number, relations?: FindOptionsRelations<Channel>): Promise<Channel | null>;
29
29
  getMany(config: FindManyOptions<Channel>): Promise<Channel[]>;
30
30
  getOrCreateByPodcastIndexId(dto: ChannelInitializeDto): Promise<Channel>;
31
31
  update(id: number, dto: ChannelDto): Promise<Channel>;
32
+ updatePodcastIndexId(id: number, podcast_index_id: number): Promise<Channel>;
32
33
  }
33
34
  export {};
34
35
  //# sourceMappingURL=channel.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"channel.d.ts","sourceRoot":"","sources":["../../../src/services/channel/channel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C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C;IAYrD,oBAAoB,CAAC,EAAE,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;CAWnF"}
@@ -169,16 +169,16 @@ class ChannelService {
169
169
  return channel;
170
170
  });
171
171
  }
172
- getByPodcastIndexId(podcast_index_id) {
173
- return __awaiter(this, void 0, void 0, function* () {
174
- return this.repositoryRead.findOne({ where: { podcast_index_id } });
172
+ getByPodcastIndexId(podcast_index_id_1) {
173
+ return __awaiter(this, arguments, void 0, function* (podcast_index_id, relations = {}) {
174
+ return this.repositoryRead.findOne({ where: { podcast_index_id }, relations });
175
175
  });
176
176
  }
177
177
  getMany(config) {
178
178
  return __awaiter(this, void 0, void 0, function* () {
179
179
  return this.repositoryRead.find(Object.assign({ where: {
180
180
  feed: {
181
- id: (0, typeorm_1.In)([feedFlagStatus_1.FeedFlagStatusStatusEnum.Active, feedFlagStatus_1.FeedFlagStatusStatusEnum.AlwaysParse])
181
+ feed_flag_status: (0, typeorm_1.In)([feedFlagStatus_1.FeedFlagStatusStatusEnum.Active, feedFlagStatus_1.FeedFlagStatusStatusEnum.AlwaysParse])
182
182
  }
183
183
  } }, config));
184
184
  });
@@ -205,5 +205,15 @@ class ChannelService {
205
205
  return this.repositoryReadWrite.save(channel);
206
206
  });
207
207
  }
208
+ updatePodcastIndexId(id, podcast_index_id) {
209
+ return __awaiter(this, void 0, void 0, function* () {
210
+ let channel = yield this.get(id);
211
+ if (!channel) {
212
+ channel = new channel_1.Channel();
213
+ }
214
+ channel = (0, applyProperties_1.applyProperties)(channel, { podcast_index_id });
215
+ return this.repositoryReadWrite.save(channel);
216
+ });
217
+ }
208
218
  }
209
219
  exports.ChannelService = ChannelService;
@@ -0,0 +1,17 @@
1
+ import { EntityManager } from 'typeorm';
2
+ import { Item } from '@orm/entities/item/item';
3
+ export declare class DeduplicatorService {
4
+ protected readWriteEntityManager: EntityManager;
5
+ constructor();
6
+ mergeChannels(id_to_archive: number, duplicate_id_to_keep: number): Promise<void>;
7
+ private updateAccountFollowingChannel;
8
+ private buildItemMaps;
9
+ private findDuplicateItem;
10
+ private updateClipAndPlaylistResource;
11
+ getChannelItems(channel_id: number): Promise<Item[]>;
12
+ getItemsForBothChannels(id_to_archive: number, duplicate_id_to_keep: number): Promise<{
13
+ itemsToArchive: Item[];
14
+ duplicateItemsToKeep: Item[];
15
+ }>;
16
+ }
17
+ //# sourceMappingURL=deduplicator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deduplicator.d.ts","sourceRoot":"","sources":["../../src/services/deduplicator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAIxC,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAG/C,qBAAa,mBAAmB;IAC9B,SAAS,CAAC,sBAAsB,EAAE,aAAa,CAAC;;IAM1C,aAAa,CAAC,aAAa,EAAE,MAAM,EAAE,oBAAoB,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;YAczE,6BAA6B;IAS3C,OAAO,CAAC,aAAa;IAUrB,OAAO,CAAC,iBAAiB;YAcX,6BAA6B;IAgBrC,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;IAOpD,uBAAuB,CAAC,aAAa,EAAE,MAAM,EAAE,oBAAoB,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,cAAc,EAAE,IAAI,EAAE,CAAC;QAAC,oBAAoB,EAAE,IAAI,EAAE,CAAA;KAAE,CAAC;CAKtJ"}
@@ -0,0 +1,97 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.DeduplicatorService = void 0;
13
+ const db_1 = require("@orm/db");
14
+ const accountFollowingChannel_1 = require("@orm/entities/account/accountFollowingChannel");
15
+ const clip_1 = require("@orm/entities/clip");
16
+ const item_1 = require("@orm/entities/item/item");
17
+ const playlistResource_1 = require("@orm/entities/playlist/playlistResource");
18
+ class DeduplicatorService {
19
+ constructor() {
20
+ this.readWriteEntityManager = db_1.AppDataSourceReadWrite.manager;
21
+ }
22
+ mergeChannels(id_to_archive, duplicate_id_to_keep) {
23
+ return __awaiter(this, void 0, void 0, function* () {
24
+ yield this.updateAccountFollowingChannel(id_to_archive, duplicate_id_to_keep);
25
+ const { itemsToArchive, duplicateItemsToKeep } = yield this.getItemsForBothChannels(id_to_archive, duplicate_id_to_keep);
26
+ const { guidMap, guidEnclosureUrlMap } = this.buildItemMaps(duplicateItemsToKeep);
27
+ for (const itemToArchive of itemsToArchive) {
28
+ const duplicateItemToKeep = this.findDuplicateItem(itemToArchive, guidMap, guidEnclosureUrlMap);
29
+ if (duplicateItemToKeep) {
30
+ yield this.updateClipAndPlaylistResource(itemToArchive.id, duplicateItemToKeep.id);
31
+ }
32
+ }
33
+ });
34
+ }
35
+ updateAccountFollowingChannel(id_to_archive, duplicate_id_to_keep) {
36
+ return __awaiter(this, void 0, void 0, function* () {
37
+ yield this.readWriteEntityManager
38
+ .createQueryBuilder()
39
+ .update(accountFollowingChannel_1.AccountFollowingChannel)
40
+ .set({ channel_id: duplicate_id_to_keep })
41
+ .where("channel_id = :id_to_archive", { id_to_archive })
42
+ .execute();
43
+ });
44
+ }
45
+ buildItemMaps(items) {
46
+ const guidMap = new Map();
47
+ const guidEnclosureUrlMap = new Map();
48
+ for (const item of items) {
49
+ if (item.guid)
50
+ guidMap.set(item.guid, item);
51
+ if (item.guid_enclosure_url)
52
+ guidEnclosureUrlMap.set(item.guid_enclosure_url, item);
53
+ }
54
+ return { guidMap, guidEnclosureUrlMap };
55
+ }
56
+ findDuplicateItem(itemToArchive, guidMap, guidEnclosureUrlMap) {
57
+ if (itemToArchive.guid && guidMap.has(itemToArchive.guid)) {
58
+ return guidMap.get(itemToArchive.guid);
59
+ }
60
+ if (itemToArchive.guid_enclosure_url && guidEnclosureUrlMap.has(itemToArchive.guid_enclosure_url)) {
61
+ return guidEnclosureUrlMap.get(itemToArchive.guid_enclosure_url);
62
+ }
63
+ return undefined;
64
+ }
65
+ updateClipAndPlaylistResource(itemToArchiveId, duplicateItemToKeepId) {
66
+ return __awaiter(this, void 0, void 0, function* () {
67
+ yield this.readWriteEntityManager
68
+ .createQueryBuilder()
69
+ .update(clip_1.Clip)
70
+ .set({ item_id: duplicateItemToKeepId })
71
+ .where("item_id = :itemToArchiveId", { itemToArchiveId })
72
+ .execute();
73
+ yield this.readWriteEntityManager
74
+ .createQueryBuilder()
75
+ .update(playlistResource_1.PlaylistResource)
76
+ .set({ item_id: duplicateItemToKeepId })
77
+ .where("item_id = :itemToArchiveId", { itemToArchiveId })
78
+ .execute();
79
+ });
80
+ }
81
+ getChannelItems(channel_id) {
82
+ return __awaiter(this, void 0, void 0, function* () {
83
+ const items = yield this.readWriteEntityManager
84
+ .getRepository(item_1.Item)
85
+ .find({ where: { channel: { id: channel_id } } });
86
+ return items;
87
+ });
88
+ }
89
+ getItemsForBothChannels(id_to_archive, duplicate_id_to_keep) {
90
+ return __awaiter(this, void 0, void 0, function* () {
91
+ const itemsToArchive = yield this.getChannelItems(id_to_archive);
92
+ const duplicateItemsToKeep = yield this.getChannelItems(duplicate_id_to_keep);
93
+ return { itemsToArchive, duplicateItemsToKeep };
94
+ });
95
+ }
96
+ }
97
+ exports.DeduplicatorService = DeduplicatorService;
@@ -1 +1 @@
1
- {"version":3,"file":"statsTrackAccountGuid.d.ts","sourceRoot":"","sources":["../../../src/services/stats/statsTrackAccountGuid.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,qBAAqB,EAAE,MAAM,2CAA2C,CAAC;AAIlF,qBAAa,4BAA4B;IACvC,OAAO,CAAC,cAAc,CAAoC;IAC1D,OAAO,CAAC,mBAAmB,CAAoC;IAC/D,OAAO,CAAC,cAAc,CAAiB;;IAQjC,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,GAAG,IAAI,CAAC;IAWzE,MAAM,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAU1D,MAAM,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAMhD"}
1
+ {"version":3,"file":"statsTrackAccountGuid.d.ts","sourceRoot":"","sources":["../../../src/services/stats/statsTrackAccountGuid.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,qBAAqB,EAAE,MAAM,2CAA2C,CAAC;AAGlF,qBAAa,4BAA4B;IACvC,OAAO,CAAC,cAAc,CAAoC;IAC1D,OAAO,CAAC,mBAAmB,CAAoC;IAC/D,OAAO,CAAC,cAAc,CAAiB;;IAQjC,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,GAAG,IAAI,CAAC;IAWzE,MAAM,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAU1D,MAAM,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAMhD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "podverse-orm",
3
- "version": "5.1.0-alpha.1",
3
+ "version": "5.1.0-alpha.11",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -16,9 +16,10 @@
16
16
  "author": "",
17
17
  "license": "AGPLv3",
18
18
  "dependencies": {
19
+ "bcrypt": "^5.1.1",
19
20
  "module-alias": "^2.2.3",
20
21
  "pg": "^8.12.0",
21
- "podverse-helpers": "^5.1.2-alpha.2",
22
+ "podverse-helpers": "^5.1.2-alpha.7",
22
23
  "shortid": "^2.2.16",
23
24
  "typeorm": "^0.3.20",
24
25
  "typeorm-naming-strategies": "^4.1.0"
@@ -27,7 +28,8 @@
27
28
  "@eslint/config-array": "^0.18.0",
28
29
  "@eslint/eslintrc": "^3.1.0",
29
30
  "@eslint/js": "^9.8.0",
30
- "@types/node": "^22.1.0",
31
+ "@types/bcrypt": "^5.0.2",
32
+ "@types/node": "^22.0.0",
31
33
  "eslint": "^9.9.0",
32
34
  "nodemon": "^3.1.4",
33
35
  "ts-node": "^10.9.2",
@@ -1,8 +0,0 @@
1
- import { Account } from '@orm/entities/account/account';
2
- export declare class AccountAdminRoles {
3
- id: number;
4
- account: Account;
5
- dev_admin: boolean;
6
- podping_admin: boolean;
7
- }
8
- //# sourceMappingURL=accountAdminRoles.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"accountAdminRoles.d.ts","sourceRoot":"","sources":["../../../src/entities/account/accountAdminRoles.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAExD,qBACa,iBAAiB;IAE5B,EAAE,EAAG,MAAM,CAAC;IAIZ,OAAO,EAAG,OAAO,CAAC;IAGlB,SAAS,EAAG,OAAO,CAAC;IAGpB,aAAa,EAAG,OAAO,CAAC;CACzB"}
@@ -1,37 +0,0 @@
1
- "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- var __metadata = (this && this.__metadata) || function (k, v) {
9
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.AccountAdminRoles = void 0;
13
- const typeorm_1 = require("typeorm");
14
- const account_1 = require("@orm/entities/account/account");
15
- let AccountAdminRoles = class AccountAdminRoles {
16
- };
17
- exports.AccountAdminRoles = AccountAdminRoles;
18
- __decorate([
19
- (0, typeorm_1.PrimaryGeneratedColumn)(),
20
- __metadata("design:type", Number)
21
- ], AccountAdminRoles.prototype, "id", void 0);
22
- __decorate([
23
- (0, typeorm_1.OneToOne)(() => account_1.Account, account => account.id, { onDelete: 'CASCADE' }),
24
- (0, typeorm_1.JoinColumn)({ name: 'account_id' }),
25
- __metadata("design:type", account_1.Account)
26
- ], AccountAdminRoles.prototype, "account", void 0);
27
- __decorate([
28
- (0, typeorm_1.Column)({ type: 'boolean', default: false }),
29
- __metadata("design:type", Boolean)
30
- ], AccountAdminRoles.prototype, "dev_admin", void 0);
31
- __decorate([
32
- (0, typeorm_1.Column)({ type: 'boolean', default: false }),
33
- __metadata("design:type", Boolean)
34
- ], AccountAdminRoles.prototype, "podping_admin", void 0);
35
- exports.AccountAdminRoles = AccountAdminRoles = __decorate([
36
- (0, typeorm_1.Entity)()
37
- ], AccountAdminRoles);