namirasoft-site 1.4.29 → 1.4.31

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.
@@ -23,4 +23,26 @@ export declare abstract class NSBaseMetaDatabase<Server extends NSBaseServer> ex
23
23
  logo: string;
24
24
  link: string;
25
25
  });
26
+ getByShortNameOrNull(short_name: string): {
27
+ product: {
28
+ id: string;
29
+ name: string;
30
+ headline: string;
31
+ description: string;
32
+ logo: string;
33
+ link: string;
34
+ };
35
+ table: NSBaseMetaTable<NSBaseServer, any>;
36
+ } | null;
37
+ getByShortName(short_name: string): {
38
+ product: {
39
+ id: string;
40
+ name: string;
41
+ headline: string;
42
+ description: string;
43
+ logo: string;
44
+ link: string;
45
+ };
46
+ table: NSBaseMetaTable<NSBaseServer, any>;
47
+ };
26
48
  }
@@ -11,6 +11,18 @@ class NSBaseMetaDatabase extends namirasoft_core_1.BaseMetaDatabase {
11
11
  this.tables = {};
12
12
  this.product = product;
13
13
  }
14
+ getByShortNameOrNull(short_name) {
15
+ for (let table in this.tables)
16
+ if (this.tables[table].uuid.short === short_name)
17
+ return { product: this.product, table: this.tables[table] };
18
+ return null;
19
+ }
20
+ getByShortName(short_name) {
21
+ let ans = this.getByShortNameOrNull(short_name);
22
+ if (ans)
23
+ return ans;
24
+ throw new Error(`Result could not be found for short name: ${short_name}`);
25
+ }
14
26
  }
15
27
  exports.NSBaseMetaDatabase = NSBaseMetaDatabase;
16
28
  ;
@@ -1 +1 @@
1
- {"version":3,"file":"NSBaseMetaDatabase.js","sourceRoot":"","sources":["../src/NSBaseMetaDatabase.ts"],"names":[],"mappings":";;;AAAA,qDAAmD;AAInD,MAAsB,kBAAgD,SAAQ,kCAAgB;IAEnF,MAAM,CAAC,gBAAgB,CAAC,YAAoB;QAE/C,MAAM,IAAI,KAAK,CAAC,qEAAqE,YAAY,EAAE,CAAC,CAAC;IACzG,CAAC;IAWD,YAAY,OAOX;QAEG,KAAK,EAAE,CAAC;QAnBH,WAAM,GAAsD,EAAE,CAAC;QAoBpE,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IAC3B,CAAC;CACJ;AA5BD,gDA4BC;AAAA,CAAC"}
1
+ {"version":3,"file":"NSBaseMetaDatabase.js","sourceRoot":"","sources":["../src/NSBaseMetaDatabase.ts"],"names":[],"mappings":";;;AAAA,qDAAmD;AAInD,MAAsB,kBAAgD,SAAQ,kCAAgB;IAEnF,MAAM,CAAC,gBAAgB,CAAC,YAAoB;QAE/C,MAAM,IAAI,KAAK,CAAC,qEAAqE,YAAY,EAAE,CAAC,CAAC;IACzG,CAAC;IAWD,YAAY,OAOX;QAEG,KAAK,EAAE,CAAC;QAnBH,WAAM,GAAsD,EAAE,CAAC;QAoBpE,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IAC3B,CAAC;IACD,oBAAoB,CAAC,UAAkB;QAanC,KAAK,IAAI,KAAK,IAAI,IAAI,CAAC,MAAM;YACzB,IAAI,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,KAAK,KAAK,UAAU;gBAC5C,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;QACpE,OAAO,IAAI,CAAC;IAChB,CAAC;IACD,cAAc,CAAC,UAAkB;QAa7B,IAAI,GAAG,GAAG,IAAI,CAAC,oBAAoB,CAAC,UAAU,CAAC,CAAC;QAChD,IAAI,GAAG;YACH,OAAO,GAAG,CAAC;QACf,MAAM,IAAI,KAAK,CAAC,6CAA6C,UAAU,EAAE,CAAC,CAAC;IAC/E,CAAC;CACJ;AAhED,gDAgEC;AAAA,CAAC"}
package/package.json CHANGED
@@ -8,7 +8,7 @@
8
8
  "framework": "npm",
9
9
  "application": "package",
10
10
  "private": false,
11
- "version": "1.4.29",
11
+ "version": "1.4.31",
12
12
  "author": "Amir Abolhasani",
13
13
  "license": "MIT",
14
14
  "main": "./dist/index.js",
@@ -18,6 +18,6 @@
18
18
  },
19
19
  "dependencies": {
20
20
  "axios": "^1.8.4",
21
- "namirasoft-core": "^1.4.65"
21
+ "namirasoft-core": "^1.4.67"
22
22
  }
23
23
  }
@@ -30,4 +30,40 @@ export abstract class NSBaseMetaDatabase<Server extends NSBaseServer> extends Ba
30
30
  super();
31
31
  this.product = product;
32
32
  }
33
+ getByShortNameOrNull(short_name: string):
34
+ {
35
+ product: {
36
+ id: string;
37
+ name: string;
38
+ headline: string;
39
+ description: string;
40
+ logo: string;
41
+ link: string;
42
+ };
43
+ table: NSBaseMetaTable<NSBaseServer, any>;
44
+ } | null
45
+ {
46
+ for (let table in this.tables)
47
+ if (this.tables[table].uuid.short === short_name)
48
+ return { product: this.product, table: this.tables[table] };
49
+ return null;
50
+ }
51
+ getByShortName(short_name: string):
52
+ {
53
+ product: {
54
+ id: string;
55
+ name: string;
56
+ headline: string;
57
+ description: string;
58
+ logo: string;
59
+ link: string;
60
+ };
61
+ table: NSBaseMetaTable<NSBaseServer, any>;
62
+ }
63
+ {
64
+ let ans = this.getByShortNameOrNull(short_name);
65
+ if (ans)
66
+ return ans;
67
+ throw new Error(`Result could not be found for short name: ${short_name}`);
68
+ }
33
69
  };