suttacentral-api 2.2.114 → 2.3.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.
Files changed (22) hide show
  1. package/.github/workflows/schedule-actions.yml +2 -4
  2. package/api/sc.suttaplex/00/00c4f6294a7537ce1599635955cfd730.json +2 -2
  3. package/api/sc.suttaplex/1e/1ecfa5fa2d1f4ddbb65bda71c67aec09.json +1 -1
  4. package/api/sc.suttaplex/21/2144b13d275e2bf5a0806e4b28fb4886.json +3 -3
  5. package/api/sc.suttaplex/22/22f785839e7ab570863fbbd4666e69a2.json +2 -2
  6. package/api/sc.suttaplex/2d/2d117ea53c4a22170e6079b1401cd2ea.json +1 -1
  7. package/api/sc.suttaplex/2f/2fdd3b795492c261b46886efe28d0861.json +1 -1
  8. package/api/sc.suttaplex/3d/3d3b461f03bf24b144a5301b2f689d5a.json +2 -2
  9. package/api/sc.suttaplex/55/555d6a07fa0ae1810dc567ba6ec31417.json +1 -1
  10. package/api/sc.suttaplex/61/61faf54411adbf7b3116443cb08018ca.json +2 -2
  11. package/api/sc.suttaplex/70/70ca2f0ddbbc6954689bfacda7e66f7a.json +1 -1
  12. package/api/sc.suttaplex/75/7503ddf66cb3670d4cfd89040c46c407.json +1 -1
  13. package/api/sc.suttaplex/7f/7f084f054eb02a1c01f9d6366db4c42e.json +2 -2
  14. package/api/sc.suttaplex/81/8156d0bdf1b26a5c9ccdda1252078297.json +2 -2
  15. package/api/sc.suttaplex/85/85770168c1d5bf32d5f4c01f5050b7f6.json +1 -1
  16. package/api/sc.suttaplex/9a/9a93e12c69839d68ded058faba77a808.json +14 -0
  17. package/api/sc.suttaplex/b1/b193dfc39f3d1616a0ecab4241740cf8.json +2 -2
  18. package/api/sc.suttaplex/bb/bbf20c8f0fc52d97da0fc37afa747116.json +1 -1
  19. package/api/sc.suttaplex/f2/f2c3a708697118b1e41c7589b7c1ce2c.json +2 -2
  20. package/api/sc.suttaplex/fe/fe2970c5a322327609dd3e8ff24a56ca.json +1 -1
  21. package/package.json +4 -4
  22. package/test/sc-api.js +14 -10
@@ -7,10 +7,8 @@ jobs:
7
7
  timeout-minutes: 30
8
8
  runs-on: ubuntu-latest
9
9
  steps:
10
- - uses: actions/checkout@v2
11
- with:
12
- fetch-depth: 0
13
- - uses: actions/setup-node@v2
10
+ - uses: actions/checkout@v3
11
+ - uses: actions/setup-node@v3
14
12
  with:
15
13
  node-version: '14.x'
16
14
  registry-url: 'https://registry.npmjs.org'
@@ -16,7 +16,7 @@
16
16
  "root_lang": "pli",
17
17
  "root_lang_name": "Pāli",
18
18
  "type": "leaf",
19
- "translated_title": "Accomplishment in Rational Attention (2nd) ",
19
+ "translated_title": "Accomplishment in Rational Application of Mind (2nd) ",
20
20
  "translations": [
21
21
  {
22
22
  "lang": "pli",
@@ -82,7 +82,7 @@
82
82
  "publication_date": null,
83
83
  "id": "sn45.90_translation-en-sujato",
84
84
  "segmented": true,
85
- "title": "Accomplishment in Rational Attention (2nd) ",
85
+ "title": "Accomplishment in Rational Application of Mind (2nd) ",
86
86
  "volpage": null,
87
87
  "has_comment": false
88
88
  },
@@ -109,7 +109,7 @@
109
109
  "publication_date": null,
110
110
  "id": "sn53.1-12_translation-lt-piyadassi",
111
111
  "segmented": true,
112
- "title": "1-12. Džhana ir t.t. ",
112
+ "title": "Džhana ir taip toliau",
113
113
  "volpage": null,
114
114
  "has_comment": false
115
115
  },
