namirasoft-site-map 1.4.2 → 1.4.3

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 (38) hide show
  1. package/dist/build.js +9 -9
  2. package/dist/index.js +4 -0
  3. package/dist/index.js.map +1 -1
  4. package/dist/index_maps.d.ts +1 -0
  5. package/dist/index_maps.js +18 -0
  6. package/dist/index_maps.js.map +1 -0
  7. package/package.json +48 -48
  8. package/src/BaseMap.ts +10 -10
  9. package/src/Globe.ts +137 -140
  10. package/src/build.ts +96 -96
  11. package/src/check.ts +20 -20
  12. package/src/index.ts +8 -2
  13. package/src/maps/index.ts +23 -24
  14. package/src/maps/TimifyMap.ts +0 -10
  15. /package/dist/maps/{APILinkMap.d.ts → ApiLinkMap.d.ts} +0 -0
  16. /package/dist/maps/{APILinkMap.js → ApiLinkMap.js} +0 -0
  17. /package/dist/maps/{APILinkMap.js.map → ApiLinkMap.js.map} +0 -0
  18. /package/dist/maps/{APINewsMap.d.ts → ApiNewsMap.d.ts} +0 -0
  19. /package/dist/maps/{APINewsMap.js → ApiNewsMap.js} +0 -0
  20. /package/dist/maps/{APINewsMap.js.map → ApiNewsMap.js.map} +0 -0
  21. /package/dist/maps/{APIProductMap.d.ts → ApiProductMap.d.ts} +0 -0
  22. /package/dist/maps/{APIProductMap.js → ApiProductMap.js} +0 -0
  23. /package/dist/maps/{APIProductMap.js.map → ApiProductMap.js.map} +0 -0
  24. /package/dist/maps/{APIServiceMap.d.ts → ApiServiceMap.d.ts} +0 -0
  25. /package/dist/maps/{APIServiceMap.js → ApiServiceMap.js} +0 -0
  26. /package/dist/maps/{APIServiceMap.js.map → ApiServiceMap.js.map} +0 -0
  27. /package/dist/maps/{APIWorkMap.d.ts → ApiWorkMap.d.ts} +0 -0
  28. /package/dist/maps/{APIWorkMap.js → ApiWorkMap.js} +0 -0
  29. /package/dist/maps/{APIWorkMap.js.map → ApiWorkMap.js.map} +0 -0
  30. /package/dist/maps/{NWSMaxMindMap.d.ts → NwsMaxMindMap.d.ts} +0 -0
  31. /package/dist/maps/{NWSMaxMindMap.js → NwsMaxMindMap.js} +0 -0
  32. /package/dist/maps/{NWSMaxMindMap.js.map → NwsMaxMindMap.js.map} +0 -0
  33. /package/dist/maps/{NWSRegionMap.d.ts → NwsRegionMap.d.ts} +0 -0
  34. /package/dist/maps/{NWSRegionMap.js → NwsRegionMap.js} +0 -0
  35. /package/dist/maps/{NWSRegionMap.js.map → NwsRegionMap.js.map} +0 -0
  36. /package/dist/maps/{SMSSenderMap.d.ts → SmsSenderMap.d.ts} +0 -0
  37. /package/dist/maps/{SMSSenderMap.js → SmsSenderMap.js} +0 -0
  38. /package/dist/maps/{SMSSenderMap.js.map → SmsSenderMap.js.map} +0 -0
