@cardano-sdk/projection-typeorm 0.5.3 → 0.7.0
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/cjs/TypeormStabilityWindowBuffer.d.ts +6 -7
- package/dist/cjs/TypeormStabilityWindowBuffer.d.ts.map +1 -1
- package/dist/cjs/TypeormStabilityWindowBuffer.js +40 -108
- package/dist/cjs/TypeormStabilityWindowBuffer.js.map +1 -1
- package/dist/cjs/createDataSource.d.ts +13 -0
- package/dist/cjs/createDataSource.d.ts.map +1 -1
- package/dist/cjs/createDataSource.js +53 -2
- package/dist/cjs/createDataSource.js.map +1 -1
- package/dist/cjs/createTypeormTipTracker.d.ts +16 -0
- package/dist/cjs/createTypeormTipTracker.d.ts.map +1 -0
- package/dist/cjs/createTypeormTipTracker.js +55 -0
- package/dist/cjs/createTypeormTipTracker.js.map +1 -0
- package/dist/cjs/entity/Address.entity.d.ts.map +1 -1
- package/dist/cjs/entity/Address.entity.js.map +1 -1
- package/dist/cjs/entity/CurrentPoolMetrics.entity.d.ts +2 -1
- package/dist/cjs/entity/CurrentPoolMetrics.entity.d.ts.map +1 -1
- package/dist/cjs/entity/CurrentPoolMetrics.entity.js +15 -11
- package/dist/cjs/entity/CurrentPoolMetrics.entity.js.map +1 -1
- package/dist/cjs/entity/Handle.entity.d.ts.map +1 -1
- package/dist/cjs/entity/Handle.entity.js.map +1 -1
- package/dist/cjs/entity/HandleMetadata.entity.d.ts.map +1 -1
- package/dist/cjs/entity/HandleMetadata.entity.js.map +1 -1
- package/dist/cjs/entity/NftMetadata.entity.d.ts.map +1 -1
- package/dist/cjs/entity/NftMetadata.entity.js.map +1 -1
- package/dist/cjs/entity/PoolDelisted.entity.d.ts +5 -0
- package/dist/cjs/entity/PoolDelisted.entity.d.ts.map +1 -0
- package/dist/cjs/entity/PoolDelisted.entity.js +25 -0
- package/dist/cjs/entity/PoolDelisted.entity.js.map +1 -0
- package/dist/cjs/entity/PoolRegistration.entity.d.ts +1 -0
- package/dist/cjs/entity/PoolRegistration.entity.d.ts.map +1 -1
- package/dist/cjs/entity/PoolRegistration.entity.js +4 -0
- package/dist/cjs/entity/PoolRegistration.entity.js.map +1 -1
- package/dist/cjs/entity/PoolRetirement.entity.d.ts +1 -0
- package/dist/cjs/entity/PoolRetirement.entity.d.ts.map +1 -1
- package/dist/cjs/entity/PoolRetirement.entity.js +4 -0
- package/dist/cjs/entity/PoolRetirement.entity.js.map +1 -1
- package/dist/cjs/entity/PoolRewards.entity.d.ts +18 -0
- package/dist/cjs/entity/PoolRewards.entity.d.ts.map +1 -0
- package/dist/cjs/entity/PoolRewards.entity.js +77 -0
- package/dist/cjs/entity/PoolRewards.entity.js.map +1 -0
- package/dist/cjs/entity/StakeKeyRegistration.entity.d.ts.map +1 -1
- package/dist/cjs/entity/StakeKeyRegistration.entity.js.map +1 -1
- package/dist/cjs/entity/index.d.ts +12 -10
- package/dist/cjs/entity/index.d.ts.map +1 -1
- package/dist/cjs/entity/index.js +12 -10
- package/dist/cjs/entity/index.js.map +1 -1
- package/dist/cjs/entity/util.d.ts.map +1 -1
- package/dist/cjs/entity/util.js.map +1 -1
- package/dist/cjs/index.d.ts +4 -5
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +4 -10
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/operators/index.d.ts +10 -9
- package/dist/cjs/operators/index.d.ts.map +1 -1
- package/dist/cjs/operators/index.js +10 -11
- package/dist/cjs/operators/index.js.map +1 -1
- package/dist/cjs/operators/storePoolMetricsUpdateJob.d.ts +1 -1
- package/dist/cjs/operators/storePoolMetricsUpdateJob.d.ts.map +1 -1
- package/dist/cjs/operators/storePoolMetricsUpdateJob.js +20 -4
- package/dist/cjs/operators/storePoolMetricsUpdateJob.js.map +1 -1
- package/dist/cjs/operators/storeStakePoolMetadataJob.d.ts.map +1 -1
- package/dist/cjs/operators/storeStakePoolMetadataJob.js +3 -6
- package/dist/cjs/operators/storeStakePoolMetadataJob.js.map +1 -1
- package/dist/cjs/operators/storeStakePoolRewardsJob.d.ts +3 -0
- package/dist/cjs/operators/storeStakePoolRewardsJob.d.ts.map +1 -0
- package/dist/cjs/operators/storeStakePoolRewardsJob.js +16 -0
- package/dist/cjs/operators/storeStakePoolRewardsJob.js.map +1 -0
- package/dist/cjs/operators/withTypeormTransaction.d.ts +10 -11
- package/dist/cjs/operators/withTypeormTransaction.d.ts.map +1 -1
- package/dist/cjs/operators/withTypeormTransaction.js +4 -33
- package/dist/cjs/operators/withTypeormTransaction.js.map +1 -1
- package/dist/cjs/pgBoss.d.ts +8 -0
- package/dist/cjs/pgBoss.d.ts.map +1 -1
- package/dist/cjs/pgBoss.js +13 -1
- package/dist/cjs/pgBoss.js.map +1 -1
- package/dist/cjs/tsconfig.tsbuildinfo +1 -1
- package/dist/esm/TypeormStabilityWindowBuffer.d.ts +6 -7
- package/dist/esm/TypeormStabilityWindowBuffer.d.ts.map +1 -1
- package/dist/esm/TypeormStabilityWindowBuffer.js +41 -109
- package/dist/esm/TypeormStabilityWindowBuffer.js.map +1 -1
- package/dist/esm/createDataSource.d.ts +13 -0
- package/dist/esm/createDataSource.d.ts.map +1 -1
- package/dist/esm/createDataSource.js +49 -1
- package/dist/esm/createDataSource.js.map +1 -1
- package/dist/esm/createTypeormTipTracker.d.ts +16 -0
- package/dist/esm/createTypeormTipTracker.d.ts.map +1 -0
- package/dist/esm/createTypeormTipTracker.js +51 -0
- package/dist/esm/createTypeormTipTracker.js.map +1 -0
- package/dist/esm/entity/Address.entity.d.ts.map +1 -1
- package/dist/esm/entity/Address.entity.js.map +1 -1
- package/dist/esm/entity/CurrentPoolMetrics.entity.d.ts +2 -1
- package/dist/esm/entity/CurrentPoolMetrics.entity.d.ts.map +1 -1
- package/dist/esm/entity/CurrentPoolMetrics.entity.js +15 -11
- package/dist/esm/entity/CurrentPoolMetrics.entity.js.map +1 -1
- package/dist/esm/entity/Handle.entity.d.ts.map +1 -1
- package/dist/esm/entity/Handle.entity.js.map +1 -1
- package/dist/esm/entity/HandleMetadata.entity.d.ts.map +1 -1
- package/dist/esm/entity/HandleMetadata.entity.js.map +1 -1
- package/dist/esm/entity/NftMetadata.entity.d.ts.map +1 -1
- package/dist/esm/entity/NftMetadata.entity.js.map +1 -1
- package/dist/esm/entity/PoolDelisted.entity.d.ts +5 -0
- package/dist/esm/entity/PoolDelisted.entity.d.ts.map +1 -0
- package/dist/esm/entity/PoolDelisted.entity.js +22 -0
- package/dist/esm/entity/PoolDelisted.entity.js.map +1 -0
- package/dist/esm/entity/PoolRegistration.entity.d.ts +1 -0
- package/dist/esm/entity/PoolRegistration.entity.d.ts.map +1 -1
- package/dist/esm/entity/PoolRegistration.entity.js +4 -0
- package/dist/esm/entity/PoolRegistration.entity.js.map +1 -1
- package/dist/esm/entity/PoolRetirement.entity.d.ts +1 -0
- package/dist/esm/entity/PoolRetirement.entity.d.ts.map +1 -1
- package/dist/esm/entity/PoolRetirement.entity.js +4 -0
- package/dist/esm/entity/PoolRetirement.entity.js.map +1 -1
- package/dist/esm/entity/PoolRewards.entity.d.ts +18 -0
- package/dist/esm/entity/PoolRewards.entity.d.ts.map +1 -0
- package/dist/esm/entity/PoolRewards.entity.js +74 -0
- package/dist/esm/entity/PoolRewards.entity.js.map +1 -0
- package/dist/esm/entity/StakeKeyRegistration.entity.d.ts.map +1 -1
- package/dist/esm/entity/StakeKeyRegistration.entity.js.map +1 -1
- package/dist/esm/entity/index.d.ts +12 -10
- package/dist/esm/entity/index.d.ts.map +1 -1
- package/dist/esm/entity/index.js +12 -10
- package/dist/esm/entity/index.js.map +1 -1
- package/dist/esm/entity/util.d.ts.map +1 -1
- package/dist/esm/entity/util.js.map +1 -1
- package/dist/esm/index.d.ts +4 -5
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +4 -5
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/operators/index.d.ts +10 -9
- package/dist/esm/operators/index.d.ts.map +1 -1
- package/dist/esm/operators/index.js +10 -9
- package/dist/esm/operators/index.js.map +1 -1
- package/dist/esm/operators/storePoolMetricsUpdateJob.d.ts +1 -1
- package/dist/esm/operators/storePoolMetricsUpdateJob.d.ts.map +1 -1
- package/dist/esm/operators/storePoolMetricsUpdateJob.js +20 -4
- package/dist/esm/operators/storePoolMetricsUpdateJob.js.map +1 -1
- package/dist/esm/operators/storeStakePoolMetadataJob.d.ts.map +1 -1
- package/dist/esm/operators/storeStakePoolMetadataJob.js +4 -7
- package/dist/esm/operators/storeStakePoolMetadataJob.js.map +1 -1
- package/dist/esm/operators/storeStakePoolRewardsJob.d.ts +3 -0
- package/dist/esm/operators/storeStakePoolRewardsJob.d.ts.map +1 -0
- package/dist/esm/operators/storeStakePoolRewardsJob.js +13 -0
- package/dist/esm/operators/storeStakePoolRewardsJob.js.map +1 -0
- package/dist/esm/operators/withTypeormTransaction.d.ts +10 -11
- package/dist/esm/operators/withTypeormTransaction.d.ts.map +1 -1
- package/dist/esm/operators/withTypeormTransaction.js +5 -34
- package/dist/esm/operators/withTypeormTransaction.js.map +1 -1
- package/dist/esm/pgBoss.d.ts +8 -0
- package/dist/esm/pgBoss.d.ts.map +1 -1
- package/dist/esm/pgBoss.js +12 -0
- package/dist/esm/pgBoss.js.map +1 -1
- package/dist/esm/tsconfig.tsbuildinfo +1 -1
- package/package.json +15 -15
|
@@ -1,25 +1,24 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { DataSourceExtensions } from '../createDataSource';
|
|
3
|
-
import { Observable, Subject } from 'rxjs';
|
|
1
|
+
import { Observable } from 'rxjs';
|
|
4
2
|
import { PgBossExtension } from '../pgBoss';
|
|
5
3
|
import { ProjectionEvent, UnifiedExtChainSyncOperator } from '@cardano-sdk/projection';
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
import { QueryRunner } from 'typeorm';
|
|
5
|
+
import { TypeormConnection } from '../createDataSource';
|
|
6
|
+
export interface WithTypeormTransactionDependencies {
|
|
7
|
+
connection$: Observable<TypeormConnection>;
|
|
9
8
|
}
|
|
10
9
|
export interface WithTypeormContext {
|
|
11
10
|
queryRunner: QueryRunner;
|
|
12
|
-
transactionCommitted$: Subject<void>;
|
|
13
11
|
}
|
|
14
12
|
export interface WithPgBoss {
|
|
15
13
|
pgBoss: PgBossExtension;
|
|
16
14
|
}
|
|
17
15
|
declare type TypeormContextProp = keyof (WithTypeormContext & WithPgBoss);
|
|
18
|
-
export declare function withTypeormTransaction<Props>(dependencies: WithTypeormTransactionDependencies
|
|
19
|
-
|
|
16
|
+
export declare function withTypeormTransaction<Props>(dependencies: WithTypeormTransactionDependencies & {
|
|
17
|
+
pgBoss?: false;
|
|
18
|
+
}): UnifiedExtChainSyncOperator<Props, Props & WithTypeormContext>;
|
|
19
|
+
export declare function withTypeormTransaction<Props>(dependencies: WithTypeormTransactionDependencies & {
|
|
20
20
|
pgBoss: true;
|
|
21
21
|
}): UnifiedExtChainSyncOperator<Props, Props & WithTypeormContext & WithPgBoss>;
|
|
22
|
-
export declare
|
|
23
|
-
export declare const typeormTransactionCommit: <T extends WithTypeormContext>() => (evt$: Observable<ProjectionEvent<T>>) => Observable<ProjectionEvent<Omit<T, keyof WithTypeormContext | "pgBoss">>>;
|
|
22
|
+
export declare const typeormTransactionCommit: <T extends WithTypeormContext>() => (evt$: Observable<ProjectionEvent<T>>) => Observable<ProjectionEvent<Omit<T, "pgBoss" | "queryRunner">>>;
|
|
24
23
|
export {};
|
|
25
24
|
//# sourceMappingURL=withTypeormTransaction.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withTypeormTransaction.d.ts","sourceRoot":"","sources":["../../../src/operators/withTypeormTransaction.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,
|
|
1
|
+
{"version":3,"file":"withTypeormTransaction.d.ts","sourceRoot":"","sources":["../../../src/operators/withTypeormTransaction.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAuC,MAAM,MAAM,CAAC;AACvE,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EACL,eAAe,EAEf,2BAA2B,EAG5B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACtC,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAGxD,MAAM,WAAW,kCAAkC;IACjD,WAAW,EAAE,UAAU,CAAC,iBAAiB,CAAC,CAAC;CAC5C;AAED,MAAM,WAAW,kBAAkB;IACjC,WAAW,EAAE,WAAW,CAAC;CAC1B;AAED,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,eAAe,CAAC;CACzB;AAED,aAAK,kBAAkB,GAAG,MAAM,CAAC,kBAAkB,GAAG,UAAU,CAAC,CAAC;AAGlE,wBAAgB,sBAAsB,CAAC,KAAK,EAC1C,YAAY,EAAE,kCAAkC,GAAG;IAAE,MAAM,CAAC,EAAE,KAAK,CAAA;CAAE,GACpE,2BAA2B,CAAC,KAAK,EAAE,KAAK,GAAG,kBAAkB,CAAC,CAAC;AAElE,wBAAgB,sBAAsB,CAAC,KAAK,EAC1C,YAAY,EAAE,kCAAkC,GAAG;IAAE,MAAM,EAAE,IAAI,CAAA;CAAE,GAClE,2BAA2B,CAAC,KAAK,EAAE,KAAK,GAAG,kBAAkB,GAAG,UAAU,CAAC,CAAC;AA8B/E,eAAO,MAAM,wBAAwB,8IAchC,CAAC"}
|
|
@@ -1,40 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { createPgBossExtension } from '../pgBoss';
|
|
1
|
+
import { Subject, defer, from, map, mergeMap } from 'rxjs';
|
|
3
2
|
import { withEventContext, withStaticContext } from '@cardano-sdk/projection';
|
|
4
|
-
import { finalizeWithLatest } from '@cardano-sdk/util-rxjs';
|
|
5
3
|
import omit from 'lodash/omit';
|
|
6
|
-
const WithTypeormTransactionProps = ['queryRunner', '
|
|
7
|
-
export function withTypeormTransaction({
|
|
8
|
-
return (evt$) => evt$.pipe(withStaticContext(defer(() =>
|
|
9
|
-
const queryRunner = dataSource.createQueryRunner('master');
|
|
10
|
-
await queryRunner.connect();
|
|
11
|
-
if (extensions?.pgBoss) {
|
|
12
|
-
const pgBoss = createPgBossExtension(queryRunner, logger);
|
|
13
|
-
return { pgBoss, queryRunner };
|
|
14
|
-
}
|
|
15
|
-
return { queryRunner };
|
|
16
|
-
})()), NEVER).pipe(finalizeWithLatest(async (evt) => {
|
|
17
|
-
if (!evt)
|
|
18
|
-
return;
|
|
19
|
-
if (evt.queryRunner.isTransactionActive) {
|
|
20
|
-
try {
|
|
21
|
-
await evt.queryRunner.rollbackTransaction();
|
|
22
|
-
}
|
|
23
|
-
catch (error) {
|
|
24
|
-
logger.error('Failed to rollback transaction', error);
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
if (!evt.queryRunner.isReleased) {
|
|
28
|
-
try {
|
|
29
|
-
await evt.queryRunner.release();
|
|
30
|
-
}
|
|
31
|
-
catch (error) {
|
|
32
|
-
logger.error('Failed to "release" query runner', error);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
})))))), withEventContext(({ queryRunner }) => from(queryRunner.startTransaction('SERIALIZABLE').then(() => ({ transactionCommitted$: new Subject() })))));
|
|
4
|
+
const WithTypeormTransactionProps = ['queryRunner', 'pgBoss'];
|
|
5
|
+
export function withTypeormTransaction({ connection$ }) {
|
|
6
|
+
return (evt$) => evt$.pipe(withStaticContext(defer(() => connection$)), withEventContext(({ queryRunner }) => from(queryRunner.startTransaction('SERIALIZABLE').then(() => ({ transactionCommitted$: new Subject() })))));
|
|
36
7
|
}
|
|
37
|
-
export const typeormTransactionCommit = () => (evt$) => evt$.pipe(mergeMap((evt) => from(evt.queryRunner.commitTransaction()).pipe(
|
|
8
|
+
export const typeormTransactionCommit = () => (evt$) => evt$.pipe(mergeMap((evt) => from(evt.queryRunner.commitTransaction()).pipe(map(() => {
|
|
38
9
|
const result = omit(evt, WithTypeormTransactionProps);
|
|
39
10
|
return result;
|
|
40
11
|
}))));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withTypeormTransaction.js","sourceRoot":"","sources":["../../../src/operators/withTypeormTransaction.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"withTypeormTransaction.js","sourceRoot":"","sources":["../../../src/operators/withTypeormTransaction.ts"],"names":[],"mappings":"AACA,OAAO,EAAc,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAEvE,OAAO,EAIL,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,yBAAyB,CAAC;AAGjC,OAAO,IAAI,MAAM,aAAa,CAAC;AAe/B,MAAM,2BAA2B,GAA8B,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAC;AAWzF,MAAM,UAAU,sBAAsB,CAAQ,EAC5C,WAAW,EAC+C;IAK1D,OAAO,CAAC,IAA0C,EAAE,EAAE,CACpD,IAAI,CAAC,IAAI,CACP,iBAAiB,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,WAAW,CAAC,CAAC,EAC3C,gBAAgB,CAAC,CAAC,EAAE,WAAW,EAAE,EAAE,EAAE,CACnC,IAAI,CAMF,WAAW,CAAC,gBAAgB,CAAC,cAAc,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,qBAAqB,EAAE,IAAI,OAAO,EAAQ,EAAE,CAAC,CAAC,CAC1G,CACF,CACF,CAAC;AACN,CAAC;AAMD,MAAM,CAAC,MAAM,wBAAwB,GACnC,GAAiC,EAAE,CACnC,CAAC,IAAoC,EAA4D,EAAE,CACjG,IAAI,CAAC,IAAI,CACP,QAAQ,CAAC,CAAC,GAAG,EAAE,EAAE,CACf,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC,iBAAiB,EAAE,CAAC,CAAC,IAAI,CAC5C,GAAG,CAAC,GAAG,EAAE;IAGP,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,EAAE,2BAA2B,CAAC,CAAC;IACtD,OAAO,MAAsD,CAAC;AAChE,CAAC,CAAC,CACH,CACF,CACF,CAAC"}
|
package/dist/esm/pgBoss.d.ts
CHANGED
|
@@ -2,8 +2,11 @@ import { Cardano } from '@cardano-sdk/core';
|
|
|
2
2
|
import { DataSource, QueryRunner } from 'typeorm';
|
|
3
3
|
import { Logger } from 'ts-log';
|
|
4
4
|
import PgBoss, { SendOptions } from 'pg-boss';
|
|
5
|
+
export declare const POOL_DELIST_SCHEDULE = "pool-delist-schedule";
|
|
5
6
|
export declare const STAKE_POOL_METADATA_QUEUE = "pool-metadata";
|
|
6
7
|
export declare const STAKE_POOL_METRICS_UPDATE = "pool-metrics";
|
|
8
|
+
export declare const STAKE_POOL_REWARDS = "pool-rewards";
|
|
9
|
+
export declare const availableQueues: readonly ["pool-delist-schedule", "pool-metadata", "pool-metrics", "pool-rewards"];
|
|
7
10
|
export interface PgBossExtension {
|
|
8
11
|
send: <T extends object>(taskName: string, data: T, options: SendOptions & {
|
|
9
12
|
slot: Cardano.Slot;
|
|
@@ -11,12 +14,17 @@ export interface PgBossExtension {
|
|
|
11
14
|
}
|
|
12
15
|
export interface StakePoolMetricsUpdateJob {
|
|
13
16
|
slot: Cardano.Slot;
|
|
17
|
+
outdatedSlot?: Cardano.Slot;
|
|
14
18
|
}
|
|
15
19
|
export interface StakePoolMetadataJob {
|
|
16
20
|
poolRegistrationId: string;
|
|
17
21
|
poolId: Cardano.PoolId;
|
|
18
22
|
metadataJson: NonNullable<Cardano.StakePool['metadataJson']>;
|
|
19
23
|
}
|
|
24
|
+
export interface StakePoolRewardsJob {
|
|
25
|
+
epochNo: Cardano.EpochNo;
|
|
26
|
+
}
|
|
27
|
+
export declare const defaultJobOptions: SendOptions;
|
|
20
28
|
export declare const createPgBoss: (queryRunner: QueryRunner | null, logger: Logger, dataSource?: DataSource) => PgBoss;
|
|
21
29
|
export declare const createPgBossExtension: (queryRunner: QueryRunner, logger: Logger) => PgBossExtension;
|
|
22
30
|
//# sourceMappingURL=pgBoss.d.ts.map
|
package/dist/esm/pgBoss.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pgBoss.d.ts","sourceRoot":"","sources":["../../src/pgBoss.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAIhC,OAAO,MAAM,EAAE,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE9C,eAAO,MAAM,yBAAyB,kBAAkB,CAAC;AACzD,eAAO,MAAM,yBAAyB,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"pgBoss.d.ts","sourceRoot":"","sources":["../../src/pgBoss.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAIhC,OAAO,MAAM,EAAE,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE9C,eAAO,MAAM,oBAAoB,yBAAyB,CAAC;AAC3D,eAAO,MAAM,yBAAyB,kBAAkB,CAAC;AACzD,eAAO,MAAM,yBAAyB,iBAAiB,CAAC;AACxD,eAAO,MAAM,kBAAkB,iBAAiB,CAAC;AAEjD,eAAO,MAAM,eAAe,oFAKlB,CAAC;AAEX,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,CAAC,CAAC,SAAS,MAAM,EACrB,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,CAAC,EACP,OAAO,EAAE,WAAW,GAAG;QAAE,IAAI,EAAE,OAAO,CAAC,IAAI,CAAA;KAAE,KAC1C,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;CAC7B;AAED,MAAM,WAAW,yBAAyB;IACxC,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC;IACnB,YAAY,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC;CAC7B;AAED,MAAM,WAAW,oBAAoB;IAEnC,kBAAkB,EAAE,MAAM,CAAC;IAC3B,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC;IACvB,YAAY,EAAE,WAAW,CAAC,OAAO,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,CAAC;CAC9D;AAED,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC;CAC1B;AAED,eAAO,MAAM,iBAAiB,EAAE,WAG/B,CAAC;AAsCF,eAAO,MAAM,YAAY,gBAAiB,WAAW,GAAG,IAAI,UAAU,MAAM,eAAe,UAAU,WAQpG,CAAC;AA6JF,eAAO,MAAM,qBAAqB,gBAAiB,WAAW,UAAU,MAAM,KAAG,eAUhF,CAAC"}
|
package/dist/esm/pgBoss.js
CHANGED
|
@@ -2,8 +2,20 @@ import { contextLogger } from '@cardano-sdk/util';
|
|
|
2
2
|
import { v4 } from 'uuid';
|
|
3
3
|
import Attorney from 'pg-boss/src/attorney';
|
|
4
4
|
import PgBoss from 'pg-boss';
|
|
5
|
+
export const POOL_DELIST_SCHEDULE = 'pool-delist-schedule';
|
|
5
6
|
export const STAKE_POOL_METADATA_QUEUE = 'pool-metadata';
|
|
6
7
|
export const STAKE_POOL_METRICS_UPDATE = 'pool-metrics';
|
|
8
|
+
export const STAKE_POOL_REWARDS = 'pool-rewards';
|
|
9
|
+
export const availableQueues = [
|
|
10
|
+
POOL_DELIST_SCHEDULE,
|
|
11
|
+
STAKE_POOL_METADATA_QUEUE,
|
|
12
|
+
STAKE_POOL_METRICS_UPDATE,
|
|
13
|
+
STAKE_POOL_REWARDS
|
|
14
|
+
];
|
|
15
|
+
export const defaultJobOptions = {
|
|
16
|
+
retryDelay: 6 * 3600,
|
|
17
|
+
retryLimit: 1000000
|
|
18
|
+
};
|
|
7
19
|
class BossDb {
|
|
8
20
|
constructor(queryRunner, logger, dataSource) {
|
|
9
21
|
this.queryRunner = queryRunner;
|
package/dist/esm/pgBoss.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pgBoss.js","sourceRoot":"","sources":["../../src/pgBoss.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,EAAE,EAAE,MAAM,MAAM,CAAC;AAC1B,OAAO,QAAQ,MAAM,sBAAsB,CAAC;AAC5C,OAAO,MAAuB,MAAM,SAAS,CAAC;AAE9C,MAAM,CAAC,MAAM,yBAAyB,GAAG,eAAe,CAAC;AACzD,MAAM,CAAC,MAAM,yBAAyB,GAAG,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"pgBoss.js","sourceRoot":"","sources":["../../src/pgBoss.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,EAAE,EAAE,MAAM,MAAM,CAAC;AAC1B,OAAO,QAAQ,MAAM,sBAAsB,CAAC;AAC5C,OAAO,MAAuB,MAAM,SAAS,CAAC;AAE9C,MAAM,CAAC,MAAM,oBAAoB,GAAG,sBAAsB,CAAC;AAC3D,MAAM,CAAC,MAAM,yBAAyB,GAAG,eAAe,CAAC;AACzD,MAAM,CAAC,MAAM,yBAAyB,GAAG,cAAc,CAAC;AACxD,MAAM,CAAC,MAAM,kBAAkB,GAAG,cAAc,CAAC;AAEjD,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,oBAAoB;IACpB,yBAAyB;IACzB,yBAAyB;IACzB,kBAAkB;CACV,CAAC;AA0BX,MAAM,CAAC,MAAM,iBAAiB,GAAgB;IAC5C,UAAU,EAAE,CAAC,GAAG,IAAI;IACpB,UAAU,EAAE,OAAS;CACtB,CAAC;A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