@@ -16,7 +16,7 @@
16
16
  "root_lang": "pli",
17
17
  "root_lang_name": "Pāli",
18
18
  "type": "leaf",
19
- "translated_title": "Deeds of Substance ",
19
+ "translated_title": "Fitting Deeds ",
20
20
  "translations": [
21
21
  {
22
22
  "lang": "pli",
@@ -69,7 +69,7 @@
69
69
  "publication_date": null,
70
70
  "id": "an4.61_translation-de-sabbamitta",
71
71
  "segmented": true,
72
- "title": "Gute Verwendung ",
72
+ "title": "Passende Taten ",
73
73
  "volpage": null,
74
74
  "has_comment": false
75
75
  },
@@ -96,7 +96,7 @@
96
96
  "publication_date": null,
97
97
  "id": "an4.61_translation-en-sujato",
98
98
  "segmented": true,
99
- "title": "Deeds of Substance ",
99
+ "title": "Fitting Deeds ",
100
100
  "volpage": null,
101
101
  "has_comment": false
102
102
  },
@@ -16,7 +16,7 @@
16
16
  "root_lang": "pli",
17
17
  "root_lang_name": "Pāli",
18
18
  "type": "leaf",
19
- "translated_title": "Irrational Attention ",
19
+ "translated_title": "Irrational Application of Mind ",
20
20
  "translations": [
21
21
  {
22
22
  "lang": "pli",
@@ -82,7 +82,7 @@
82
82
  "publication_date": null,
83
83
  "id": "sn46.24_translation-en-sujato",
84
84
  "segmented": true,
85
- "title": "Irrational Attention ",
85
+ "title": "Irrational Application of Mind ",
86
86
  "volpage": null,
87
87
  "has_comment": false
88
88
  },
@@ -109,7 +109,7 @@
109
109
  "publication_date": null,
110
110
  "id": "sn15.6_translation-lt-piyadassi",
111
111
  "segmented": true,
112
- "title": "Garstyčių sėkla",
112
+ "title": "Garstyčių sėklos",
113
113
  "volpage": null,
114
114
  "has_comment": false
115
115
  },
@@ -149,7 +149,7 @@
149
149
  "publication_date": null,
150
150
  "id": "sn22.14_translation-lt-piyadassi",
151
151
  "segmented": true,
152
- "title": "Sutta apie savasties nebuvimą",
152
+ "title": "Ne savastis",
153
153
  "volpage": null,
154
154
  "has_comment": false
155
155
  },
@@ -16,7 +16,7 @@
16
16
  "root_lang": "pli",
17
17
  "root_lang_name": "Pāli",
18
18
  "type": "leaf",
19
- "translated_title": "Accomplishment in Rational Attention (2nd) ",
19
+ "translated_title": "Accomplishment in Rational Application of Mind (2nd) ",
20
20
  "translations": [
21
21
  {
22
22
  "lang": "pli",
@@ -82,7 +82,7 @@
82
82
  "publication_date": null,
83
83
  "id": "sn45.76_translation-en-sujato",
84
84
  "segmented": true,
85
- "title": "Accomplishment in Rational Attention (2nd) ",
85
+ "title": "Accomplishment in Rational Application of Mind (2nd) ",
86
86
  "volpage": null,
87
87
  "has_comment": false
88
88
  },
@@ -149,7 +149,7 @@
149
149
  "publication_date": null,
150
150
  "id": "sn22.13_translation-lt-piyadassi",
151
151
  "segmented": true,
152
- "title": "Кančiа",
152
+ "title": "Nepatenkinami",
153
153
  "volpage": null,
154
154
  "has_comment": false
155
155
  },
@@ -16,7 +16,7 @@
16
16
  "root_lang": "pli",
17
17
  "root_lang_name": "Pāli",
18
18
  "type": "leaf",
