@indra.ai/deva.veda 0.2.6 → 0.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.
package/data/manu/12.json DELETED
@@ -1,274 +0,0 @@
1
- {
2
- "id": 7093585630692,
3
- "title": "CHAPTER XII.",
4
- "created": "Tuesday, April 15, 2025 - 7:12:33 PM",
5
- "hash": "md5-PtMPYx7pIs3RaGu0LHo/ag==",
6
- "data": [
7
- {
8
- "id": 5518809520321,
9
- "dbid": "67ff121147a1ca29c903190b",
10
- "law": "Action which springs from the mind, from speech, and from the body produces either good or evil results. By action are caused the various conditions of men, the highest, the middling, and the lowest. Know that the mind is the instigator here below, even to that action which is connected with the body, and which is of three kinds, has three locations, and falls under ten heads.",
11
- "created": "Tuesday, April 15, 2025 - 7:12:33 PM",
12
- "hash": "md5-ELqvAYLDMmRNcMInuneqrA=="
13
- },
14
- {
15
- "id": 1854534704475,
16
- "dbid": "67ff121147a1ca29c903190c",
17
- "law": "Coveting the property of others, thinking in one's heart of what is undesirable, and adherence to false doctrines, are the three kinds of evil mental action. Abusing others, speaking untruth, detracting from the merits of others, and talking idly, shall be the four kinds of evil verbal action. Taking what has not been given, injuring creatures without the sanction of the law, and holding criminal intercourse with another man's wife, are declared to be the three kinds of evil bodily action. A man obtains the result of a good or evil mental act in his mind, that of a verbal act in his speech, that of a bodily act in his body.",
18
- "created": "Tuesday, April 15, 2025 - 7:12:33 PM",
19
- "hash": "md5-+1A08VrRxWvPQS5fZ+Cu+Q=="
20
- },
21
- {
22
- "id": 5889223444113,
23
- "dbid": "67ff121147a1ca29c903190d",
24
- "law": "That man is called a true Tridandin in whose mind these three, the control over his speech (vagdanda), the control over his thoughts (manodanda), and the control over his body (kayadanda), are firmly fixed. That man who keeps this threefold control (over himself) with respect to all created beings and wholly subdues desire and wrath, thereby assuredly gains complete success.",
25
- "created": "Tuesday, April 15, 2025 - 7:12:33 PM",
26
- "hash": "md5-LEAG0dEdav3SUD6uLJPVfw=="
27
- },
28
- {
29
- "id": 3666830961688,
30
- "dbid": "67ff121147a1ca29c903190e",
31
- "law": "Him who impels this corporeal Self to action, they call the Kshetragna (the knower of the field); but him who does the acts, the wise name the Bhutatman (the Self consisting of the elements). Another internal Self that is generated with all embodied (Kshetragnas) is called Giva, through which (the Kshetragna) becomes sensible of all pleasure and pain in (successive) births. These two, the Great One and the Kshetragna, who are closely united with the elements, pervade him who resides in the multiform created beings. From his body innumerable forms go forth, which constantly impel the multiform creatures to action.",
32
- "created": "Tuesday, April 15, 2025 - 7:12:33 PM",
33
- "hash": "md5-hw6NMdPcb8RbV4BGRzHjXA=="
34
- },
35
- {
36
- "id": 2241239282358,
37
- "dbid": "67ff121147a1ca29c903190f",
38
- "law": "Another strong body, formed of particles of the five elements and destined to suffer the torments in hell, is produced after death in the case of wicked person. When the evil-doers by means of that body have suffered there the torments imposed by Yama, its constituent parts are united, each according to its class, with those very elements from which they were taken. Having suffered for faults, which are produced by attachment to sensual objects, and which result in misery, approaches, free from stains, those two mighty ones. Those two together examine without tiring the merit and the guilt of that individual soul, united with which it obtains bliss or misery both in this world and the next.",
39
- "created": "Tuesday, April 15, 2025 - 7:12:33 PM",
40
- "hash": "md5-/gy4vG/1CupkDKHoXeztFg=="
41
- },
42
- {
43
- "id": 6244642934564,
44
- "dbid": "67ff121147a1ca29c9031910",
45
- "law": "If the soul chiefly practises virtue and vice to a small degree, it obtains bliss in heaven, clothed with those very elements. But if it chiefly cleaves to vice and to virtue in a small degree, it suffers, deserted by the elements, the torments inflicted by Yama. The individual soul, having endured those torments of Yama, again enters, free from taint, those very five elements, each in due proportion.",
46
- "created": "Tuesday, April 15, 2025 - 7:12:33 PM",
47
- "hash": "md5-acgamliTldXQ4RzNjJNNLQ=="
48
- },
49
- {
50
- "id": 2303445334476,
51
- "dbid": "67ff121147a1ca29c9031911",
52
- "law": "Let man, having recognised even by means of his intellect these transitions of the individual soul which depend on merit and demerit, always fix his heart on the acquisition of merit.",
53
- "created": "Tuesday, April 15, 2025 - 7:12:33 PM",
54
- "hash": "md5-bLtasjfA/S2uFaSTRRHtww=="
55
- },
56
- {
57
- "id": 3797467500977,
58
- "dbid": "67ff121147a1ca29c9031912",
59
- "law": "Know Goodness (sattva), Activity (ragas), and Darkness (tamas) to be the three qualities of the Self, with which the Great One always completely pervades all existences. When one of these qualities wholly predominates in a body, then it makes the embodied (soul) eminently distinguished for that quality. Goodness is declared to have the form of knowledge, Darkness of ignorance, Activity of love and hatred; such is the nature of these three which is all pervading and clings to everything created.",
60
- "created": "Tuesday, April 15, 2025 - 7:12:33 PM",
61
- "hash": "md5-RJFkMPqlRkBMCrogT0ha9w=="
62
- },
63
- {
64
- "id": 2782425429106,
65
- "dbid": "67ff121147a1ca29c9031913",
66
- "law": "When man experiences in his soul a feeling full of bliss, a deep calm, as it were, and a pure light, then let him know that it is among those three the quality called Goodness. What is mixed with pain and does not give satisfaction to the soul one may know to be the quality of Activity, which is difficult to conquer, and which ever draws embodied (souls towards sensual objects. What is coupled with delusion, what has the character of an undiscernible mass, what cannot be fathomed by reasoning, what cannot be fully known, one must consider as the quality of Darkness.",
67
- "created": "Tuesday, April 15, 2025 - 7:12:33 PM",
68
- "hash": "md5-3UaDA5pd7e/yIhqotVgHuw=="
69
- },
70
- {
71
- "id": 4651114732756,
72
- "dbid": "67ff121147a1ca29c9031914",
73
- "law": "The study of the Vedas, austerity, the pursuit of knowledge, purity, control over the organs, the performance of meritorious acts and meditation on the Soul, are the marks of the quality of Goodness. Delighting in undertakings, want of firmness, commission of sinful acts, and continual indulgence in sensual pleasures, are the marks of the quality of Activity. Covetousness, sleepiness, pusillanimity, cruelty, atheism, leading an evil life, a habit of soliciting favours, and inattentiveness, are the marks of the quality of Darkness.",
74
- "created": "Tuesday, April 15, 2025 - 7:12:33 PM",
75
- "hash": "md5-XUtyN+hOhfjUhiMx9ghCqA=="
76
- },
77
- {
78
- "id": 3443185673800,
79
- "dbid": "67ff121147a1ca29c9031915",
80
- "law": "Know, moreover, the following to be a brief description of the three qualities, each in its order, as they appear in the three times, the present, past, and future. When a man, having done, doing, or being about to do any act, feels ashamed, the learned may know that all such acts bear the mark of the quality of Darkness. But, when a man desires to gain by an act much fame in this world and feels no sorrow on failing, know that it bears the mark of the quality of Activity. But that bears the mark of the quality of Goodness which with his whole heart he desires to know, which he is not ashamed to perform, and at which his soul rejoices.",
81
- "created": "Tuesday, April 15, 2025 - 7:12:33 PM",
82
- "hash": "md5-OVShTQoa36bLXZ50CxoNbg=="
83
- },
84
- {
85
- "id": 3894010399031,
86
- "dbid": "67ff121147a1ca29c9031916",
87
- "law": "The craving after sensual pleasures is declared to be the mark of Darkness, the pursuit of wealth the mark of Activity, the desire to gain spiritual merit the mark of Goodness. Each later named quality is better than the preceding one. Those endowed with Goodness reach the state of gods, those endowed with Activity the state of men, and those endowed with Darkness ever sink to the condition of beasts. That is the threefold course of transmigrations. But know this threefold course of transmigrations that depends on the three qualities to be again threefold low, middling, and high, according to the particular nature of the acts and of the knowledge of each man.",
88
- "created": "Tuesday, April 15, 2025 - 7:12:33 PM",
89
- "hash": "md5-4KZYdrbCe5RkG7W6QrEXxw=="
90
- },
91
- {
92
- "id": 1378622364039,
93
- "dbid": "67ff121147a1ca29c9031917",
94
- "law": "Immovable beings, insects, both small and great, fishes, snakes, and tortoises, cattle and wild animals, are the lowest conditions to which the quality of Darkness leads. Elephants, horses, Sudras, and despicable barbarians, lions, tigers, and boars are the middling states, caused by the quality of Darkness. Karanas, Suparnas and hypocrites, Rakshasas and Pisakas belong to the highest rank of conditions among those produced by Darkness.",
95
- "created": "Tuesday, April 15, 2025 - 7:12:33 PM",
96
- "hash": "md5-6OljygHFE0TnkWfaJuQVIg=="
97
- },
98
- {
99
- "id": 5452782461927,
100
- "dbid": "67ff121147a1ca29c9031918",
101
- "law": "Ghallas, Mallas, Natas, men who subsist by despicable occupations and those addicted to gambling and drinking form the lowest order of conditions caused by Activity. Kings and Kshatriyas, the domestic priests of kings, and those who delight in the warfare of disputations constitute the middling rank of the states caused by Activity. The Gandharvas, the Guhyakas, and the servants of the gods, likewise the Apsarases, belong all to the highest rank of conditions produced by Activity.",
102
- "created": "Tuesday, April 15, 2025 - 7:12:33 PM",
103
- "hash": "md5-2M8Jmyu49QyLgLb6zLURjA=="
104
- },
105
- {
106
- "id": 2343653382648,
107
- "dbid": "67ff121147a1ca29c9031919",
108
- "law": "Hermits, ascetics, Brahmanas, the crowds of the Vaimanika deities, the lunar mansions, and the Daityas form the first and lowest rank of the existences caused by Goodness. Sacrificers, the sages, the gods, the Vedas, the heavenly lights, the years, the manes, and the Sadhyas constitute the second order of existences, caused by Goodness. The sages declare the creators of the universe, the law, the Great One, and the Undiscernible One to constitute the highest order of beings produced by Goodness.",
109
- "created": "Tuesday, April 15, 2025 - 7:12:33 PM",
110
- "hash": "md5-pPlQtglHpTn9hcTQIFV6aA=="
111
- },
112
- {
113
- "id": 6610737577526,
114
- "dbid": "67ff121147a1ca29c903191a",
115
- "law": "Thus the result of the threefold action, the whole system of transmigrations which consists of three classes, each with three subdivisions, and which includes all created beings, has been fully pointed out.",
116
- "created": "Tuesday, April 15, 2025 - 7:12:33 PM",
117
- "hash": "md5-3gechjnFppTs2IqkP6NOdw=="
118
- },
119
- {
120
- "id": 2614243001675,
121
- "dbid": "67ff121147a1ca29c903191b",
122
- "law": "In consequence of attachment to (the objects of) the senses, and in consequence of the non-performance of their duties, fools, the lowest of men, reach the vilest births.",
123
- "created": "Tuesday, April 15, 2025 - 7:12:33 PM",
124
- "hash": "md5-088V9uZIg/aqeNCig4dEsg=="
125
- },
126
- {
127
- "id": 4258788762321,
128
- "dbid": "67ff121147a1ca29c903191c",
129
- "law": "What wombs this individual soul enters in this world and in consequence of what actions, learn the particulars of that at large and in due order.",
130
- "created": "Tuesday, April 15, 2025 - 7:12:33 PM",
131
- "hash": "md5-CZSC/yL35cRjI/dU89W3Cw=="
132
- },
133
- {
134
- "id": 2811438188477,
135
- "dbid": "67ff121147a1ca29c903191d",
136
- "law": "In proportion as sensual men indulge in sensual pleasures, in that same proportion their taste for them grows. By repeating their sinful acts those men of small understanding suffer pain here below in various births. But with whatever disposition of mind (a man) forms any act, he reaps its result in a future body endowed with the same quality. ",
137
- "created": "Tuesday, April 15, 2025 - 7:12:33 PM",
138
- "hash": "md5-6PDVT30R4vlQLp6c6nspFw=="
139
- },
140
- {
141
- "id": 5285230258902,
142
- "dbid": "67ff121147a1ca29c903191e",
143
- "law": "Studying the Veda, practising austerities, the acquisition of true knowledge, the subjugation of the organs, abstention from doing injury, and serving the Guru/teacher are the best means for attaining supreme bliss. If you ask whether among all these virtuous actions, performed here below, there be one which has been declared more efficacious than the rest for securing supreme happiness to man. The answer is that the knowledge of the Soul is stated to be the most excellent among all of them. For that is the first of all sciences, because immortality is gained through that. Among those six kinds of actions enumerated above, the performance of the acts taught in the Veda must ever be held to be most efficacious for ensuring happiness in this world and the next. For in the performance of the acts prescribed by the Veda all those others are fully comprised, each in its turn in the several rules for the rites.",
144
- "created": "Tuesday, April 15, 2025 - 7:12:33 PM",
145
- "hash": "md5-jkejsON4h1S1pduLmPC7jQ=="
146
- },
147
- {
148
- "id": 6706893769257,
149
- "dbid": "67ff121147a1ca29c903191f",
150
- "law": "The acts prescribed by the Veda are of two kinds, such as procure an increase of happiness and cause a continuation of mundane existence, (pravritta), and such as ensure supreme bliss and cause a cessation of mundane existence, (nivritta). Acts which secure the fulfilment of wishes in this world or in the next are called pravritta (such as cause a continuation of mundane existence). Acts performed without any desire for a reward, preceded by the acquisition of true knowledge, are declared to be nivritta (such as cause the cessation of mundane existence).",
151
- "created": "Tuesday, April 15, 2025 - 7:12:33 PM",
152
- "hash": "md5-FUbznlHtV3pOyyJgV7o47w=="
153
- },
154
- {
155
- "id": 5073440443736,
156
- "dbid": "67ff121147a1ca29c9031920",
157
- "law": "He who sedulously performs acts leading to future births (pravritta) becomes equal to the gods. He who is intent on the performance of those causing the cessation of existence, nivritta indeed, passes beyond the reach of the five elements. He who sacrifices to the Self alone, equally recognising the Self in all created beings and all created beings in the Self, becomes independent like an autocrat and self-luminous. After giving up even the above-mentioned sacrificial rites, a Brahmana should exert himself in (acquiring) the knowledge of the Soul, in extinguishing his passions, and in studying the Veda.",
158
- "created": "Tuesday, April 15, 2025 - 7:12:33 PM",
159
- "hash": "md5-QsZrzC/hmBeuI+Bwf89MIQ=="
160
- },
161
- {
162
- "id": 1752379413685,
163
- "dbid": "67ff121147a1ca29c9031921",
164
- "law": "For that secures the attainment of the object of existence, especially in the case of a Brahmana, because by attaining that, not otherwise, a twice-born man has gained all his ends.",
165
- "created": "Tuesday, April 15, 2025 - 7:12:33 PM",
166
- "hash": "md5-lFFvol7J0yrdD5fumjBByg=="
167
- },
168
- {
169
- "id": 2974865792761,
170
- "dbid": "67ff121147a1ca29c9031922",
171
- "law": "All those traditions (smriti) and those systems of philosophy, which are not based on the Veda, produce no reward after death. for they are founded on Darkness. All those doctrines, differing from the Veda, which spring up and soon perish, are worthless and false, because they are of modern date. The four castes, the three worlds, the four orders, the past, the present, and the future are all severally known by means of the Veda.",
172
- "created": "Tuesday, April 15, 2025 - 7:12:33 PM",
173
- "hash": "md5-PbyOOh01hY8/esiLRfMWzw=="
174
- },
175
- {
176
- "id": 2697450045416,
177
- "dbid": "67ff121147a1ca29c9031923",
178
- "law": "Sound, touch, colour, taste, and fifthly smell are known through the Veda alone, their production is through the Vedic rites, which in this respect are secondary acts. The eternal lore of the Veda upholds all created beings; hence I hold that to be supreme, which is the means of securing happiness to these creatures.",
179
- "created": "Tuesday, April 15, 2025 - 7:12:33 PM",
180
- "hash": "md5-GuSGuZ+j6mh1PSbdma3dXg=="
181
- },
182
- {
183
- "id": 6564418365198,
184
- "dbid": "67ff121147a1ca29c9031924",
185
- "law": "Command of armies, royal authority, the office of a judge, and sovereignty over the whole world he only deserves who knows the Veda-science. As a fire that has gained strength consumes even trees full of sap, even so he who knows the Veda burns out the taint of his soul which arises from evil acts. In whatever order a man who knows the true meaning of the Veda-science may dwell, he becomes even while abiding in this world, fit for the union with Brahman.",
186
- "created": "Tuesday, April 15, 2025 - 7:12:33 PM",
187
- "hash": "md5-kHe+WrTvuiqor7WgGvMajA=="
188
- },
189
- {
190
- "id": 3645223138909,
191
- "dbid": "67ff121147a1ca29c9031925",
192
- "law": "Even forgetful students of the sacred books are more distinguished than the ignorant, those who remember them surpass the forgetful students, those who possess a knowledge of the meaning are more distinguished than those who only remember the words, men who follow the teaching of the texts surpass those who merely know their meaning.",
193
- "created": "Tuesday, April 15, 2025 - 7:12:33 PM",
194
- "hash": "md5-svcp5AjvEsUQYlKz/D7+8A=="
195
- },
196
- {
197
- "id": 5185895185206,
198
- "dbid": "67ff121147a1ca29c9031926",
199
- "law": "Austerity and sacred learning are the best means by which a Brahmana secures supreme bliss. By austerities he destroys guilt, by sacred learning he obtains the cessation of births and deaths.",
200
- "created": "Tuesday, April 15, 2025 - 7:12:33 PM",
201
- "hash": "md5-cMlyzAxAqT82D1uq/4lb6w=="
202
- },
203
- {
204
- "id": 2738529279632,
205
- "dbid": "67ff121147a1ca29c9031927",
206
- "law": "The three kinds of evidence, perception, inference, and the sacred Institutes which comprise the tradition of many schools, must be fully understood by him who desires perfect correctness with respect to the sacred law. He alone, and no other man, knows the sacred law, who explores the utterances of the sages and the body of the laws, by modes of reasoning, not repugnant to the Veda-lore.",
207
- "created": "Tuesday, April 15, 2025 - 7:12:33 PM",
208
- "hash": "md5-fTvmvHIjQevs1IqkGhD6oQ=="
209
- },
210
- {
211
- "id": 3436920157699,
212
- "dbid": "67ff121147a1ca29c9031928",
213
- "law": "Thus the acts which secure supreme bliss have been exactly and fully described. Now the secret portion of these Institutes, proclaimed by Manu, will be taught.",
214
- "created": "Tuesday, April 15, 2025 - 7:12:33 PM",
215
- "hash": "md5-VPb7VGjhpiJnx83hdpYiLA=="
216
- },
217
- {
218
- "id": 1685225859069,
219
- "dbid": "67ff121147a1ca29c9031929",
220
- "law": "If it be asked how it should be with respect to points of the law which have not been specially mentioned, the answer is, that which Brahmanas who are Sishtas propound, shall doubtlessly have legal force. Those Brahmanas must be considered as Sishtas who, in accordance with the sacred law, have studied the Veda together with its appendages, and are able to adduce proofs perceptible by the senses from the revealed texts. Whatever an assembly, consisting either of at least ten, or of at least three persons who follow their prescribed occupations, declares to be law, the legal force of that one must not dispute.",
221
- "created": "Tuesday, April 15, 2025 - 7:12:33 PM",
222
- "hash": "md5-vHoMqwuHVfxhaohxyO+hxg=="
223
- },
224
- {
225
- "id": 1292682934110,
226
- "dbid": "67ff121147a1ca29c903192a",
227
- "law": "Three persons who each know one of the three principal Vedas, a logician, a Mimamsaka, one who knows the Nirukta, one who recites the Institutes of the sacred law, and three men belonging to the first three orders shall constitute a legal assembly, consisting of at least ten members. One who knows the Rig-veda, one who knows the Yagur-veda, and one who knows the Sama-veda, shall be known to form an assembly consisting of at least three members and competent to decide doubtful points of law.",
228
- "created": "Tuesday, April 15, 2025 - 7:12:33 PM",
229
- "hash": "md5-HymShHioTpTehXAawf7uow=="
230
- },
231
- {
232
- "id": 4049645948021,
233
- "dbid": "67ff121147a1ca29c903192b",
234
- "law": "Even that which one Brahmana versed in the Veda declares to be law, must be considered to have supreme legal force, but not that which is proclaimed by myriads of ignorant men. Even if thousands of Brahmanas, who have not fulfilled their sacred duties, are unacquainted with the Veda, and subsist only by the name of their caste, meet, they cannot form an assembly for settling the sacred law.",
235
- "created": "Tuesday, April 15, 2025 - 7:12:33 PM",
236
- "hash": "md5-Kjr45Q6+gvtSTfCF9ovgvA=="
237
- },
238
- {
239
- "id": 4164606311122,
240
- "dbid": "67ff121147a1ca29c903192c",
241
- "law": "The sin of him whom dunces, incarnations of Darkness, and unacquainted with the law, instruct in his duty, falls, increased a hundredfold, on those who propound it. All that which is most efficacious for securing supreme bliss has been thus declared to you; a Brahmana who does not fall off from that obtains the most excellent state. Thus did that worshipful deity disclose through a desire of benefiting mankind, this whole most excellent secret of the sacred law.",
242
- "created": "Tuesday, April 15, 2025 - 7:12:33 PM",
243
- "hash": "md5-7n1seUbv8vNFbEO7syXDvg=="
244
- },
245
- {
246
- "id": 6395273501931,
247
- "dbid": "67ff121147a1ca29c903192d",
248
- "law": "Let every Brahmana, concentrating his mind, fully recognise in the Self all things, both the real and the unreal, for he who recognises the universe in the Self, does not give his heart to unrighteousness. The Self alone is the multitude of the gods, the universe rests on the Self; for the Self produces the connexion of these embodied spirits with actions.",
249
- "created": "Tuesday, April 15, 2025 - 7:12:33 PM",
250
- "hash": "md5-ve460mbc5h9ZYjnZgixFUw=="
251
- },
252
- {
253
- "id": 5063593444682,
254
- "dbid": "67ff121147a1ca29c903192e",
255
- "law": "Let him meditate on the ether as identical with the cavities of the body, on the wind as identical with the organs of motions and of touch, on the most excellent light as the same with his digestive organs and his sight, on water as the same with the corporeal fluids, on the earth as the same with the solid parts of his body. On the moon as one with the internal organ, on the quarters of the horizon as one with his sense of hearing.",
256
- "created": "Tuesday, April 15, 2025 - 7:12:33 PM",
257
- "hash": "md5-yf+ZarSbv/vR8zcOis4IfA=="
258
- },
259
- {
260
- "id": 1420228248266,
261
- "dbid": "67ff121147a1ca29c903192f",
262
- "law": "Let him know the supreme Male (Purusha), to be the sovereign ruler of them all, smaller even than small, bright like gold, and perceptible by the intellect only when in a state of sleep. Some call him Agni (Fire), others Manu, the Lord of creatures, others Indra, others the vital air, and again others eternal Brahman. He pervades all created beings in the five forms, and constantly makes them, by means of birth, growth and decay, revolve like the wheels of a chariot.",
263
- "created": "Tuesday, April 15, 2025 - 7:12:33 PM",
264
- "hash": "md5-zGNTsxNduB5ksh/6JGthwA=="
265
- },
266
- {
267
- "id": 5427514120944,
268
- "dbid": "67ff121147a1ca29c9031930",
269
- "law": "He who thus recognises the Self through the Self in all created beings, becomes equal towards all, and enters the highest state, Brahman.",
270
- "created": "Tuesday, April 15, 2025 - 7:12:33 PM",
271
- "hash": "md5-CyxeD0iM8/xMpm+CE5Ya9Q=="
272
- }
273
- ]
274
- }
@@ -1,146 +0,0 @@
1
- // ©2025 Quinn A Michaels; All rights reserved.
2
- // Legal Signature Required For Lawful Use.
3
- // Distributed under the Vedic License Agreement LICENSE.md
4
-
5
- "use strict";
6
- // set the __dirname
7
- import {dirname} from 'node:path';
8
- import {fileURLToPath} from 'node:url';
9
- const __dirname = dirname(fileURLToPath(import.meta.url));
10
-
11
- // (c)2025 Quinn Michaels; All rights reserved.
12
- export function manu(packet) {
13
- this.context('manu', packet.id);
14
- this.action('method', `manu:${packet.id}`);
15
- return new Promise((resolve, reject) => {
16
- const data = {};
17
- const {personal} = this.legal();
18
- this.state('try', `Manu Laws:${packet.id}`);
19
- try {
20
- data.manu = personal.manu;
21
- data.files = [];
22
- for (let x = 0; x < data.manu.length; x++) {
23
- const file = data.manu[x];
24
- const filePath = this.lib.path.join(__dirname, file);
25
- const html = this.lib.fs.readFileSync(filePath);
26
- const title = html.toString().split('<CENTER><H1>')[1].split('</H1></CENTER>')[0];
27
- const formatHTML = html.toString().split('</H1></CENTER>')[1].split('</BODY>')[0];
28
- const htmlData = formatHTML.replace(/\<\/P\>\n?\s?/gi, '').replace(/\'\d+\.\s?/g, '').split(/\<P\>\d+\.\s?/);
29
- const laws = htmlData.map(item => {
30
- const law = {
31
- id: this.lib.uid(),
32
- law: item,
33
- created: this.lib.formatDate(Date.now(), 'long', true),
34
- };
35
- law.hash = this.lib.hash(law);
36
- return law;
37
- });
38
- const result = {
39
- id: this.lib.uid(),
40
- title,
41
- data: laws,
42
- created: this.lib.formatDate(Date.now(), 'long', true),
43
- };
44
- result.hash = this.lib.hash(result);
45
- data.files.push(result);
46
- const key = x+1 < 10 ? `0${x+1}.json` : `${x+1}.json`;
47
- const jsonfile = this.lib.path.join(__dirname, 'data', 'laws', 'manu', key);
48
- this.lib.fs.writeFileSync(jsonfile, JSON.stringify(result, null, 2), {encoding:'utf8',flag:'w'});
49
- }
50
- }
51
- catch(e) {
52
- this.state('catch', `manu:${packet.id}`);
53
- return this.error(e, packet, reject);
54
- }
55
- finally {
56
- this.state('retrun', `manu:${packet.id}`);
57
- return resolve({
58
- text: this.vars.messages.manu,
59
- html: this.vars.messages.manu,
60
- data
61
- });
62
- }
63
- });
64
- }
65
-
66
- export async function manuhash(packet) {
67
- this.context('manu', packet.id);
68
- this.action('method', `manuhash:${packet.id}`);
69
- const filepath = this.lib.path.join(__dirname, 'manu', `${packet.q.text}.json`);
70
- const filedata = this.lib.fs.readFileSync(filepath);
71
- const filejson = JSON.parse(filedata);
72
- const newdata = {
73
- id: this.lib.uid(),
74
- title: filejson.title,
75
- created: this.lib.formatDate(Date.now(), 'long', true),
76
- hash: false,
77
- data: [],
78
- }
79
- for (let item of filejson.data) {
80
- const dbstr = item.dbid ? `${this.askChr}legal add:${item.dbid}` : `${this.askChr}legal add`;
81
- const dblaw = await this.question(`${dbstr} ${item.law}`);
82
- const newitem = {
83
- id: this.lib.uid(),
84
- dbid: dblaw.a.data,
85
- law: item.law,
86
- created: this.lib.formatDate(Date.now(), 'long', true),
87
- };
88
- newitem.hash = this.lib.hash(newitem);
89
- newdata.data.push(newitem);
90
- }
91
- newdata.hash = this.lib.hash(newdata);
92
- this.prompt(`filepath: ${filepath}`);
93
- this.lib.fs.writeFileSync(filepath, JSON.stringify(newdata, null, 2), {encoding:'utf8',flag:'w'});
94
- return Promise.resolve({
95
- text: 'rehash data',
96
- html: 'rehash data',
97
- data: false,
98
- });
99
- }
100
-
101
- // laws func to get json data
102
- export function laws(packet) {
103
- this.action('func', `laws:${packet.id}`);
104
- return new Promise((resolve, reject) => {
105
- if (!packet.q.text) return resolve(this._messages.notext);
106
- try {
107
- const {params} = packet.q.meta;
108
- const lookup = params[1] || 'manu';
109
-
110
- const filepath = this.lib.path.join(__dirname, lookup, `${packet.q.text}.json`);
111
- const filedata = this.lib.fs.readFileSync(filepath);
112
- const filejson = JSON.parse(filedata);
113
- const _laws = filejson.data.map(item => {
114
- return [
115
- `::begin:law:${item.id}`,
116
- `id: ${item.id}`,
117
- `law: ${item.law}`,
118
- `dbid: ${item.dbid}`,
119
- `hash: ${item.hash}`,
120
- `created: ${item.created}`,
121
- `::end:law:${item.hash}`,
122
- ].join('\n');
123
- }).join('\n');
124
- const text = [
125
- `::BEGIN:LAWS:${filejson.id}`,
126
- `# ${filejson.title}`,
127
- _laws,
128
- `::begin:hidden`,
129
- `#color = {{profile.color}}`,
130
- `#bgcolor = {{profile.bgcolor}}`,
131
- `#bg = {{profile.background}}`,
132
- `::end:hidden`,
133
- `::END:LAWS:${filejson.hash}`,
134
- ].join('\n');
135
- this.state('return', `laws:${packet.id}`);
136
- return resolve({
137
- text,
138
- data: filejson
139
- });
140
- }
141
- catch(e) {
142
- this.state('catch', `laws:${packet.id}`);
143
- return this.error(e, packet, reject);
144
- }
145
- });
146
- }