@audius/sdk 1.0.31 → 1.0.33

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.
@@ -11,5 +11,5 @@ export declare class SanityChecks {
11
11
  /**
12
12
  * Runs sanity checks
13
13
  */
14
- run(creatorNodeWhitelist?: Nullable<Set<string>>): Promise<void>;
14
+ run(creatorNodeWhitelist?: Nullable<Set<string>>, creatorNodeBlacklist?: Nullable<Set<string>>): Promise<void>;
15
15
  }
@@ -1,3 +1,3 @@
1
1
  import { Nullable } from '../utils';
2
2
  import type { AudiusLibs } from '../AudiusLibs';
3
- export declare const rolloverNodes: (libs: AudiusLibs, creatorNodeWhitelist: Nullable<Set<string>>) => Promise<void>;
3
+ export declare const rolloverNodes: (libs: AudiusLibs, creatorNodeWhitelist: Nullable<Set<string>>, creatorNodeBlacklist: Nullable<Set<string>>) => Promise<void>;
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@audius/sdk",
3
- "version": "1.0.31",
3
+ "version": "1.0.33",
4
4
  "audius": {
5
- "releaseSHA": "6b9562b0bf229dc32799315990f7d160e1223367"
5
+ "releaseSHA": "503765c37798a57b28320d6bb45253c27cb34741"
6
6
  },
7
7
  "description": "",
8
8
  "main": "dist/index.cjs.js",
@@ -87,6 +87,7 @@
87
87
  "lodash": "4.17.21",
88
88
  "micro-aes-gcm": "0.3.3",
89
89
  "node-localstorage": "^1.3.1",
90
+ "patch-package": "6.5.0",
90
91
  "proper-url-join": "1.2.0",
91
92
  "rollup-plugin-shim": "^1.0.0",
92
93
  "safe-buffer": "5.2.1",
@@ -134,7 +135,6 @@
134
135
  "mocha": "9.2.2",
135
136
  "nock": "13.1.2",
136
137
  "nyc": "15.1.0",
137
- "patch-package": "6.5.0",
138
138
  "prettier": "^2.6.1",
139
139
  "prettier-config-standard": "^5.0.0",
140
140
  "rollup": "2.70.1",
@@ -19,12 +19,15 @@ export class SanityChecks {
19
19
  /**
20
20
  * Runs sanity checks
21
21
  */
22
- async run(creatorNodeWhitelist: Nullable<Set<string>> = null) {
22
+ async run(
23
+ creatorNodeWhitelist: Nullable<Set<string>> = null,
24
+ creatorNodeBlacklist: Nullable<Set<string>> = null
25
+ ) {
23
26
  await addSecondaries(this.libs)
24
27
  await assignReplicaSetIfNecessary(this.libs)
25
28
  await syncNodes(this.libs)
26
29
  if (!this.options.skipRollover) {
27
- await rolloverNodes(this.libs, creatorNodeWhitelist)
30
+ await rolloverNodes(this.libs, creatorNodeWhitelist, creatorNodeBlacklist)
28
31
  }
29
32
  await needsRecoveryEmail(this.libs)
30
33
  }
@@ -36,7 +36,8 @@ const getNewPrimary = async (libs: AudiusLibs, secondaries: string[]) => {
36
36
 
37
37
  export const rolloverNodes = async (
38
38
  libs: AudiusLibs,
39
- creatorNodeWhitelist: Nullable<Set<string>>
39
+ creatorNodeWhitelist: Nullable<Set<string>>,
40
+ creatorNodeBlacklist: Nullable<Set<string>>
40
41
  ) => {
41
42
  console.debug('Sanity Check - rolloverNodes')
42
43
  const user = libs.userStateManager?.getCurrentUser()
@@ -45,8 +46,9 @@ export const rolloverNodes = async (
45
46
 
46
47
  const primary = CreatorNode.getPrimary(user.creator_node_endpoint)
47
48
  if (!primary) return
49
+
48
50
  const healthy = await checkPrimaryHealthy(libs, primary, MAX_TRIES)
49
- if (healthy) return
51
+ if (healthy && !creatorNodeBlacklist?.has(primary)) return
50
52
 
51
53
  const secondaries = CreatorNode.getSecondaries(user.creator_node_endpoint)
52
54