19
- "translated_title": "Accomplishment in Rational Attention ",
19
+ "translated_title": "Accomplishment in Rational Application of Mind ",
20
20
  "translations": [
21
21
  {
22
22
  "lang": "pli",
@@ -82,7 +82,7 @@
82
82
  "publication_date": null,
83
83
  "id": "sn45.83_translation-en-sujato",
84
84
  "segmented": true,
85
- "title": "Accomplishment in Rational Attention ",
85
+ "title": "Accomplishment in Rational Application of Mind ",
86
86
  "volpage": null,
87
87
  "has_comment": false
88
88
  },
@@ -122,7 +122,7 @@
122
122
  "publication_date": null,
123
123
  "id": "sn35.240_translation-lt-piyadassi",
124
124
  "segmented": true,
125
- "title": "Vėžlys",
125
+ "title": "Palyginimas su vėžliu",
126
126
  "volpage": null,
127
127
  "has_comment": false
128
128
  },
@@ -136,7 +136,7 @@
136
136
  "publication_date": null,
137
137
  "id": "sn15.8_translation-lt-piyadassi",
138
138
  "segmented": true,
139
- "title": "Gangas",
139
+ "title": "Ganga",
140
140
  "volpage": null,
141
141
  "has_comment": false
142
142
  },
@@ -16,7 +16,7 @@
16
16
  "root_lang": "pli",
17
17
  "root_lang_name": "Pāli",
18
18
  "type": "leaf",
19
- "translated_title": "Irrational Attention ",
19
+ "translated_title": "Irrational Application of Mind ",
20
20
  "translations": [
21
21
  {
22
22
  "lang": "pli",
@@ -82,7 +82,7 @@
82
82
  "publication_date": null,
83
83
  "id": "sn46.35_translation-en-sujato",
84
84
  "segmented": true,
85
- "title": "Irrational Attention ",
85
+ "title": "Irrational Application of Mind ",
86
86
  "volpage": null,
87
87
  "has_comment": false
88
88
  },
@@ -16,7 +16,7 @@
16
16
  "root_lang": "pli",
17
17
  "root_lang_name": "Pāli",
18
18
  "type": "leaf",
19
- "translated_title": "Accomplishment in Rational Attention (1st) ",
19
+ "translated_title": "Accomplishment in Rational Application of Mind (1st) ",
20
20
  "translations": [
21
21
  {
22
22
  "lang": "pli",
@@ -82,7 +82,7 @@
82
82
  "publication_date": null,
83
83
  "id": "sn45.55_translation-en-sujato",
84
84
  "segmented": true,
85
- "title": "Accomplishment in Rational Attention (1st) ",
85
+ "title": "Accomplishment in Rational Application of Mind (1st) ",
86
86
  "volpage": null,
87
87
  "has_comment": false
88
88
  },
@@ -109,7 +109,7 @@
109
109
  "publication_date": null,
110
110
  "id": "sn15.10_translation-lt-piyadassi",
111
111
  "segmented": true,
112
- "title": "Asmuo",
112
+ "title": "Vienas asmuo",
113
113
  "volpage": null,
114
114
  "has_comment": false
115
115
  },
@@ -48,6 +48,20 @@
48
48
  "volpage": null,
49
49
  "has_comment": false
50
50
  },
51
+ {
52
+ "lang": "de",
53
+ "lang_name": "Deutsch",
54
+ "is_root": false,
55
+ "author": "Sabbamitta",
56
+ "author_short": "sabbamitta",
57
+ "author_uid": "sabbamitta",
58
+ "publication_date": null,
59
+ "id": "mn143_translation-de-sabbamitta",
60
+ "segmented": true,
61
+ "title": "Rat an Anāthapiṇḍika ",
62
+ "volpage": null,
63
+ "has_comment": false
64
+ },
51
65
  {
52
66
  "lang": "de",
53
67
  "lang_name": "Deutsch",
@@ -16,7 +16,7 @@
16
16
  "root_lang": "pli",
17
17
  "root_lang_name": "Pāli",
18
18
  "type": "leaf",
19
- "translated_title": "Accomplishment in Rational Attention (1st) ",
19
+ "translated_title": "Accomplishment in Rational Application of Mind (1st) ",
20
20
  "translations": [
21
21
  {
22
22
  "lang": "pli",
@@ -82,7 +82,7 @@
82
82
  "publication_date": null,
83
83
  "id": "sn45.69_translation-en-sujato",
84
84
  "segmented": true,
85
- "title": "Accomplishment in Rational Attention (1st) ",
85
+ "title": "Accomplishment in Rational Application of Mind (1st) ",
86
86
  "volpage": null,
87
87
  "has_comment": false
88
88
  },
@@ -150,7 +150,7 @@
150
150
  "publication_date": null,
151
151
  "id": "sn56.37_translation-lt-piyadassi",
152
152
  "segmented": true,
153
- "title": "Pirma sutta apie saulę",
153
+ "title": "Pirmoji sutta apie saulę",
154
154
  "volpage": null,
155
155
  "has_comment": false
156
156
  },
@@ -16,7 +16,7 @@
16
16
  "root_lang": "pli",
17
17
  "root_lang_name": "Pāli",
18
18
  "type": "leaf",
19
- "translated_title": "Accomplishment in Rational Attention (2nd) ",
19
+ "translated_title": "Accomplishment in Rational Application of Mind (2nd) ",
20
20
  "translations": [
21
21
  {
22
22
  "lang": "pli",
@@ -82,7 +82,7 @@
82
82
  "publication_date": null,
83
83
  "id": "sn45.62_translation-en-sujato",
84
84
  "segmented": true,
85
- "title": "Accomplishment in Rational Attention (2nd) ",
85
+ "title": "Accomplishment in Rational Application of Mind (2nd) ",
86
86
  "volpage": null,
87
87
  "has_comment": false
88
88
  },
@@ -242,7 +242,7 @@
242
242
  "publication_date": null,
243
243
  "id": "sn56.11_translation-lt-piyadassi",
244
244
  "segmented": true,
245
- "title": "Dhammos rato įsukimas",
245
+ "title": "Dhammos rato paleidimas",
246
246
  "volpage": null,
247
247
  "has_comment": false
248
248
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "suttacentral-api",
3
- "version": "2.2.114",
3
+ "version": "2.3.0",
4
4
  "description": "SuttaCentral API cached proxy",
5
5
  "main": "index.js",
6
6
  "directories": {
@@ -8,12 +8,12 @@
8
8
  },
9
9
  "dependencies": {
10
10
  "axios": "^0.21.1",
11
- "log-instance": "^0.2.5",
12
- "memo-again": "^0.3.11",
11
+ "log-instance": "^1.4.0",
12
+ "memo-again": "^0.7.0",
13
13
  "merkle-json": "^1.1.4"
14
14
  },
15
15
  "devDependencies": {
16
- "mocha": "^7.1.1",
16
+ "mocha": "^10.2.0",
17
17
  "should": "^11.2.0"
18
18
  },
19
19
  "scripts": {
package/test/sc-api.js CHANGED
@@ -11,14 +11,14 @@
11
11
 
12
12
  const SUTTAPLEX_SNP1_8_2021 = {
13
13
  acronym: 'Snp 1.8',
14
- volpages: 'Snp 25',
14
+ volpages: ' PTS 26',
15
15
  uid: 'snp1.8',
16
16
  difficulty: null,
17
17
  original_title: 'Mettasutta',
18
18
  root_lang: 'pli',
19
19
  type: 'leaf',
20
20
  from: null,
21
- translated_title: 'Loving-kindness',
21
+ translated_title: 'The Discourse on Love ',
22
22
  parallel_count: 1,
23
23
  biblio: null,
24
24
  };
@@ -38,7 +38,7 @@
38
38
  num: 8,
39
39
  };
40
40
  const SUTTAPLEX_AN2_12_2021 = {
41
- acronym: null,
41
+ acronym: 'AN 2.11–20',
42
42
  uid: 'an2.11-20',
43
43
  blurb: null,
44
44
  difficulty: null,
@@ -151,6 +151,7 @@
151
151
  author: 'Thích Nhất Hạnh, Annabel Laity',
152
152
  author_short: 'Nhất Hạnh …',
153
153
  author_uid: 'nhat_hanh-laity',
154
+ has_comment: false,
154
155
  id: 'en_ea12.1_nhat_hanh-laity',
155
156
  lang: 'en',
156
157
  lang_name: 'English',
@@ -264,9 +265,10 @@
264
265
  'api/sc.suttaplex/33/33f16195a6a5adf83f89753c89e2db11.json');
265
266
  should(fs.existsSync(deadMemo2)).equal(false);
266
267
  });