package/dist/build.js CHANGED
@@ -48,15 +48,15 @@ function build() {
48
48
  imports.push(`import { ${type_name}Map } from "./maps/${type_name}Map";`);
49
49
  defines.push(` public ${var_name}: ${type_name}Map;`);
50
50
  inits.push(` this.${var_name} = new ${type_name}Map();`);
51
- fs_1.default.writeFileSync(`./src/maps/${type_name}Map.ts`, `import { Namirasoft${type_name}MetaDatabase, Namirasoft${type_name}Server } from "${package_name}";
52
- import { BaseMap } from "../BaseMap";
53
-
54
- export class ${type_name}Map extends BaseMap<Namirasoft${type_name}MetaDatabase, Namirasoft${type_name}Server>
55
- {
56
- constructor()
57
- {
58
- super(new Namirasoft${type_name}MetaDatabase());
59
- }
51
+ fs_1.default.writeFileSync(`./src/maps/${type_name}Map.ts`, `import { Namirasoft${type_name}MetaDatabase, Namirasoft${type_name}Server } from "${package_name}";
52
+ import { BaseMap } from "../BaseMap";
53
+
54
+ export class ${type_name}Map extends BaseMap<Namirasoft${type_name}MetaDatabase, Namirasoft${type_name}Server>
55
+ {
56
+ constructor()
57
+ {
58
+ super(new Namirasoft${type_name}MetaDatabase());
59
+ }
60
60
  };`);
61
61
  }
62
62
  imports.push("// tables import end");
package/dist/index.js CHANGED
@@ -14,6 +14,10 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ const Globe_1 = require("./Globe");
18
+ Globe_1.Globe.namirasoft.api_product.meta.tables.product.front_end.getViewLink = (id) => {
19
+ return Globe_1.Globe.namirasoft.getByProductID(id).meta.product.link;
20
+ };
17
21
  __exportStar(require("./BaseMap"), exports);
18
22
  __exportStar(require("./Globe"), exports);
19
23
  __exportStar(require("./maps/index"), exports);
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAA0B;AAC1B,0CAAwB;AACxB,+CAA6B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mCAAgC;AAChC,aAAK,CAAC,UAAU,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,WAAW,GAAG,CAAC,EAAU,EAAE,EAAE;IAEpF,OAAO,aAAK,CAAC,UAAU,CAAC,cAAc,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC;AACjE,CAAC,CAAA;AAED,4CAA0B;AAC1B,0CAAwB;AACxB,+CAA6B"}
@@ -0,0 +1 @@
1
+ export * from "./maps/APILinkMap";
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./maps/APILinkMap"), exports);
18
+ //# sourceMappingURL=index_maps.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index_maps.js","sourceRoot":"","sources":["../src/index_maps.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oDAAkC"}
package/package.json CHANGED
@@ -1,49 +1,49 @@
1
- {
2
- "name": "namirasoft-site-map",
3
- "title": "Namirasoft Site Map NPM Package",
4
- "description": "Namira Software Corporation Site Map NPM Package",
5
- "icon": "logo.png",
6
- "logo": "https://static.namirasoft.com/image/namirasoft/site/logo/base.png",
7
- "language": "ts",
8
- "framework": "npm",
9
- "application": "package",
10
- "private": false,
11
- "version": "1.4.2",
12
- "author": "Amir Abolhasani",
13
- "license": "MIT",
14
- "main": "./dist/index.js",
15
- "types": "./dist/index.d.ts",
16
- "scripts": {
17
- "build": "node ./dist/build.js",
18
- "check": "node ./dist/check.js"
19
- },
20
- "dependencies": {
21
- "@types/node": "^22.10.2",
22
- "namirasoft-access": "^1.4.29",
23
- "namirasoft-account": "^1.4.28",
24
- "namirasoft-alarm": "^1.4.9",
25
- "namirasoft-api-link": "^1.4.8",
26
- "namirasoft-api-news": "^1.4.3",
27
- "namirasoft-api-product": "^1.4.11",
28
- "namirasoft-api-service": "^1.4.4",
29
- "namirasoft-api-work": "^1.4.2",
30
- "namirasoft-balance": "^1.4.4",
31
- "namirasoft-content-template": "^1.4.19",
32
- "namirasoft-core": "^1.4.25",
33
- "namirasoft-data": "^1.4.0",
34
- "namirasoft-email-sender": "^1.4.14",
35
- "namirasoft-field": "^1.4.4",
36
- "namirasoft-history": "^1.4.8",
37
- "namirasoft-job-arranger": "^1.4.33",
38
- "namirasoft-log": "^1.4.12",
39
- "namirasoft-message": "^1.4.8",
40
- "namirasoft-notification-sender": "^1.4.11",
41
- "namirasoft-nws-max-mind": "^1.4.5",
42
- "namirasoft-nws-region": "^1.3.10",
43
- "namirasoft-payment": "^1.4.28",
44
- "namirasoft-secret": "^1.4.16",
45
- "namirasoft-site": "^1.4.7",
46
- "namirasoft-sms-sender": "^1.4.8",
47
- "namirasoft-workspace": "^1.4.7"
48
- }
1
+ {
2
+ "name": "namirasoft-site-map",
3
+ "title": "Namirasoft Site Map NPM Package",
4
+ "description": "Namira Software Corporation Site Map NPM Package",
5
+ "icon": "logo.png",
6
+ "logo": "https://static.namirasoft.com/image/namirasoft/site/logo/base.png",
7
+ "language": "ts",
8
+ "framework": "npm",
9
+ "application": "package",
10
+ "private": false,
11
+ "version": "1.4.3",
12
+ "author": "Amir Abolhasani",
13
+ "license": "MIT",
14
+ "main": "./dist/index.js",
15
+ "types": "./dist/index.d.ts",
16
+ "scripts": {
17
+ "build": "node ./dist/build.js",
18
+ "check": "node ./dist/check.js"
19
+ },
20
+ "dependencies": {
21
+ "@types/node": "^22.10.2",
22
+ "namirasoft-access": "^1.4.29",
23
+ "namirasoft-account": "^1.4.28",
24
+ "namirasoft-alarm": "^1.4.9",
25
+ "namirasoft-api-link": "^1.4.8",
26
+ "namirasoft-api-news": "^1.4.3",
27
+ "namirasoft-api-product": "^1.4.11",
28
+ "namirasoft-api-service": "^1.4.4",
29
+ "namirasoft-api-work": "^1.4.2",
30
+ "namirasoft-balance": "^1.4.4",
31
+ "namirasoft-content-template": "^1.4.19",
32
+ "namirasoft-core": "^1.4.25",
33
+ "namirasoft-data": "^1.4.0",
34
+ "namirasoft-email-sender": "^1.4.14",
35
+ "namirasoft-field": "^1.4.4",
36
+ "namirasoft-history": "^1.4.8",
37
+ "namirasoft-job-arranger": "^1.4.33",
38
+ "namirasoft-log": "^1.4.12",
39
+ "namirasoft-message": "^1.4.8",
40
+ "namirasoft-notification-sender": "^1.4.11",
41
+ "namirasoft-nws-max-mind": "^1.4.5",
42
+ "namirasoft-nws-region": "^1.3.10",
43
+ "namirasoft-payment": "^1.4.28",
44
+ "namirasoft-secret": "^1.4.16",
45
+ "namirasoft-site": "^1.4.7",
46
+ "namirasoft-sms-sender": "^1.4.8",
47
+ "namirasoft-workspace": "^1.4.7"
48
+ }
49
49
  }
package/src/BaseMap.ts CHANGED
@@ -1,11 +1,11 @@
1
- import { NSBaseMetaDatabase } from "namirasoft-site";
2
-
3
- export abstract class BaseMap<Meta extends NSBaseMetaDatabase, Server>
4
- {
5
- meta: Meta;
6
- server?: Server;
7
- constructor(meta: Meta)
8
- {
9
- this.meta = meta;
10
- }
1
+ import { NSBaseMetaDatabase } from "namirasoft-site";
2
+
3
+ export abstract class BaseMap<Meta extends NSBaseMetaDatabase, Server>
4
+ {
5
+ meta: Meta;
6
+ server?: Server;
7
+ constructor(meta: Meta)
8
+ {
9
+ this.meta = meta;
10
+ }
11
11
  };
package/src/Globe.ts CHANGED
@@ -1,141 +1,138 @@
1
- import { NSBaseMetaDatabase, NSBaseMetaTable } from "namirasoft-site";
2
- import { BaseMap } from "./BaseMap";
3
- // tables import start
4
- import { APILinkMap } from "./maps/APILinkMap";
5
- import { APINewsMap } from "./maps/APINewsMap";
6
- import { APIProductMap } from "./maps/APIProductMap";
7
- import { APIServiceMap } from "./maps/APIServiceMap";
8
- import { APIWorkMap } from "./maps/APIWorkMap";
9
- import { AccessMap } from "./maps/AccessMap";
10
- import { AccountMap } from "./maps/AccountMap";
11
- import { AlarmMap } from "./maps/AlarmMap";
12
- import { BalanceMap } from "./maps/BalanceMap";
13
- import { ContentTemplateMap } from "./maps/ContentTemplateMap";
14
- import { DataMap } from "./maps/DataMap";
15
- import { EmailSenderMap } from "./maps/EmailSenderMap";
16
- import { FieldMap } from "./maps/FieldMap";
17
- import { HistoryMap } from "./maps/HistoryMap";
18
- import { JobArrangerMap } from "./maps/JobArrangerMap";
19
- import { LogMap } from "./maps/LogMap";
20
- import { MessageMap } from "./maps/MessageMap";
21
- import { NWSMaxMindMap } from "./maps/NWSMaxMindMap";
22
- import { NWSRegionMap } from "./maps/NWSRegionMap";
23
- import { NotificationSenderMap } from "./maps/NotificationSenderMap";
24
- import { PaymentMap } from "./maps/PaymentMap";
25
- import { SMSSenderMap } from "./maps/SMSSenderMap";
26
- import { SecretMap } from "./maps/SecretMap";
27
- import { TimifyMap } from "./maps/TimifyMap";
28
- import { WorkspaceMap } from "./maps/WorkspaceMap";
29
- // tables import end
30
-
31
- export class Globe
32
- {
33
- public static namirasoft: Globe = new Globe();
34
- // tables define start
35
- public api_link: APILinkMap;
36
- public api_news: APINewsMap;
37
- public api_product: APIProductMap;
38
- public api_service: APIServiceMap;
39
- public api_work: APIWorkMap;
40
- public access: AccessMap;
41
- public account: AccountMap;
42
- public alarm: AlarmMap;
43
- public balance: BalanceMap;
44
- public content_template: ContentTemplateMap;
45
- public data: DataMap;
46
- public email_sender: EmailSenderMap;
47
- public field: FieldMap;
48
- public history: HistoryMap;
49
- public job_arranger: JobArrangerMap;
50
- public log: LogMap;
51
- public message: MessageMap;
52
- public nws_max_mind: NWSMaxMindMap;
53
- public nws_region: NWSRegionMap;
54
- public notification_sender: NotificationSenderMap;
55
- public payment: PaymentMap;
56
- public sms_sender: SMSSenderMap;
57
- public secret: SecretMap;
58
- public timify: TimifyMap;
59
- public workspace: WorkspaceMap;
60
- // tables define end
61
- constructor()
62
- {
63
- // tables init start
64
- this.api_link = new APILinkMap();
65
- this.api_news = new APINewsMap();
66
- this.api_product = new APIProductMap();
67
- this.api_service = new APIServiceMap();
68
- this.api_work = new APIWorkMap();
69
- this.access = new AccessMap();
70
- this.account = new AccountMap();
71
- this.alarm = new AlarmMap();
72
- this.balance = new BalanceMap();
73
- this.content_template = new ContentTemplateMap();
74
- this.data = new DataMap();
75
- this.email_sender = new EmailSenderMap();
76
- this.field = new FieldMap();
77
- this.history = new HistoryMap();
78
- this.job_arranger = new JobArrangerMap();
79
- this.log = new LogMap();
80
- this.message = new MessageMap();
81
- this.nws_max_mind = new NWSMaxMindMap();
82
- this.nws_region = new NWSRegionMap();
83
- this.notification_sender = new NotificationSenderMap();
84
- this.payment = new PaymentMap();
85
- this.sms_sender = new SMSSenderMap();
86
- this.secret = new SecretMap();
87
- this.timify = new TimifyMap();
88
- this.workspace = new WorkspaceMap();
89
- // tables init end
90
- }
91
- forEachProduct<T>(handler: (map: BaseMap<NSBaseMetaDatabase, any>) => T | null): T | null
92
- {
93
- for (let key of Object.keys(this))
94
- {
95
- let obj = (this as any)[key];
96
- if (obj?.meta)
97
- {
98
- let ans = handler(obj);
99
- if (ans)
100
- return ans;
101
- }
102
- }
103
- return null;
104
- }
105
- getByProductID(product_id: string): BaseMap<NSBaseMetaDatabase, any>
106
- {
107
- let ans = this.forEachProduct(m =>
108
- {
109
- if (m.meta.product.id === product_id)
110
- return m;
111
- return null;
112
- });
113
- if (ans)
114
- return ans;
115
- throw new Error(`Map could not be found for product id: ${product_id}`);
116
- }
117
- getByShortName(short_name: string):
118
- {
119
- product: {
120
- id: string;
121
- name: string;
122
- headline: string;
123
- description: string;
124
- logo: string;
125
- link: string;
126
- };
127
- table: NSBaseMetaTable;
128
- }
129
- {
130
- let ans = this.forEachProduct(product =>
131
- {
132
- for (let table in product.meta.tables)
133
- if (product.meta.tables[table].uuid.short === short_name)
134
- return { product: product.meta.product, table: product.meta.tables[table] };
135
- return null;
136
- });
137
- if (ans)
138
- return ans;
139
- throw new Error(`Result could not be found for short name: ${short_name}`);
140
- }
1
+ import { NSBaseMetaDatabase, NSBaseMetaTable } from "namirasoft-site";
2
+ import { BaseMap } from "./BaseMap";
3
+ // tables import start
4
+ import { APILinkMap } from "./maps/APILinkMap";
5
+ import { APINewsMap } from "./maps/APINewsMap";
6
+ import { APIProductMap } from "./maps/APIProductMap";
7
+ import { APIServiceMap } from "./maps/APIServiceMap";
8
+ import { APIWorkMap } from "./maps/APIWorkMap";
9
+ import { AccessMap } from "./maps/AccessMap";
10
+ import { AccountMap } from "./maps/AccountMap";
11
+ import { AlarmMap } from "./maps/AlarmMap";
12
+ import { BalanceMap } from "./maps/BalanceMap";
13
+ import { ContentTemplateMap } from "./maps/ContentTemplateMap";
14
+ import { DataMap } from "./maps/DataMap";
15
+ import { EmailSenderMap } from "./maps/EmailSenderMap";
16
+ import { FieldMap } from "./maps/FieldMap";
17
+ import { HistoryMap } from "./maps/HistoryMap";
18
+ import { JobArrangerMap } from "./maps/JobArrangerMap";
19
+ import { LogMap } from "./maps/LogMap";
20
+ import { MessageMap } from "./maps/MessageMap";
21
+ import { NWSMaxMindMap } from "./maps/NWSMaxMindMap";
22
+ import { NWSRegionMap } from "./maps/NWSRegionMap";
23
+ import { NotificationSenderMap } from "./maps/NotificationSenderMap";
24
+ import { PaymentMap } from "./maps/PaymentMap";
25
+ import { SMSSenderMap } from "./maps/SMSSenderMap";
26
+ import { SecretMap } from "./maps/SecretMap";
27
+ import { WorkspaceMap } from "./maps/WorkspaceMap";
28
+ // tables import end
29
+
30
+ export class Globe
31
+ {
32
+ public static namirasoft: Globe = new Globe();
33
+ // tables define start
34
+ public api_link: APILinkMap;
35
+ public api_news: APINewsMap;
36
+ public api_product: APIProductMap;
37
+ public api_service: APIServiceMap;
38
+ public api_work: APIWorkMap;
39
+ public access: AccessMap;
40
+ public account: AccountMap;
41
+ public alarm: AlarmMap;
42
+ public balance: BalanceMap;
43
+ public content_template: ContentTemplateMap;
44
+ public data: DataMap;
45
+ public email_sender: EmailSenderMap;
46
+ public field: FieldMap;
47
+ public history: HistoryMap;
48
+ public job_arranger: JobArrangerMap;
49
+ public log: LogMap;
50
+ public message: MessageMap;
51
+ public nws_max_mind: NWSMaxMindMap;
52
+ public nws_region: NWSRegionMap;
53
+ public notification_sender: NotificationSenderMap;
54
+ public payment: PaymentMap;
55
+ public sms_sender: SMSSenderMap;
56
+ public secret: SecretMap;
57
+ public workspace: WorkspaceMap;
58
+ // tables define end
59
+ constructor()
60
+ {
61
+ // tables init start
62
+ this.api_link = new APILinkMap();
63
+ this.api_news = new APINewsMap();
64
+ this.api_product = new APIProductMap();
65
+ this.api_service = new APIServiceMap();
66
+ this.api_work = new APIWorkMap();
67
+ this.access = new AccessMap();
68
+ this.account = new AccountMap();
69
+ this.alarm = new AlarmMap();
70
+ this.balance = new BalanceMap();
71
+ this.content_template = new ContentTemplateMap();
72
+ this.data = new DataMap();
73
+ this.email_sender = new EmailSenderMap();
74
+ this.field = new FieldMap();
75
+ this.history = new HistoryMap();
76
+ this.job_arranger = new JobArrangerMap();
77
+ this.log = new LogMap();
78
+ this.message = new MessageMap();
79
+ this.nws_max_mind = new NWSMaxMindMap();
80
+ this.nws_region = new NWSRegionMap();
81
+ this.notification_sender = new NotificationSenderMap();
82
+ this.payment = new PaymentMap();
83
+ this.sms_sender = new SMSSenderMap();
84
+ this.secret = new SecretMap();
85
+ this.workspace = new WorkspaceMap();
86
+ // tables init end
87
+ }
88
+ forEachProduct<T>(handler: (map: BaseMap<NSBaseMetaDatabase, any>) => T | null): T | null
89
+ {
90
+ for (let key of Object.keys(this))
91
+ {
92
+ let obj = (this as any)[key];
93
+ if (obj?.meta)
94
+ {
95
+ let ans = handler(obj);
96
+ if (ans)
97
+ return ans;
98
+ }
99
+ }
100
+ return null;
101
+ }
102
+ getByProductID(product_id: string): BaseMap<NSBaseMetaDatabase, any>
103
+ {
104
+ let ans = this.forEachProduct(m =>
105
+ {
106
+ if (m.meta.product.id === product_id)
107
+ return m;
108
+ return null;
109
+ });
110
+ if (ans)
111
+ return ans;
112
+ throw new Error(`Map could not be found for product id: ${product_id}`);
113
+ }
114
+ getByShortName(short_name: string):
115
+ {
116
+ product: {
117
+ id: string;
118
+ name: string;
119
+ headline: string;
120
+ description: string;
121
+ logo: string;
122
+ link: string;
123
+ };
124
+ table: NSBaseMetaTable;
125
+ }
126
+ {
127
+ let ans = this.forEachProduct(product =>
128
+ {
129
+ for (let table in product.meta.tables)
130
+ if (product.meta.tables[table].uuid.short === short_name)
131
+ return { product: product.meta.product, table: product.meta.tables[table] };
132
+ return null;
133
+ });
134
+ if (ans)
135
+ return ans;
136
+ throw new Error(`Result could not be found for short name: ${short_name}`);
137
+ }
141
138
  };
package/src/build.ts CHANGED
@@ -1,97 +1,97 @@
1
- import fs from "fs";
2
- import { NamingConvention } from "namirasoft-core";
3
-
4
- let products =
5
- [
6
- 'API Link',
7
- 'API News',
8
- 'API Product',
9
- 'API Service',
10
- 'API Work',
11
- 'Access',
12
- 'Account',
13
- 'Alarm',
14
- 'Balance',
15
- 'Content Template',
16
- 'Data',
17
- 'Email Sender',
18
- 'Field',
19
- 'History',
20
- 'Job Arranger',
21
- 'Log',
22
- 'Message',
23
- 'NWS Max Mind',
24
- 'NWS Region',
25
- 'Notification Sender',
26
- 'Payment',
27
- 'SMS Sender',
28
- 'Secret',
29
- "Timify",
30
- 'Workspace'
31
-
32
- // "Cretificate",
33
- // "Hive",
34
- // "Lend",
35
- // "Redeem",
36
- ];
37
- products = products.sort();
38
- console.log(products);
39
-
40
- function build()
41
- {
42
- let index_code = [];
43
- let imports = ["// tables import start"];
44
- let defines = ["// tables define start"];
45
- let inits = ["// tables init start"];
46
- for (let i = 0; i < products.length; i++)
47
- {
48
- let product = products[i];
49
- let package_name = "namirasoft-" + NamingConvention.Pascal_Case_Space.convert(product, NamingConvention.lower_case_dash, false);
50
- let var_name = NamingConvention.Pascal_Case_Space.convert(product, NamingConvention.lower_case_underscore, false);
51
- let type_name = NamingConvention.Pascal_Case_Space.convert(product, NamingConvention.Pascal_Case);
52
-
53
- index_code.push(`export * from "./${type_name}Map";`);
54
- imports.push(`import { ${type_name}Map } from "./maps/${type_name}Map";`);
55
- defines.push(` public ${var_name}: ${type_name}Map;`);
56
- inits.push(` this.${var_name} = new ${type_name}Map();`);
57
-
58
- fs.writeFileSync(`./src/maps/${type_name}Map.ts`,
59
- `import { Namirasoft${type_name}MetaDatabase, Namirasoft${type_name}Server } from "${package_name}";
60
- import { BaseMap } from "../BaseMap";
61
-
62
- export class ${type_name}Map extends BaseMap<Namirasoft${type_name}MetaDatabase, Namirasoft${type_name}Server>
63
- {
64
- constructor()
65
- {
66
- super(new Namirasoft${type_name}MetaDatabase());
67
- }
68
- };`);
69
- }
70
- imports.push("// tables import end");
71
- defines.push("// tables define end");
72
- inits.push("// tables init end");
73
-
74
- let globe_code = fs.readFileSync("./src/Globe.ts").toString();
75
- {
76
- let start_index = globe_code.indexOf(imports[0]);
77
- let end_index = globe_code.indexOf(imports[imports.length - 1]) + imports[imports.length - 1].length;
78
- globe_code = globe_code.substring(0, start_index) + imports.join("\n") + globe_code.substring(end_index);
79
- }
80
- {
81
- let start_index = globe_code.indexOf(defines[0]);
82
- let end_index = globe_code.indexOf(defines[defines.length - 1]) + defines[defines.length - 1].length;
83
- defines[defines.length - 1] = " " + defines[defines.length - 1];
84
- globe_code = globe_code.substring(0, start_index) + defines.join("\n") + globe_code.substring(end_index);
85
- }
86
- {
87
- let start_index = globe_code.indexOf(inits[0]);
88
- let end_index = globe_code.indexOf(inits[inits.length - 1]) + inits[inits.length - 1].length;
89
- inits[defines.length - 1] = " " + inits[defines.length - 1];
90
- globe_code = globe_code.substring(0, start_index) + inits.join("\n") + "" + globe_code.substring(end_index);
91
- }
92
-
93
- fs.writeFileSync("./src/Globe.ts", globe_code);
94
- fs.writeFileSync("./src/maps/index.ts", index_code.join("\n"));
95
- }
96
-
1
+ import fs from "fs";
2
+ import { NamingConvention } from "namirasoft-core";
3
+
4
+ let products =
5
+ [
6
+ 'API Link',
7
+ 'API News',
8
+ 'API Product',
9
+ 'API Service',
10
+ 'API Work',
11
+ 'Access',
12
+ 'Account',
13
+ 'Alarm',
14
+ 'Balance',
15
+ 'Content Template',
16
+ 'Data',
17
+ 'Email Sender',
18
+ 'Field',
19
+ 'History',
20
+ 'Job Arranger',
21
+ 'Log',
22
+ 'Message',
23
+ 'NWS Max Mind',
24
+ 'NWS Region',
25
+ 'Notification Sender',
26
+ 'Payment',
27
+ 'SMS Sender',
28
+ 'Secret',
29
+ "Timify",
30
+ 'Workspace'
31
+
32
+ // "Cretificate",
33
+ // "Hive",
34
+ // "Lend",
35
+ // "Redeem",
36
+ ];
37
+ products = products.sort();
38
+ console.log(products);
39
+
40
+ function build()
41
+ {
42
+ let index_code = [];
43
+ let imports = ["// tables import start"];
44
+ let defines = ["// tables define start"];
45
+ let inits = ["// tables init start"];
46
+ for (let i = 0; i < products.length; i++)
47
+ {
48
+ let product = products[i];
49
+ let package_name = "namirasoft-" + NamingConvention.Pascal_Case_Space.convert(product, NamingConvention.lower_case_dash, false);
50
+ let var_name = NamingConvention.Pascal_Case_Space.convert(product, NamingConvention.lower_case_underscore, false);
51
+ let type_name = NamingConvention.Pascal_Case_Space.convert(product, NamingConvention.Pascal_Case);
52
+
53
+ index_code.push(`export * from "./${type_name}Map";`);
54
+ imports.push(`import { ${type_name}Map } from "./maps/${type_name}Map";`);
55
+ defines.push(` public ${var_name}: ${type_name}Map;`);
56
+ inits.push(` this.${var_name} = new ${type_name}Map();`);
57
+
58
+ fs.writeFileSync(`./src/maps/${type_name}Map.ts`,
59
+ `import { Namirasoft${type_name}MetaDatabase, Namirasoft${type_name}Server } from "${package_name}";
60
+ import { BaseMap } from "../BaseMap";
61
+
62
+ export class ${type_name}Map extends BaseMap<Namirasoft${type_name}MetaDatabase, Namirasoft${type_name}Server>
63
+ {
64
+ constructor()
65
+ {
66
+ super(new Namirasoft${type_name}MetaDatabase());
67
+ }
68
+ };`);
69
+ }
70
+ imports.push("// tables import end");
71
+ defines.push("// tables define end");
72
+ inits.push("// tables init end");
73
+
74
+ let globe_code = fs.readFileSync("./src/Globe.ts").toString();
75
+ {
76
+ let start_index = globe_code.indexOf(imports[0]);
77
+ let end_index = globe_code.indexOf(imports[imports.length - 1]) + imports[imports.length - 1].length;
78
+ globe_code = globe_code.substring(0, start_index) + imports.join("\n") + globe_code.substring(end_index);
79
+ }
80
+ {
81
+ let start_index = globe_code.indexOf(defines[0]);
82
+ let end_index = globe_code.indexOf(defines[defines.length - 1]) + defines[defines.length - 1].length;
83
+ defines[defines.length - 1] = " " + defines[defines.length - 1];
84
+ globe_code = globe_code.substring(0, start_index) + defines.join("\n") + globe_code.substring(end_index);
85
+ }
86
+ {
87
+ let start_index = globe_code.indexOf(inits[0]);
88
+ let end_index = globe_code.indexOf(inits[inits.length - 1]) + inits[inits.length - 1].length;
89
+ inits[defines.length - 1] = " " + inits[defines.length - 1];
90
+ globe_code = globe_code.substring(0, start_index) + inits.join("\n") + "" + globe_code.substring(end_index);
91
+ }
92
+
93
+ fs.writeFileSync("./src/Globe.ts", globe_code);
94
+ fs.writeFileSync("./src/maps/index.ts", index_code.join("\n"));
95
+ }
96
+
97
97
  build();
package/src/check.ts CHANGED
@@ -1,21 +1,21 @@
1
- import { NSBaseMetaTable } from "namirasoft-site";
2
- import { Globe } from "./Globe";
3
-
4
- let keys: { [short: string]: NSBaseMetaTable } = {};
5
- Globe.namirasoft.forEachProduct(product =>
6
- {
7
- for (let key in product.meta.tables)
8
- {
9
- const table = product.meta.tables[key];
10
- if (table.uuid.short)
11
- {
12
- if (keys[table.uuid.short])
13
- {
14
- console.log(`Duplicate short name:`);
15
- console.log(`\t\t${table.database.product.name} - ${table.text}`);
16
- console.log(`\t\t${keys[table.uuid.short].database.product.name} - ${keys[table.uuid.short].text}`);
17
- }
18
- keys[table.uuid.short] = table;
19
- }
20
- }
1
+ import { NSBaseMetaTable } from "namirasoft-site";
2
+ import { Globe } from "./Globe";
3
+
4
+ let keys: { [short: string]: NSBaseMetaTable } = {};
5
+ Globe.namirasoft.forEachProduct(product =>
6
+ {
7
+ for (let key in product.meta.tables)
8
+ {
9
+ const table = product.meta.tables[key];
10
+ if (table.uuid.short)
11
+ {
12
+ if (keys[table.uuid.short])
13
+ {
14
+ console.log(`Duplicate short name:`);
15
+ console.log(`\t\t${table.database.product.name} - ${table.text}`);
16
+ console.log(`\t\t${keys[table.uuid.short].database.product.name} - ${keys[table.uuid.short].text}`);
17
+ }
18
+ keys[table.uuid.short] = table;
19
+ }
20
+ }
21
21
  });
package/src/index.ts CHANGED
@@ -1,3 +1,9 @@
1
- export * from "./BaseMap";
2
- export * from "./Globe";
1
+ import { Globe } from "./Globe";
2
+ Globe.namirasoft.api_product.meta.tables.product.front_end.getViewLink = (id: string) =>
3
+ {
4
+ return Globe.namirasoft.getByProductID(id).meta.product.link;
5
+ }
6
+
7
+ export * from "./BaseMap";
8
+ export * from "./Globe";
3
9
  export * from "./maps/index";
package/src/maps/index.ts CHANGED
@@ -1,25 +1,24 @@
1
- export * from "./APILinkMap";
2
- export * from "./APINewsMap";
3
- export * from "./APIProductMap";
4
- export * from "./APIServiceMap";
5
- export * from "./APIWorkMap";
6
- export * from "./AccessMap";
7
- export * from "./AccountMap";
8
- export * from "./AlarmMap";
9
- export * from "./BalanceMap";
10
- export * from "./ContentTemplateMap";
11
- export * from "./DataMap";
12
- export * from "./EmailSenderMap";
13
- export * from "./FieldMap";
14
- export * from "./HistoryMap";
15
- export * from "./JobArrangerMap";
16
- export * from "./LogMap";
17
- export * from "./MessageMap";
18
- export * from "./NWSMaxMindMap";
19
- export * from "./NWSRegionMap";
20
- export * from "./NotificationSenderMap";
21
- export * from "./PaymentMap";
22
- export * from "./SMSSenderMap";
23
- export * from "./SecretMap";
24
- export * from "./TimifyMap";
1
+ export * from "./APILinkMap";
2
+ export * from "./APINewsMap";
3
+ export * from "./APIProductMap";
4
+ export * from "./APIServiceMap";
5
+ export * from "./APIWorkMap";
6
+ export * from "./AccessMap";
7
+ export * from "./AccountMap";
8
+ export * from "./AlarmMap";
9
+ export * from "./BalanceMap";
10
+ export * from "./ContentTemplateMap";
11
+ export * from "./DataMap";
12
+ export * from "./EmailSenderMap";
13
+ export * from "./FieldMap";
14
+ export * from "./HistoryMap";
15
+ export * from "./JobArrangerMap";
16
+ export * from "./LogMap";
17
+ export * from "./MessageMap";
18
+ export * from "./NWSMaxMindMap";
19
+ export * from "./NWSRegionMap";
20
+ export * from "./NotificationSenderMap";
21
+ export * from "./PaymentMap";
22
+ export * from "./SMSSenderMap";
23
+ export * from "./SecretMap";
25
24
  export * from "./WorkspaceMap";
@@ -1,10 +0,0 @@
1
- import { NamirasoftTimifyMetaDatabase, NamirasoftTimifyServer } from "namirasoft-timify";
2
- import { BaseMap } from "../BaseMap";
3
-
4
- export class TimifyMap extends BaseMap<NamirasoftTimifyMetaDatabase, NamirasoftTimifyServer>
5
- {
6
- constructor()
7
- {
8
- super(new NamirasoftTimifyMetaDatabase());
9
- }
10
- };
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes