@decafhub/decaf-client-extras 0.5.1 → 0.6.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.
@@ -8,8 +8,11 @@ jobs:
8
8
  release-please:
9
9
  runs-on: ubuntu-latest
10
10
  steps:
11
- - uses: google-github-actions/release-please-action@v4
11
+ - uses: google-github-actions/release-please-action@v3
12
12
  id: release
13
+ with:
14
+ command: manifest
15
+ release-type: node
13
16
 
14
17
  - uses: actions/checkout@v4
15
18
  if: ${{ steps.release.outputs.release_created }}
package/.husky/commit-msg CHANGED
@@ -1,4 +1 @@
1
- #!/usr/bin/env sh
2
- . "$(dirname -- "$0")/_/husky.sh"
3
-
4
1
  npx --no -- commitlint --edit "${1}"
package/.husky/pre-commit CHANGED
@@ -1,4 +1 @@
1
- #!/usr/bin/env sh
2
- . "$(dirname -- "$0")/_/husky.sh"
3
-
4
- ./node_modules/.bin/lint-staged
1
+ npx lint-staged
@@ -1,3 +1,3 @@
1
1
  {
2
- ".": "0.5.1"
2
+ ".": "0.6.0"
3
3
  }
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.6.0](https://github.com/teloscube/decaf-client-javascript-extras/compare/v0.5.2...v0.6.0) (2024-12-31)
4
+
5
+
6
+ ### Miscellaneous Chores
7
+
8
+ * release ([9546b42](https://github.com/teloscube/decaf-client-javascript-extras/commit/9546b42533e8388f027dda7177aa2a55211b9197))
9
+
10
+ ## [0.5.2](https://github.com/teloscube/decaf-client-javascript-extras/compare/v0.5.1...v0.5.2) (2024-09-05)
11
+
12
+
13
+ ### Miscellaneous Chores
14
+
15
+ * upgrade dependencies ([81f3b80](https://github.com/teloscube/decaf-client-javascript-extras/commit/81f3b80307f17e0a85f88e9f1202551b77155004))
16
+
3
17
  ## [0.5.1](https://github.com/teloscube/decaf-client-javascript-extras/compare/v0.5.0...v0.5.1) (2024-08-31)
4
18
 
5
19
 
@@ -5,7 +5,10 @@
5
5
  * @module
6
6
  */
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.unCurrencyCode = exports.mkCurrencyCodeError = exports.mkCurrencyCode = exports.REGEXP_CURRENCY_CODE = void 0;
8
+ exports.REGEXP_CURRENCY_CODE = void 0;
9
+ exports.mkCurrencyCode = mkCurrencyCode;
10
+ exports.mkCurrencyCodeError = mkCurrencyCodeError;
11
+ exports.unCurrencyCode = unCurrencyCode;
9
12
  var prelude_1 = require("@telostat/prelude");
10
13
  /**
11
14
  * Regular expression for currency codes in our concept.
@@ -24,7 +27,6 @@ exports.REGEXP_CURRENCY_CODE = /^[A-Z][a-zA-Z]*$/;
24
27
  function mkCurrencyCode(x) {
25
28
  return exports.REGEXP_CURRENCY_CODE.test(x) ? (0, prelude_1.Just)(x) : prelude_1.Nothing;
26
29
  }
27
- exports.mkCurrencyCode = mkCurrencyCode;
28
30
  /**
29
31
  * (Unsafely) attempts to create a {@link CurrencyCode} value with the given
30
32
  * currency code.
@@ -41,7 +43,6 @@ function mkCurrencyCodeError(x) {
41
43
  throw new Error("Invalid currency code: ".concat(x));
42
44
  });
43
45
  }
44
- exports.mkCurrencyCodeError = mkCurrencyCodeError;
45
46
  /**
46
47
  * Return the currency code as a string value.
47
48
  *
@@ -53,4 +54,3 @@ exports.mkCurrencyCodeError = mkCurrencyCodeError;
53
54
  function unCurrencyCode(x) {
54
55
  return x;
55
56
  }
56
- exports.unCurrencyCode = unCurrencyCode;
package/commons/-id.js CHANGED
@@ -52,7 +52,8 @@
52
52
  * @module
53
53
  */
54
54
  Object.defineProperty(exports, "__esModule", { value: true });
55
- exports.unDecafRecordId = exports.mkDecafRecordId = void 0;
55
+ exports.mkDecafRecordId = mkDecafRecordId;
56
+ exports.unDecafRecordId = unDecafRecordId;
56
57
  /**
57
58
  * Constructor for DECAF record identifiers.
58
59
  *
@@ -62,7 +63,6 @@ exports.unDecafRecordId = exports.mkDecafRecordId = void 0;
62
63
  function mkDecafRecordId(x) {
63
64
  return x;
64
65
  }
65
- exports.mkDecafRecordId = mkDecafRecordId;
66
66
  /**
67
67
  * Deconstructor for DECAF record identifiers.
68
68
  *
@@ -72,4 +72,3 @@ exports.mkDecafRecordId = mkDecafRecordId;
72
72
  function unDecafRecordId(x) {
73
73
  return x;
74
74
  }
75
- exports.unDecafRecordId = unDecafRecordId;
package/commons/index.js CHANGED
@@ -18,13 +18,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
18
18
  var __exportStar = (this && this.__exportStar) || function(m, exports) {
19
19
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
20
20
  };
21
- var __importStar = (this && this.__importStar) || function (mod) {
22
- if (mod && mod.__esModule) return mod;
23
- var result = {};
24
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
25
- __setModuleDefault(result, mod);
26
- return result;
27
- };
21
+ var __importStar = (this && this.__importStar) || (function () {
22
+ var ownKeys = function(o) {
23
+ ownKeys = Object.getOwnPropertyNames || function (o) {
24
+ var ar = [];
25
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
26
+ return ar;
27
+ };
28
+ return ownKeys(o);
29
+ };
30
+ return function (mod) {
31
+ if (mod && mod.__esModule) return mod;
32
+ var result = {};
33
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
34
+ __setModuleDefault(result, mod);
35
+ return result;
36
+ };
37
+ })();
28
38
  Object.defineProperty(exports, "__esModule", { value: true });
29
39
  exports.id = exports.datetype = exports.currency = void 0;
30
40
  __exportStar(require("./-currency"), exports);
@@ -0,0 +1,54 @@
1
+ import { FlatCompat } from '@eslint/eslintrc';
2
+ import js from '@eslint/js';
3
+ import typescriptEslint from '@typescript-eslint/eslint-plugin';
4
+ import tsParser from '@typescript-eslint/parser';
5
+ import prettier from 'eslint-plugin-prettier';
6
+ import globals from 'globals';
7
+ import path from 'node:path';
8
+ import { fileURLToPath } from 'node:url';
9
+
10
+ const __filename = fileURLToPath(import.meta.url);
11
+ const __dirname = path.dirname(__filename);
12
+ const compat = new FlatCompat({
13
+ baseDirectory: __dirname,
14
+ recommendedConfig: js.configs.recommended,
15
+ allConfig: js.configs.all,
16
+ });
17
+
18
+ export default [
19
+ {
20
+ ignores: ['**/lib', '**/docs', '**/.husky'],
21
+ },
22
+ ...compat.extends(
23
+ 'standard',
24
+ 'prettier',
25
+ 'plugin:prettier/recommended',
26
+ 'plugin:@typescript-eslint/eslint-recommended'
27
+ ),
28
+ {
29
+ plugins: {
30
+ '@typescript-eslint': typescriptEslint,
31
+ prettier,
32
+ },
33
+
34
+ languageOptions: {
35
+ globals: {
36
+ ...globals.browser,
37
+ Atomics: 'readonly',
38
+ SharedArrayBuffer: 'readonly',
39
+ },
40
+
41
+ parser: tsParser,
42
+ ecmaVersion: 2018,
43
+ sourceType: 'module',
44
+ },
45
+
46
+ rules: {
47
+ 'prettier/prettier': 'error',
48
+ '@typescript-eslint/explicit-function-return-type': 'off',
49
+ 'no-use-before-define': 'off',
50
+ '@typescript-eslint/no-use-before-define': ['error'],
51
+ },
52
+ },
53
+ ];
54
+
package/index.js CHANGED
@@ -18,13 +18,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
18
18
  var __exportStar = (this && this.__exportStar) || function(m, exports) {
19
19
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
20
20
  };
21
- var __importStar = (this && this.__importStar) || function (mod) {
22
- if (mod && mod.__esModule) return mod;
23
- var result = {};
24
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
25
- __setModuleDefault(result, mod);
26
- return result;
27
- };
21
+ var __importStar = (this && this.__importStar) || (function () {
22
+ var ownKeys = function(o) {
23
+ ownKeys = Object.getOwnPropertyNames || function (o) {
24
+ var ar = [];
25
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
26
+ return ar;
27
+ };
28
+ return ownKeys(o);
29
+ };
30
+ return function (mod) {
31
+ if (mod && mod.__esModule) return mod;
32
+ var result = {};
33
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
34
+ __setModuleDefault(result, mod);
35
+ return result;
36
+ };
37
+ })();
28
38
  Object.defineProperty(exports, "__esModule", { value: true });
29
39
  exports.reports = exports.commons = void 0;
30
40
  __exportStar(require("./commons"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@decafhub/decaf-client-extras",
3
- "version": "0.5.1",
3
+ "version": "0.6.0",
4
4
  "description": "DECAF Client Extras",
5
5
  "author": "Teloscube Pte Ltd",
6
6
  "license": "MIT",
@@ -26,37 +26,39 @@
26
26
  "node": ">=18"
27
27
  },
28
28
  "peerDependencies": {
29
- "@decafhub/decaf-client": "^0.5"
29
+ "@decafhub/decaf-client": "^0.6"
30
30
  },
31
31
  "dependencies": {
32
- "@telostat/prelude": "^0.5.0",
33
- "dayjs": "^1.11.10"
32
+ "@telostat/prelude": "^0.6",
33
+ "dayjs": "^1.11.13"
34
34
  },
35
35
  "devDependencies": {
36
- "@commitlint/cli": "^18.4.3",
37
- "@commitlint/config-conventional": "^18.4.3",
38
- "@decafhub/decaf-client": "^0.5.0",
39
- "@types/jest": "^29.5.10",
40
- "@types/node": "^20.10.3",
41
- "@typescript-eslint/eslint-plugin": "^6.13.2",
42
- "@typescript-eslint/parser": "^6.13.2",
43
- "dotenv": "^16.3.1",
44
- "eslint": "^8.55.0",
36
+ "@commitlint/cli": "^19.6.1",
37
+ "@commitlint/config-conventional": "^19.6.0",
38
+ "@decafhub/decaf-client": "^0.6.0",
39
+ "@eslint/eslintrc": "^3.2.0",
40
+ "@eslint/js": "^9.17.0",
41
+ "@types/jest": "^29.5.14",
42
+ "@types/node": "^22.10.2",
43
+ "@typescript-eslint/eslint-plugin": "^8.19.0",
44
+ "@typescript-eslint/parser": "^8.19.0",
45
+ "dotenv": "^16.4.7",
46
+ "eslint": "^9.17.0",
45
47
  "eslint-config-prettier": "^9.1.0",
46
- "eslint-config-standard": "^17.1.0",
47
- "eslint-plugin-import": "^2.29.0",
48
- "eslint-plugin-n": "^16.3.1",
49
- "eslint-plugin-prettier": "^5.0.1",
50
- "eslint-plugin-promise": "^6.1.1",
48
+ "eslint-plugin-n": "^17.15.1",
49
+ "eslint-plugin-prettier": "^5.2.1",
50
+ "eslint-plugin-promise": "^7.2.1",
51
51
  "eslint-plugin-standard": "^5.0.0",
52
- "gh-pages": "^6.1.0",
53
- "husky": "^8.0.3",
52
+ "gh-pages": "^6.2.0",
53
+ "globals": "^15.14.0",
54
+ "husky": "^9.1.7",
54
55
  "jest": "^29.7.0",
55
- "lint-staged": "^15.2.0",
56
- "prettier": "^3.1.0",
57
- "ts-jest": "^29.1.1",
58
- "typedoc": "^0.25.4",
59
- "typescript": "^5.3.2"
56
+ "lint-staged": "^15.3.0",
57
+ "prettier": "^3.4.2",
58
+ "prettier-plugin-organize-imports": "^4.1.0",
59
+ "ts-jest": "^29.2.5",
60
+ "typedoc": "^0.27.6",
61
+ "typescript": "^5.7.2"
60
62
  },
61
63
  "lint-staged": {
62
64
  "src/**/*.{ts,tsx}": [
@@ -70,7 +72,10 @@
70
72
  "useTabs": false,
71
73
  "semi": true,
72
74
  "singleQuote": true,
73
- "trailingComma": "es5"
75
+ "trailingComma": "es5",
76
+ "plugins": [
77
+ "prettier-plugin-organize-imports"
78
+ ]
74
79
  },
75
80
  "commitlint": {
76
81
  "extends": [
package/postinstall.sh CHANGED
@@ -6,7 +6,7 @@ if [ -f .env ]; then
6
6
  fi
7
7
 
8
8
  if [ -n "$DECAF_JS_SKIP_POSTINSTALL" ]; then
9
- npx --no -- husky install
9
+ npx --no -- husky
10
10
  echo "Local Env detected. Skipping lib/ relocation..."
11
11
  exit 0
12
12
  fi
package/reports/index.js CHANGED
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
25
35
  Object.defineProperty(exports, "__esModule", { value: true });
26
36
  exports.valuation = void 0;
27
37
  exports.valuation = __importStar(require("./valuation"));
@@ -20,8 +20,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
20
20
  });
21
21
  };
22
22
  var __generator = (this && this.__generator) || function (thisArg, body) {
23
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
24
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
23
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
24
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
25
25
  function verb(n) { return function (v) { return step([n, v]); }; }
26
26
  function step(op) {
27
27
  if (f) throw new TypeError("Generator is already executing.");
@@ -47,7 +47,10 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
47
47
  }
48
48
  };
49
49
  Object.defineProperty(exports, "__esModule", { value: true });
50
- exports.fetchAccountValuationReport = exports.recompileAccountValuationReport = exports.toShareClassValue = exports.fetchRemoteAccountValuationReport = void 0;
50
+ exports.fetchRemoteAccountValuationReport = fetchRemoteAccountValuationReport;
51
+ exports.toShareClassValue = toShareClassValue;
52
+ exports.recompileAccountValuationReport = recompileAccountValuationReport;
53
+ exports.fetchAccountValuationReport = fetchAccountValuationReport;
51
54
  var prelude_1 = require("@telostat/prelude");
52
55
  var _remote_valuation_report_shared_1 = require("./-remote-valuation-report-shared");
53
56
  /**
@@ -74,7 +77,6 @@ function fetchRemoteAccountValuationReport(client, query) {
74
77
  });
75
78
  });
76
79
  }
77
- exports.fetchRemoteAccountValuationReport = fetchRemoteAccountValuationReport;
78
80
  /**
79
81
  * Attempts to recompile remote valuation report share class value.
80
82
  *
@@ -153,7 +155,6 @@ function toShareClassValue(s) {
153
155
  ytdInt: (0, prelude_1.decimalFromNullable)(s.ytdint),
154
156
  };
155
157
  }
156
- exports.toShareClassValue = toShareClassValue;
157
158
  /**
158
159
  * Attempts to re-compile the raw, remote account valuation report and
159
160
  * return it.
@@ -170,7 +171,6 @@ function recompileAccountValuationReport(x) {
170
171
  return __assign(__assign({}, report), { account: x.account, subscriptions: (0, prelude_1.decimalFromNullable)(x.subscriptions).orDefault(prelude_1.zero), shareClassValues: x.scvals.map(toShareClassValue) });
171
172
  });
172
173
  }
173
- exports.recompileAccountValuationReport = recompileAccountValuationReport;
174
174
  /**
175
175
  * Attempts to retrieve remote account valuation report, compiles it to
176
176
  * {@link AccountValuationReport} and return it.
@@ -193,4 +193,3 @@ function fetchAccountValuationReport(client, query) {
193
193
  });
194
194
  });
195
195
  }
196
- exports.fetchAccountValuationReport = fetchAccountValuationReport;
@@ -20,8 +20,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
20
20
  });
21
21
  };
22
22
  var __generator = (this && this.__generator) || function (thisArg, body) {
23
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
24
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
23
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
24
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
25
25
  function verb(n) { return function (v) { return step([n, v]); }; }
26
26
  function step(op) {
27
27
  if (f) throw new TypeError("Generator is already executing.");
@@ -47,7 +47,9 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
47
47
  }
48
48
  };
49
49
  Object.defineProperty(exports, "__esModule", { value: true });
50
- exports.fetchConsolidatedValuationReport = exports.recompileConsolidatedValuationReport = exports.fetchRemoteConsolidatedValuationReport = void 0;
50
+ exports.fetchRemoteConsolidatedValuationReport = fetchRemoteConsolidatedValuationReport;
51
+ exports.recompileConsolidatedValuationReport = recompileConsolidatedValuationReport;
52
+ exports.fetchConsolidatedValuationReport = fetchConsolidatedValuationReport;
51
53
  var prelude_1 = require("@telostat/prelude");
52
54
  var _remote_valuation_report_shared_1 = require("./-remote-valuation-report-shared");
53
55
  /**
@@ -72,7 +74,6 @@ function fetchRemoteConsolidatedValuationReport(client, query) {
72
74
  .then(function (x) { return (0, prelude_1.Right)(x.data); })
73
75
  .catch(function (err) { return (0, prelude_1.Left)((0, prelude_1.customError)('Error while attempting to fetch remote consolidated valuation report', err)); });
74
76
  }
75
- exports.fetchRemoteConsolidatedValuationReport = fetchRemoteConsolidatedValuationReport;
76
77
  /**
77
78
  * Attempts to re-compile the raw, remote consolidated valuation report and
78
79
  * return it.
@@ -87,7 +88,6 @@ function recompileConsolidatedValuationReport(x) {
87
88
  // Add consolidated valuation report specific fields and return:
88
89
  return baseReport.map(function (report) { return (__assign(__assign({}, report), { containerType: x.containers.level, containers: x.containers.containers })); });
89
90
  }
90
- exports.recompileConsolidatedValuationReport = recompileConsolidatedValuationReport;
91
91
  /**
92
92
  * Attempts to retrieve remote consolidated valuation report, compiles it to
93
93
  * {@link ConsolidatedValuationReport} and return it.
@@ -110,4 +110,3 @@ function fetchConsolidatedValuationReport(client, query) {
110
110
  });
111
111
  });
112
112
  }
113
- exports.fetchConsolidatedValuationReport = fetchConsolidatedValuationReport;
@@ -20,8 +20,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
20
20
  });
21
21
  };
22
22
  var __generator = (this && this.__generator) || function (thisArg, body) {
23
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
24
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
23
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
24
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
25
25
  function verb(n) { return function (v) { return step([n, v]); }; }
26
26
  function step(op) {
27
27
  if (f) throw new TypeError("Generator is already executing.");
@@ -47,7 +47,10 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
47
47
  }
48
48
  };
49
49
  Object.defineProperty(exports, "__esModule", { value: true });
50
- exports.fetchPortfolioValuationReport = exports.recompilePortfolioValuationReport = exports.toShareClassValue = exports.fetchRemotePortfolioValuationReport = void 0;
50
+ exports.fetchRemotePortfolioValuationReport = fetchRemotePortfolioValuationReport;
51
+ exports.toShareClassValue = toShareClassValue;
52
+ exports.recompilePortfolioValuationReport = recompilePortfolioValuationReport;
53
+ exports.fetchPortfolioValuationReport = fetchPortfolioValuationReport;
51
54
  var prelude_1 = require("@telostat/prelude");
52
55
  var _remote_valuation_report_shared_1 = require("./-remote-valuation-report-shared");
53
56
  /**
@@ -70,7 +73,6 @@ function fetchRemotePortfolioValuationReport(client, query) {
70
73
  .then(function (x) { return (0, prelude_1.Right)(x.data); })
71
74
  .catch(function (err) { return (0, prelude_1.Left)((0, prelude_1.customError)('Error while attempting to fetch remote portfolio valuation report', err)); });
72
75
  }
73
- exports.fetchRemotePortfolioValuationReport = fetchRemotePortfolioValuationReport;
74
76
  /**
75
77
  * Attempts to recompile remote valuation report share class value.
76
78
  *
@@ -149,7 +151,6 @@ function toShareClassValue(s) {
149
151
  ytdInt: (0, prelude_1.decimalFromNullable)(s.ytdint),
150
152
  };
151
153
  }
152
- exports.toShareClassValue = toShareClassValue;
153
154
  /**
154
155
  * Attempts to re-compile the raw, remote portfolio valuation report and
155
156
  * return it.
@@ -166,7 +167,6 @@ function recompilePortfolioValuationReport(x) {
166
167
  return __assign(__assign({}, report), { portfolio: x.portfolio, subscriptions: (0, prelude_1.decimalFromNullable)(x.subscriptions).orDefault(prelude_1.zero), shareClassValues: x.scvals.map(toShareClassValue) });
167
168
  });
168
169
  }
169
- exports.recompilePortfolioValuationReport = recompilePortfolioValuationReport;
170
170
  /**
171
171
  * Attempts to retrieve remote portfolio valuation report, compiles it to
172
172
  * {@link PortfolioValuationReport} and return it.
@@ -189,4 +189,3 @@ function fetchPortfolioValuationReport(client, query) {
189
189
  });
190
190
  });
191
191
  }
192
- exports.fetchPortfolioValuationReport = fetchPortfolioValuationReport;
@@ -11,7 +11,13 @@ var __assign = (this && this.__assign) || function () {
11
11
  return __assign.apply(this, arguments);
12
12
  };
13
13
  Object.defineProperty(exports, "__esModule", { value: true });
14
- exports.recompileBaseValuationReport = exports.toHolding = exports.toBaseHolding = exports.toMaybeOrgRef = exports.toOrgRef = exports.toAccrual = exports.toArtifact = void 0;
14
+ exports.toArtifact = toArtifact;
15
+ exports.toAccrual = toAccrual;
16
+ exports.toOrgRef = toOrgRef;
17
+ exports.toMaybeOrgRef = toMaybeOrgRef;
18
+ exports.toBaseHolding = toBaseHolding;
19
+ exports.toHolding = toHolding;
20
+ exports.recompileBaseValuationReport = recompileBaseValuationReport;
15
21
  var prelude_1 = require("@telostat/prelude");
16
22
  function toArtifact(x) {
17
23
  return {
@@ -34,7 +40,6 @@ function toArtifact(x) {
34
40
  underlyingId: prelude_1.Maybe.fromNullable(x.underlying_id),
35
41
  };
36
42
  }
37
- exports.toArtifact = toArtifact;
38
43
  function toAccrual(x) {
39
44
  return {
40
45
  name: x.name,
@@ -53,21 +58,18 @@ function toAccrual(x) {
53
58
  }); }),
54
59
  };
55
60
  }
56
- exports.toAccrual = toAccrual;
57
61
  function toOrgRef(x) {
58
62
  return {
59
63
  org: (0, prelude_1.decimalFromNullable)(x.org).orDefault(prelude_1.zero),
60
64
  ref: (0, prelude_1.decimalFromNullable)(x.ref).orDefault(prelude_1.zero),
61
65
  };
62
66
  }
63
- exports.toOrgRef = toOrgRef;
64
67
  function toMaybeOrgRef(x) {
65
68
  return prelude_1.Maybe.fromNullable(x).chain(function (_a) {
66
69
  var org = _a.org, ref = _a.ref;
67
70
  return (0, prelude_1.decimalFromNullable)(org).chain(function (o) { return (0, prelude_1.decimalFromNullable)(ref).chain(function (r) { return (0, prelude_1.Just)({ org: o, ref: r }); }); });
68
71
  });
69
72
  }
70
- exports.toMaybeOrgRef = toMaybeOrgRef;
71
73
  function toBaseHolding(nav, x) {
72
74
  return {
73
75
  artifact: toArtifact(x.artifact),
@@ -100,7 +102,6 @@ function toBaseHolding(nav, x) {
100
102
  lastdate: x.lastdate,
101
103
  };
102
104
  }
103
- exports.toBaseHolding = toBaseHolding;
104
105
  function toHolding(nav, x) {
105
106
  return __assign(__assign({}, toBaseHolding(nav, x)), { classification: x.tags.classification.map(function (n) { return (__assign(__assign({}, n), { order: n.order || '' })); }), accounts: x.accounts, children: prelude_1.Maybe.fromNullable(x.children)
106
107
  .filter(function (mc) { return mc.length !== 0; })
@@ -108,7 +109,6 @@ function toHolding(nav, x) {
108
109
  return mc.map(function (c) { return (__assign(__assign({}, toBaseHolding(nav, c)), { account: c.accounts[0] })); });
109
110
  }) });
110
111
  }
111
- exports.toHolding = toHolding;
112
112
  /**
113
113
  * Attempts to re-compile the raw, remote base valuation report and
114
114
  * return it.
@@ -145,4 +145,3 @@ function recompileBaseValuationReport(x) {
145
145
  };
146
146
  return (0, prelude_1.Right)(report);
147
147
  }
148
- exports.recompileBaseValuationReport = recompileBaseValuationReport;
@@ -36,7 +36,13 @@ var __values = (this && this.__values) || function(o) {
36
36
  throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.makeValuationReportHoldingsTree = exports.addValuationReportHoldingToTree = exports.makeValuationReportHoldingsTreeNode = exports.retreatTree = exports.resortChildren = exports.updateTotals = exports.makeValuationReportHoldingsTreeNodeValue = void 0;
39
+ exports.makeValuationReportHoldingsTreeNodeValue = makeValuationReportHoldingsTreeNodeValue;
40
+ exports.updateTotals = updateTotals;
41
+ exports.resortChildren = resortChildren;
42
+ exports.retreatTree = retreatTree;
43
+ exports.makeValuationReportHoldingsTreeNode = makeValuationReportHoldingsTreeNode;
44
+ exports.addValuationReportHoldingToTree = addValuationReportHoldingToTree;
45
+ exports.makeValuationReportHoldingsTree = makeValuationReportHoldingsTree;
40
46
  var prelude_1 = require("@telostat/prelude");
41
47
  var _utils_1 = require("./-utils");
42
48
  function makeValuationReportHoldingsTreeNodeValue() {
@@ -55,7 +61,6 @@ function makeValuationReportHoldingsTreeNodeValue() {
55
61
  pnlRatio: prelude_1.zero,
56
62
  };
57
63
  }
58
- exports.makeValuationReportHoldingsTreeNodeValue = makeValuationReportHoldingsTreeNodeValue;
59
64
  function updateTotals(nav, investment, tree) {
60
65
  var holdings = tree.holdings;
61
66
  var children = tree.children;
@@ -87,7 +92,6 @@ function updateTotals(nav, investment, tree) {
87
92
  pnlRatio: (0, prelude_1.safeDiv)(pnl, investment).orDefault(prelude_1.zero),
88
93
  };
89
94
  }
90
- exports.updateTotals = updateTotals;
91
95
  function resortChildren(node) {
92
96
  return node.children.sort(function (t1, t2) {
93
97
  // Get current address segments:
@@ -104,7 +108,6 @@ function resortChildren(node) {
104
108
  .orDefaultLazy(function () { return (segment1.isNothing() ? -1 : 1); });
105
109
  });
106
110
  }
107
- exports.resortChildren = resortChildren;
108
111
  function retreatTree(nav, investment, tree) {
109
112
  // First, retreat all children (recursive):
110
113
  tree.children.forEach(function (x) { return retreatTree(nav, investment, x); });
@@ -113,7 +116,6 @@ function retreatTree(nav, investment, tree) {
113
116
  // Resort children:
114
117
  tree.children = resortChildren(tree);
115
118
  }
116
- exports.retreatTree = retreatTree;
117
119
  function makeValuationReportHoldingsTreeNode(address) {
118
120
  return {
119
121
  name: prelude_1.List.last(address)
@@ -125,7 +127,6 @@ function makeValuationReportHoldingsTreeNode(address) {
125
127
  totals: makeValuationReportHoldingsTreeNodeValue(),
126
128
  };
127
129
  }
128
- exports.makeValuationReportHoldingsTreeNode = makeValuationReportHoldingsTreeNode;
129
130
  function addValuationReportHoldingToTree(tree, address, holding) {
130
131
  var e_1, _a;
131
132
  // Get the starting (current) node:
@@ -164,7 +165,6 @@ function addValuationReportHoldingToTree(tree, address, holding) {
164
165
  // Done, we append the holding to the current node and return from the procedure:
165
166
  node.holdings.push(holding);
166
167
  }
167
- exports.addValuationReportHoldingToTree = addValuationReportHoldingToTree;
168
168
  function makeValuationReportHoldingsTree(nav, investment, holdings, addressKey) {
169
169
  var e_2, _a;
170
170
  if (addressKey === void 0) { addressKey = 'classification'; }
@@ -192,4 +192,3 @@ function makeValuationReportHoldingsTree(nav, investment, holdings, addressKey)
192
192
  // Done, return:
193
193
  return tree;
194
194
  }
195
- exports.makeValuationReportHoldingsTree = makeValuationReportHoldingsTree;
@@ -25,7 +25,10 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
25
25
  return to.concat(ar || Array.prototype.slice.call(from));
26
26
  };
27
27
  Object.defineProperty(exports, "__esModule", { value: true });
28
- exports.addressers = exports.makeSimpleAddresser = exports.composeHoldingAddressers = exports.compareStringArrays = void 0;
28
+ exports.addressers = void 0;
29
+ exports.compareStringArrays = compareStringArrays;
30
+ exports.composeHoldingAddressers = composeHoldingAddressers;
31
+ exports.makeSimpleAddresser = makeSimpleAddresser;
29
32
  function compareStringArrays(x, y) {
30
33
  var xLen = x.length;
31
34
  var yLen = y.length;
@@ -38,13 +41,11 @@ function compareStringArrays(x, y) {
38
41
  }
39
42
  return Math.sign(xLen - yLen);
40
43
  }
41
- exports.compareStringArrays = compareStringArrays;
42
44
  function composeHoldingAddressers(addressers) {
43
45
  return function (holding) {
44
46
  return addressers.reduce(function (p, c) { return __spreadArray(__spreadArray([], __read(p), false), __read(c(holding)), false); }, []);
45
47
  };
46
48
  }
47
- exports.composeHoldingAddressers = composeHoldingAddressers;
48
49
  function makeSimpleAddresser(def, labeler) {
49
50
  return function (holding) {
50
51
  // Attempt to get the label:
@@ -55,7 +56,6 @@ function makeSimpleAddresser(def, labeler) {
55
56
  return [{ name: value, order: value }];
56
57
  };
57
58
  }
58
- exports.makeSimpleAddresser = makeSimpleAddresser;
59
59
  exports.addressers = {
60
60
  classification: function (holding) {
61
61
  // Get the classification:
@@ -1,11 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isValuationChildHolding = exports.isValuationHolding = void 0;
3
+ exports.isValuationHolding = isValuationHolding;
4
+ exports.isValuationChildHolding = isValuationChildHolding;
4
5
  function isValuationHolding(x) {
5
6
  return 'accounts' in x;
6
7
  }
7
- exports.isValuationHolding = isValuationHolding;
8
8
  function isValuationChildHolding(x) {
9
9
  return 'account' in x;
10
10
  }
11
- exports.isValuationChildHolding = isValuationChildHolding;
package/shell.nix CHANGED
@@ -1,6 +1,11 @@
1
- { ... }:
1
+ with import (fetchTarball "https://github.com/NixOS/nixpkgs/archive/24.05.tar.gz") { };
2
2
 
3
- let
4
- nix = import ./nix { };
5
- in
6
- nix.shell
3
+ stdenv.mkDerivation {
4
+ name = "decaf-client-javascript-extras";
5
+
6
+ buildInputs = with pkgs; [
7
+ nodejs_20
8
+ ];
9
+
10
+ NODE_OPTIONS = "--max-old-space-size=4096";
11
+ }
package/.eslintignore DELETED
@@ -1,3 +0,0 @@
1
- lib
2
- docs
3
- .husky
package/.eslintrc.js DELETED
@@ -1,23 +0,0 @@
1
- module.exports = {
2
- env: {
3
- browser: true,
4
- es6: true,
5
- },
6
- globals: {
7
- Atomics: 'readonly',
8
- SharedArrayBuffer: 'readonly',
9
- },
10
- parser: '@typescript-eslint/parser',
11
- parserOptions: {
12
- ecmaVersion: 2018,
13
- sourceType: 'module',
14
- },
15
- plugins: ['@typescript-eslint', 'prettier'],
16
- extends: ['standard', 'prettier', 'plugin:prettier/recommended', 'plugin:@typescript-eslint/eslint-recommended'],
17
- rules: {
18
- 'prettier/prettier': 'error',
19
- '@typescript-eslint/explicit-function-return-type': 'off',
20
- 'no-use-before-define': 'off',
21
- '@typescript-eslint/no-use-before-define': ['error'],
22
- },
23
- };
package/nix/default.nix DELETED
@@ -1,58 +0,0 @@
1
- { ... }:
2
-
3
- let
4
- ## Set the name:
5
- name = "decaf-client-javascript-extras";
6
-
7
- ## Repository root:
8
- root = ../.;
9
-
10
- ## Import sources:
11
- sources = import ./sources.nix;
12
-
13
- ## Import telosnix:
14
- telosnix = import sources.telosnix { };
15
-
16
- ## Import nixpkgs:
17
- pkgs = import telosnix.pkgs-sources.stable { };
18
-
19
- ## Get the devshell:
20
- devshell = telosnix.tools.devshell {
21
- name = "${name}-devshell";
22
- src = ./.;
23
- quickstart = ../README.md;
24
- guide = [
25
- { name = "readme"; title = "Introduction"; path = ../README.md; }
26
- ];
27
- extensions = { };
28
- };
29
-
30
- ## Declare dependencies for our shell:
31
- deps = [
32
- pkgs.git
33
- pkgs.nodejs
34
-
35
- devshell
36
- ];
37
-
38
- ## Define our shell:
39
- shell = pkgs.mkShell {
40
- buildInputs = deps;
41
-
42
- shellHook = ''
43
- ## Greet:
44
- devsh welcome
45
- '';
46
-
47
- DEVSHELL_ROOT = "${toString root}";
48
- DECAF_JS_SKIP_POSTINSTALL = "1";
49
- };
50
-
51
- in
52
- {
53
- name = name;
54
- pkgs = pkgs;
55
- sources = sources;
56
- telosnix = telosnix;
57
- shell = shell;
58
- }
package/nix/sources.json DELETED
@@ -1,14 +0,0 @@
1
- {
2
- "telosnix": {
3
- "branch": "v0.0.6",
4
- "description": null,
5
- "homepage": null,
6
- "owner": "telostat",
7
- "repo": "telos.nix",
8
- "rev": "c0b76b80df8c8cc61383bee9fdcb81e45b53f919",
9
- "sha256": "08kd5ivhm3hjkiw28cifmbjywbm7fsvzbwb7prsdnqmam6ij278i",
10
- "type": "tarball",
11
- "url": "https://github.com/telostat/telos.nix/archive/c0b76b80df8c8cc61383bee9fdcb81e45b53f919.tar.gz",
12
- "url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
13
- }
14
- }
package/nix/sources.nix DELETED
@@ -1,194 +0,0 @@
1
- # This file has been generated by Niv.
2
-
3
- let
4
-
5
- #
6
- # The fetchers. fetch_<type> fetches specs of type <type>.
7
- #
8
-
9
- fetch_file = pkgs: name: spec:
10
- let
11
- name' = sanitizeName name + "-src";
12
- in
13
- if spec.builtin or true then
14
- builtins_fetchurl { inherit (spec) url sha256; name = name'; }
15
- else
16
- pkgs.fetchurl { inherit (spec) url sha256; name = name'; };
17
-
18
- fetch_tarball = pkgs: name: spec:
19
- let
20
- name' = sanitizeName name + "-src";
21
- in
22
- if spec.builtin or true then
23
- builtins_fetchTarball { name = name'; inherit (spec) url sha256; }
24
- else
25
- pkgs.fetchzip { name = name'; inherit (spec) url sha256; };
26
-
27
- fetch_git = name: spec:
28
- let
29
- ref =
30
- if spec ? ref then spec.ref else
31
- if spec ? branch then "refs/heads/${spec.branch}" else
32
- if spec ? tag then "refs/tags/${spec.tag}" else
33
- abort "In git source '${name}': Please specify `ref`, `tag` or `branch`!";
34
- submodules = if spec ? submodules then spec.submodules else false;
35
- submoduleArg =
36
- let
37
- nixSupportsSubmodules = builtins.compareVersions builtins.nixVersion "2.4" >= 0;
38
- emptyArgWithWarning =
39
- if submodules == true
40
- then
41
- builtins.trace
42
- (
43
- "The niv input \"${name}\" uses submodules "
44
- + "but your nix's (${builtins.nixVersion}) builtins.fetchGit "
45
- + "does not support them"
46
- )
47
- {}
48
- else {};
49
- in
50
- if nixSupportsSubmodules
51
- then { inherit submodules; }
52
- else emptyArgWithWarning;
53
- in
54
- builtins.fetchGit
55
- ({ url = spec.repo; inherit (spec) rev; inherit ref; } // submoduleArg);
56
-
57
- fetch_local = spec: spec.path;
58
-
59
- fetch_builtin-tarball = name: throw
60
- ''[${name}] The niv type "builtin-tarball" is deprecated. You should instead use `builtin = true`.
61
- $ niv modify ${name} -a type=tarball -a builtin=true'';
62
-
63
- fetch_builtin-url = name: throw
64
- ''[${name}] The niv type "builtin-url" will soon be deprecated. You should instead use `builtin = true`.
65
- $ niv modify ${name} -a type=file -a builtin=true'';
66
-
67
- #
68
- # Various helpers
69
- #
70
-
71
- # https://github.com/NixOS/nixpkgs/pull/83241/files#diff-c6f540a4f3bfa4b0e8b6bafd4cd54e8bR695
72
- sanitizeName = name:
73
- (
74
- concatMapStrings (s: if builtins.isList s then "-" else s)
75
- (
76
- builtins.split "[^[:alnum:]+._?=-]+"
77
- ((x: builtins.elemAt (builtins.match "\\.*(.*)" x) 0) name)
78
- )
79
- );
80
-
81
- # The set of packages used when specs are fetched using non-builtins.
82
- mkPkgs = sources: system:
83
- let
84
- sourcesNixpkgs =
85
- import (builtins_fetchTarball { inherit (sources.nixpkgs) url sha256; }) { inherit system; };
86
- hasNixpkgsPath = builtins.any (x: x.prefix == "nixpkgs") builtins.nixPath;
87
- hasThisAsNixpkgsPath = <nixpkgs> == ./.;
88
- in
89
- if builtins.hasAttr "nixpkgs" sources
90
- then sourcesNixpkgs
91
- else if hasNixpkgsPath && ! hasThisAsNixpkgsPath then
92
- import <nixpkgs> {}
93
- else
94
- abort
95
- ''
96
- Please specify either <nixpkgs> (through -I or NIX_PATH=nixpkgs=...) or
97
- add a package called "nixpkgs" to your sources.json.
98
- '';
99
-
100
- # The actual fetching function.
101
- fetch = pkgs: name: spec:
102
-
103
- if ! builtins.hasAttr "type" spec then
104
- abort "ERROR: niv spec ${name} does not have a 'type' attribute"
105
- else if spec.type == "file" then fetch_file pkgs name spec
106
- else if spec.type == "tarball" then fetch_tarball pkgs name spec
107
- else if spec.type == "git" then fetch_git name spec
108
- else if spec.type == "local" then fetch_local spec
109
- else if spec.type == "builtin-tarball" then fetch_builtin-tarball name
110
- else if spec.type == "builtin-url" then fetch_builtin-url name
111
- else
112
- abort "ERROR: niv spec ${name} has unknown type ${builtins.toJSON spec.type}";
113
-
114
- # If the environment variable NIV_OVERRIDE_${name} is set, then use
115
- # the path directly as opposed to the fetched source.
116
- replace = name: drv:
117
- let
118
- saneName = stringAsChars (c: if isNull (builtins.match "[a-zA-Z0-9]" c) then "_" else c) name;
119
- ersatz = builtins.getEnv "NIV_OVERRIDE_${saneName}";
120
- in
121
- if ersatz == "" then drv else
122
- # this turns the string into an actual Nix path (for both absolute and
123
- # relative paths)
124
- if builtins.substring 0 1 ersatz == "/" then /. + ersatz else /. + builtins.getEnv "PWD" + "/${ersatz}";
125
-
126
- # Ports of functions for older nix versions
127
-
128
- # a Nix version of mapAttrs if the built-in doesn't exist
129
- mapAttrs = builtins.mapAttrs or (
130
- f: set: with builtins;
131
- listToAttrs (map (attr: { name = attr; value = f attr set.${attr}; }) (attrNames set))
132
- );
133
-
134
- # https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/lists.nix#L295
135
- range = first: last: if first > last then [] else builtins.genList (n: first + n) (last - first + 1);
136
-
137
- # https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/strings.nix#L257
138
- stringToCharacters = s: map (p: builtins.substring p 1 s) (range 0 (builtins.stringLength s - 1));
139
-
140
- # https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/strings.nix#L269
141
- stringAsChars = f: s: concatStrings (map f (stringToCharacters s));
142
- concatMapStrings = f: list: concatStrings (map f list);
143
- concatStrings = builtins.concatStringsSep "";
144
-
145
- # https://github.com/NixOS/nixpkgs/blob/8a9f58a375c401b96da862d969f66429def1d118/lib/attrsets.nix#L331
146
- optionalAttrs = cond: as: if cond then as else {};
147
-
148
- # fetchTarball version that is compatible between all the versions of Nix
149
- builtins_fetchTarball = { url, name ? null, sha256 }@attrs:
150
- let
151
- inherit (builtins) lessThan nixVersion fetchTarball;
152
- in
153
- if lessThan nixVersion "1.12" then
154
- fetchTarball ({ inherit url; } // (optionalAttrs (!isNull name) { inherit name; }))
155
- else
156
- fetchTarball attrs;
157
-
158
- # fetchurl version that is compatible between all the versions of Nix
159
- builtins_fetchurl = { url, name ? null, sha256 }@attrs:
160
- let
161
- inherit (builtins) lessThan nixVersion fetchurl;
162
- in
163
- if lessThan nixVersion "1.12" then
164
- fetchurl ({ inherit url; } // (optionalAttrs (!isNull name) { inherit name; }))
165
- else
166
- fetchurl attrs;
167
-
168
- # Create the final "sources" from the config
169
- mkSources = config:
170
- mapAttrs (
171
- name: spec:
172
- if builtins.hasAttr "outPath" spec
173
- then abort
174
- "The values in sources.json should not have an 'outPath' attribute"
175
- else
176
- spec // { outPath = replace name (fetch config.pkgs name spec); }
177
- ) config.sources;
178
-
179
- # The "config" used by the fetchers
180
- mkConfig =
181
- { sourcesFile ? if builtins.pathExists ./sources.json then ./sources.json else null
182
- , sources ? if isNull sourcesFile then {} else builtins.fromJSON (builtins.readFile sourcesFile)
183
- , system ? builtins.currentSystem
184
- , pkgs ? mkPkgs sources system
185
- }: rec {
186
- # The sources, i.e. the attribute set of spec name to spec
187
- inherit sources;
188
-
189
- # The "pkgs" (evaluated nixpkgs) to use for e.g. non-builtin fetchers
190
- inherit pkgs;
191
- };
192
-
193
- in
194
- mkSources (mkConfig {}) // { __functor = _: settings: mkSources (mkConfig settings); }