267
- it("loadLegacySutta(...) => legacy german sutta", async()=>{
268
+ it("TESTTESTloadLegacySutta(...) => legacy german sutta", async()=>{
269
+ return; // no longer legacy
268
270
  var sca = await new ScApi().initialize();
269
- var scid = 'dn1';
271
+ var scid = 'thig1.1';
270
272
  var language = 'de';
271
273
  var sutta = await sca.loadLegacySutta(scid,language);
272
274
  should.deepEqual(sutta.segmented, false);
@@ -279,7 +281,8 @@
279
281
  var sutta = await sca.loadLegacySutta(scid, language, 'sujato');
280
282
  should(sutta).equal(null);
281
283
  });
282
- it("loadLegacySutta(...) => list of Snp1.8 en translations", async()=>{
284
+ it("TESTTESTloadLegacySutta(...) => list of Snp1.8 en translations", async()=>{
285
+ return; // no longer legacy
283
286
  var sca = await new ScApi().initialize();
284
287
  var scid = 'snp1.8';
285
288
  var language = 'en';
@@ -292,6 +295,7 @@
292
295
  should.deepEqual(translations[0], TRANSLATIONS_SNP1_8_2021);
293
296
  });
294
297
  it("TESTTESTloadLegacySutta(...) => en translations for Snp1.8", async()=>{
298
+ return; // no longer legacy
295
299
  var sca = await new ScApi().initialize();
296
300
  var language = 'en';
297
301
  var sutta = await sca.loadLegacySutta({
@@ -321,7 +325,7 @@
321
325
  should(segments[i].pli).match(/Mettasutta/um);
322
326
  should(segments.length).equal(17);
323
327
  });
324
- it("loadLegacySutta(...) => en translations for ea12.1", async()=>{
328
+ it("TESTTESTloadLegacySutta(...) => en translations for ea12.1", async()=>{
325
329
  var sca = await new ScApi().initialize();
326
330
  var language = 'en';
327
331
  var sutta = await sca.loadLegacySutta({
@@ -392,7 +396,7 @@
392
396
  should(err).instanceOf(Error);
393
397
  logger.warn("EXPECTED WARN (END)");
394
398
  });
395
- it("loadLegacySutta(...) => an2.12 as part of an2.11-20", async()=>{
399
+ it("TESTTESTloadLegacySutta(...) => an2.12 as part of an2.11-20", async()=>{
396
400
  var sca = await new ScApi().initialize();
397
401
  var language = 'en';
398
402
  var sutta = await sca.loadLegacySutta('an2.12');
@@ -492,7 +496,7 @@
492
496
  should(spx.translations.length).equal(2); // German translations
493
497
 
494
498
  });
495
- it("suttaFromHtml(html, opts) parses HTML", async()=>{
499
+ it("TESTTESTsuttaFromHtml(html, opts) parses HTML", async()=>{
496
500
  var sca = await new ScApi().initialize();
497
501
  var text = [
498
502
  'hello',
@@ -520,7 +524,7 @@
520
524
  should(sutta.segments.length).equal(4);
521
525
  should.deepEqual(sutta.segments[0], {
522
526
  scid: 'sn12.23:0.1',
523
- de: 'Saṃyutta Nikāya 12.23',
527
+ de: 'Saṁyutta Nikāya 12.23',
524
528
  });
525
529
  should.deepEqual(sutta.segments[1], {
526
530
  scid: 'sn12.23:0.2',