namirasoft-access 1.4.38 → 1.4.40
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/dist/AccessControl.js +1 -0
- package/dist/AccessControl.js.map +1 -1
- package/dist/NamirasoftAccessServerBase.js +1 -1
- package/dist/command/RoleCreateCommand.js +12 -12
- package/dist/command/RoleCreateCommand.js.map +1 -1
- package/dist/command/RoleUpdateCommand.js +12 -12
- package/dist/command/RoleUpdateCommand.js.map +1 -1
- package/dist/row/RoleFullRow.d.ts +3 -3
- package/dist/row/RoleInputRow.d.ts +3 -3
- package/package.json +27 -27
- package/src/AccessControl.ts +29 -28
- package/src/NamirasoftAccessServer.ts +80 -80
- package/src/NamirasoftAccessServerAccess.ts +43 -43
- package/src/NamirasoftAccessServerBase.ts +29 -29
- package/src/NamirasoftAccessServerHealthz.ts +35 -35
- package/src/NamirasoftAccessServerPermission.ts +108 -108
- package/src/NamirasoftAccessServerPermissionCategory.ts +62 -62
- package/src/NamirasoftAccessServerPermissionField.ts +69 -69
- package/src/NamirasoftAccessServerPermissionTag.ts +69 -69
- package/src/NamirasoftAccessServerPolicy.ts +86 -86
- package/src/NamirasoftAccessServerPolicyCategory.ts +62 -62
- package/src/NamirasoftAccessServerPolicyField.ts +69 -69
- package/src/NamirasoftAccessServerPolicyTag.ts +69 -69
- package/src/NamirasoftAccessServerProduct.ts +54 -54
- package/src/NamirasoftAccessServerRole.ts +86 -86
- package/src/NamirasoftAccessServerRoleCategory.ts +62 -62
- package/src/NamirasoftAccessServerRoleField.ts +69 -69
- package/src/NamirasoftAccessServerRoleTag.ts +69 -69
- package/src/NamirasoftAccessServerUserRole.ts +35 -35
- package/src/NamirasoftAccessServerValue.ts +36 -36
- package/src/command/AccessCommand.ts +33 -33
- package/src/command/AccessGetCommand.ts +44 -44
- package/src/command/AccessSetOwnerCommand.ts +55 -55
- package/src/command/HealthzCommand.ts +31 -31
- package/src/command/HealthzGetCommand.ts +44 -44
- package/src/command/PermissionCategoryCommand.ts +37 -37
- package/src/command/PermissionCategoryCreateCommand.ts +55 -55
- package/src/command/PermissionCategoryDeleteCommand.ts +44 -44
- package/src/command/PermissionCategoryGetCommand.ts +44 -44
- package/src/command/PermissionCategoryListCommand.ts +44 -44
- package/src/command/PermissionCommand.ts +49 -49
- package/src/command/PermissionCreateCommand.ts +118 -118
- package/src/command/PermissionDeleteIncomingCommand.ts +44 -44
- package/src/command/PermissionDeleteOutgoingCommand.ts +44 -44
- package/src/command/PermissionFieldCommand.ts +39 -39
- package/src/command/PermissionFieldCreateCommand.ts +64 -64
- package/src/command/PermissionFieldDeleteCommand.ts +44 -44
- package/src/command/PermissionFieldGetCommand.ts +44 -44
- package/src/command/PermissionFieldListCommand.ts +44 -44
- package/src/command/PermissionFieldUpdateCommand.ts +64 -64
- package/src/command/PermissionGetCommand.ts +44 -44
- package/src/command/PermissionGetIncomingCommand.ts +44 -44
- package/src/command/PermissionGetOutgoingCommand.ts +44 -44
- package/src/command/PermissionListCommand.ts +44 -44
- package/src/command/PermissionListIncomingCommand.ts +44 -44
- package/src/command/PermissionListOutgoingCommand.ts +44 -44
- package/src/command/PermissionTagCommand.ts +39 -39
- package/src/command/PermissionTagCreateCommand.ts +64 -64
- package/src/command/PermissionTagDeleteCommand.ts +44 -44
- package/src/command/PermissionTagGetCommand.ts +44 -44
- package/src/command/PermissionTagListCommand.ts +44 -44
- package/src/command/PermissionTagUpdateCommand.ts +64 -64
- package/src/command/PermissionUpdateCommand.ts +118 -118
- package/src/command/PolicyCategoryCommand.ts +37 -37
- package/src/command/PolicyCategoryCreateCommand.ts +55 -55
- package/src/command/PolicyCategoryDeleteCommand.ts +44 -44
- package/src/command/PolicyCategoryGetCommand.ts +44 -44
- package/src/command/PolicyCategoryListCommand.ts +44 -44
- package/src/command/PolicyCommand.ts +43 -43
- package/src/command/PolicyCreateCommand.ts +136 -136
- package/src/command/PolicyDeleteCommand.ts +44 -44
- package/src/command/PolicyFieldCommand.ts +39 -39
- package/src/command/PolicyFieldCreateCommand.ts +64 -64
- package/src/command/PolicyFieldDeleteCommand.ts +44 -44
- package/src/command/PolicyFieldGetCommand.ts +44 -44
- package/src/command/PolicyFieldListCommand.ts +44 -44
- package/src/command/PolicyFieldUpdateCommand.ts +64 -64
- package/src/command/PolicyGetCommand.ts +44 -44
- package/src/command/PolicyGetIncomingCommand.ts +44 -44
- package/src/command/PolicyListCommand.ts +44 -44
- package/src/command/PolicyListIncomingCommand.ts +44 -44
- package/src/command/PolicyTagCommand.ts +39 -39
- package/src/command/PolicyTagCreateCommand.ts +64 -64
- package/src/command/PolicyTagDeleteCommand.ts +44 -44
- package/src/command/PolicyTagGetCommand.ts +44 -44
- package/src/command/PolicyTagListCommand.ts +44 -44
- package/src/command/PolicyTagUpdateCommand.ts +64 -64
- package/src/command/PolicyUpdateCommand.ts +136 -136
- package/src/command/ProductCommand.ts +35 -35
- package/src/command/ProductGetCommand.ts +44 -44
- package/src/command/ProductListCommand.ts +44 -44
- package/src/command/ProductSetCommand.ts +55 -55
- package/src/command/RoleCategoryCommand.ts +37 -37
- package/src/command/RoleCategoryCreateCommand.ts +55 -55
- package/src/command/RoleCategoryDeleteCommand.ts +44 -44
- package/src/command/RoleCategoryGetCommand.ts +44 -44
- package/src/command/RoleCategoryListCommand.ts +44 -44
- package/src/command/RoleCommand.ts +43 -43
- package/src/command/RoleCreateCommand.ts +100 -100
- package/src/command/RoleDeleteCommand.ts +44 -44
- package/src/command/RoleFieldCommand.ts +39 -39
- package/src/command/RoleFieldCreateCommand.ts +64 -64
- package/src/command/RoleFieldDeleteCommand.ts +44 -44
- package/src/command/RoleFieldGetCommand.ts +44 -44
- package/src/command/RoleFieldListCommand.ts +44 -44
- package/src/command/RoleFieldUpdateCommand.ts +64 -64
- package/src/command/RoleGetCommand.ts +44 -44
- package/src/command/RoleGetIncomingCommand.ts +44 -44
- package/src/command/RoleListCommand.ts +44 -44
- package/src/command/RoleListIncomingCommand.ts +44 -44
- package/src/command/RoleTagCommand.ts +39 -39
- package/src/command/RoleTagCreateCommand.ts +64 -64
- package/src/command/RoleTagDeleteCommand.ts +44 -44
- package/src/command/RoleTagGetCommand.ts +44 -44
- package/src/command/RoleTagListCommand.ts +44 -44
- package/src/command/RoleTagUpdateCommand.ts +64 -64
- package/src/command/RoleUpdateCommand.ts +100 -100
- package/src/command/UserRoleCommand.ts +31 -31
- package/src/command/UserRoleSetCommand.ts +64 -64
- package/src/command/ValueCommand.ts +31 -31
- package/src/command/ValueListCommand.ts +44 -44
- package/src/command/cli.ts +64 -64
- package/src/index.ts +166 -166
- package/src/meta/NamirasoftAccessMetaDatabase.ts +69 -69
- package/src/meta/PermissionCategoryMetaTable.ts +45 -45
- package/src/meta/PermissionFieldMetaTable.ts +47 -47
- package/src/meta/PermissionMetaTable.ts +51 -51
- package/src/meta/PermissionTagMetaTable.ts +47 -47
- package/src/meta/PolicyCategoryMetaTable.ts +45 -45
- package/src/meta/PolicyFieldMetaTable.ts +47 -47
- package/src/meta/PolicyMetaTable.ts +55 -55
- package/src/meta/PolicyTagMetaTable.ts +47 -47
- package/src/meta/RoleCategoryMetaTable.ts +45 -45
- package/src/meta/RoleFieldMetaTable.ts +47 -47
- package/src/meta/RoleMetaTable.ts +45 -45
- package/src/meta/RoleTagMetaTable.ts +47 -47
- package/src/row/AccessRow.ts +27 -27
- package/src/row/EntityCategoryInputRow.ts +23 -23
- package/src/row/EntityFieldInputRow.ts +24 -24
- package/src/row/EntityTagInputRow.ts +24 -24
- package/src/row/PermissionCategoryRow.ts +28 -28
- package/src/row/PermissionFieldRow.ts +29 -29
- package/src/row/PermissionFullRow.ts +40 -40
- package/src/row/PermissionInputRow.ts +34 -34
- package/src/row/PermissionRow.ts +31 -31
- package/src/row/PermissionTagRow.ts +29 -29
- package/src/row/PolicyCategoryRow.ts +28 -28
- package/src/row/PolicyFieldRow.ts +29 -29
- package/src/row/PolicyFullRow.ts +40 -40
- package/src/row/PolicyInputRow.ts +36 -36
- package/src/row/PolicyRow.ts +33 -33
- package/src/row/PolicyTagRow.ts +29 -29
- package/src/row/ProductRow.ts +27 -27
- package/src/row/RoleCategoryRow.ts +28 -28
- package/src/row/RoleFieldRow.ts +29 -29
- package/src/row/RoleFullRow.ts +36 -36
- package/src/row/RoleInputRow.ts +32 -32
- package/src/row/RoleRow.ts +28 -28
- package/src/row/RoleTagRow.ts +29 -29
package/dist/AccessControl.js
CHANGED
|
@@ -15,6 +15,7 @@ class AccessControl {
|
|
|
15
15
|
return false;
|
|
16
16
|
}
|
|
17
17
|
static check(policies, product_id, entity, action, id) {
|
|
18
|
+
console.log({ policies, product_id, entity, action, id });
|
|
18
19
|
if (!AccessControl.isValid(policies, product_id, entity, action, id)) {
|
|
19
20
|
let message = `Access denied (Entity: '${entity}', Action: '${action}')`;
|
|
20
21
|
if (id)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AccessControl.js","sourceRoot":"","sources":["../src/AccessControl.ts"],"names":[],"mappings":";;;AAAA,qDAAiD;AAGjD,MAAa,aAAa;IAEtB,MAAM,CAAC,OAAO,CAAC,QAAqB,EAAE,UAAkB,EAAE,MAAc,EAAE,MAAc,EAAE,EAAiB;QAEvG,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EACxC,CAAC;YACG,MAAM,OAAO,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;YAC5B,IAAI,OAAO,CAAC,UAAU,IAAI,GAAG,IAAI,OAAO,CAAC,UAAU,KAAK,UAAU;gBAC9D,IAAI,OAAO,CAAC,MAAM,IAAI,GAAG,IAAI,OAAO,CAAC,MAAM,KAAK,MAAM;oBAClD,IAAI,OAAO,CAAC,OAAO,IAAI,GAAG,IAAI,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC;wBACrE,IAAI,OAAO,CAAC,SAAS,IAAI,GAAG,IAAI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,CAAC,QAAQ,CAAC,MAAM,CAAC;wBACrE,IAAI,OAAO,CAAC,SAAS,IAAI,GAAG,IAAI,EAAE,KAAK,IAAI,IAAI,OAAO,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC;4BACpF,OAAO,OAAO,CAAC,KAAK,CAAC;QACzC,CAAC;QACD,OAAO,KAAK,CAAC;IACjB,CAAC;IACD,MAAM,CAAC,KAAK,CAAC,QAAqB,EAAE,UAAkB,EAAE,MAAc,EAAE,MAAc,EAAE,EAAiB;QAErG,OAAO,CAAC,GAAG,CAAC,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,CAAC;QAC1D,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,QAAQ,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,CAAC,EACpE,CAAC;YACG,IAAI,OAAO,GAAG,2BAA2B,MAAM,eAAe,MAAM,IAAI,CAAC;YACzE,IAAI,EAAE;gBACF,OAAO,IAAI,iBAAiB,EAAE,EAAE,CAAC;YACrC,MAAM,gCAAc,CAAC,OAAO,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;QAC/C,CAAC;IACL,CAAC;CACJ;AA1BD,sCA0BC"}
|
|
@@ -4,7 +4,7 @@ exports.NamirasoftAccessServerBase = void 0;
|
|
|
4
4
|
const namirasoft_account_1 = require("namirasoft-account");
|
|
5
5
|
class NamirasoftAccessServerBase extends namirasoft_account_1.NSABaseServer {
|
|
6
6
|
constructor(base_url, manager, onError) {
|
|
7
|
-
super(base_url, `1.4.
|
|
7
|
+
super(base_url, `1.4.39`, manager, onError);
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
10
|
exports.NamirasoftAccessServerBase = NamirasoftAccessServerBase;
|
|
@@ -42,27 +42,27 @@ class RoleCreateCommand extends namirasoft_node_cli_1.BaseFinalCommand {
|
|
|
42
42
|
defaults: [""]
|
|
43
43
|
},
|
|
44
44
|
{
|
|
45
|
-
name: "
|
|
45
|
+
name: "role_category",
|
|
46
46
|
short: "",
|
|
47
|
-
description: "Provides the value of '
|
|
47
|
+
description: "Provides the value of 'role_category' in body",
|
|
48
48
|
optional: false,
|
|
49
|
-
args: ["
|
|
49
|
+
args: ["role_category"],
|
|
50
50
|
defaults: [""]
|
|
51
51
|
},
|
|
52
52
|
{
|
|
53
|
-
name: "
|
|
53
|
+
name: "role_field",
|
|
54
54
|
short: "",
|
|
55
|
-
description: "Provides the value of '
|
|
55
|
+
description: "Provides the value of 'role_field' in body",
|
|
56
56
|
optional: false,
|
|
57
|
-
args: ["
|
|
57
|
+
args: ["role_field"],
|
|
58
58
|
defaults: [""]
|
|
59
59
|
},
|
|
60
60
|
{
|
|
61
|
-
name: "
|
|
61
|
+
name: "role_tag",
|
|
62
62
|
short: "",
|
|
63
|
-
description: "Provides the value of '
|
|
63
|
+
description: "Provides the value of 'role_tag' in body",
|
|
64
64
|
optional: false,
|
|
65
|
-
args: ["
|
|
65
|
+
args: ["role_tag"],
|
|
66
66
|
defaults: [""]
|
|
67
67
|
}
|
|
68
68
|
]);
|
|
@@ -81,9 +81,9 @@ class RoleCreateCommand extends namirasoft_node_cli_1.BaseFinalCommand {
|
|
|
81
81
|
name: this.option_values.name,
|
|
82
82
|
description: this.option_values.description,
|
|
83
83
|
policies: this.option_values.policies,
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
84
|
+
role_category: this.option_values.role_category,
|
|
85
|
+
role_field: this.option_values.role_field,
|
|
86
|
+
role_tag: this.option_values.role_tag
|
|
87
87
|
});
|
|
88
88
|
this.app.logger.success(JSON.stringify(ans));
|
|
89
89
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RoleCreateCommand.js","sourceRoot":"","sources":["../../src/command/RoleCreateCommand.ts"],"names":[],"mappings":";;;;;;;;;;;;AAoBA,6DAAuD;AACvD,qDAAiD;AACjD,sEAAm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C,KAAK,EAAE,KAAK,CAAC,CAAC;YAC/B,IAAI,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,sBAAsB,CAAC,CAAC;YAC3D,IAAI,MAAM,GAAG,IAAI,+CAAsB,CAAC,GAAG,EAAE,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;YAC7F,IAAI,GAAG,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC;gBAC/B,IAAI,EAAE,IAAI,CAAC,aAAa,CAAC,IAAI;gBAC7B,WAAW,EAAE,IAAI,CAAC,aAAa,CAAC,WAAW;gBAC3C,QAAQ,EAAE,IAAI,CAAC,aAAa,CAAC,QAAQ;gBACrC,aAAa,EAAE,IAAI,CAAC,aAAa,CAAC,aAAa;gBAC/C,UAAU,EAAE,IAAI,CAAC,aAAa,CAAC,UAAU;gBACzC,QAAQ,EAAE,IAAI,CAAC,aAAa,CAAC,QAAQ;aACxC,CAAC,CAAC;YACH,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;QACjD,CAAC;KAAA;CACJ;AA3ED,8CA2EC;AAAA,CAAC"}
|
|
@@ -42,27 +42,27 @@ class RoleUpdateCommand extends namirasoft_node_cli_1.BaseFinalCommand {
|
|
|
42
42
|
defaults: [""]
|
|
43
43
|
},
|
|
44
44
|
{
|
|
45
|
-
name: "
|
|
45
|
+
name: "role_category",
|
|
46
46
|
short: "",
|
|
47
|
-
description: "Provides the value of '
|
|
47
|
+
description: "Provides the value of 'role_category' in body",
|
|
48
48
|
optional: false,
|
|
49
|
-
args: ["
|
|
49
|
+
args: ["role_category"],
|
|
50
50
|
defaults: [""]
|
|
51
51
|
},
|
|
52
52
|
{
|
|
53
|
-
name: "
|
|
53
|
+
name: "role_field",
|
|
54
54
|
short: "",
|
|
55
|
-
description: "Provides the value of '
|
|
55
|
+
description: "Provides the value of 'role_field' in body",
|
|
56
56
|
optional: false,
|
|
57
|
-
args: ["
|
|
57
|
+
args: ["role_field"],
|
|
58
58
|
defaults: [""]
|
|
59
59
|
},
|
|
60
60
|
{
|
|
61
|
-
name: "
|
|
61
|
+
name: "role_tag",
|
|
62
62
|
short: "",
|
|
63
|
-
description: "Provides the value of '
|
|
63
|
+
description: "Provides the value of 'role_tag' in body",
|
|
64
64
|
optional: false,
|
|
65
|
-
args: ["
|
|
65
|
+
args: ["role_tag"],
|
|
66
66
|
defaults: [""]
|
|
67
67
|
}
|
|
68
68
|
]);
|
|
@@ -81,9 +81,9 @@ class RoleUpdateCommand extends namirasoft_node_cli_1.BaseFinalCommand {
|
|
|
81
81
|
name: this.option_values.name,
|
|
82
82
|
description: this.option_values.description,
|
|
83
83
|
policies: this.option_values.policies,
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
84
|
+
role_category: this.option_values.role_category,
|
|
85
|
+
role_field: this.option_values.role_field,
|
|
86
|
+
role_tag: this.option_values.role_tag
|
|
87
87
|
});
|
|
88
88
|
this.app.logger.success(JSON.stringify(ans));
|
|
89
89
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RoleUpdateCommand.js","sourceRoot":"","sources":["../../src/command/RoleUpdateCommand.ts"],"names":[],"mappings":";;;;;;;;;;;;AAoBA,6DAAuD;AACvD,qDAAiD;AACjD,sEAAmE;AACnE,2DAAkD;AAElD,MAAa,iBAAkB,SAAQ,sCAAgB;IAEnD,YAAY,IAAc;QAEtB,KAAK,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC,EAAE;YAChB;gBACI,IAAI,EAAE,MAAM;gBACZ,KAAK,EAAE,EAAE;gBACT,WAAW,EAAE,sCAAsC;gBACnD,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,CAAC,MAAM,CAAC;gBACd,QAAQ,EA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,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;YAC7F,IAAI,GAAG,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE;gBACnD,IAAI,EAAE,IAAI,CAAC,aAAa,CAAC,IAAI;gBAC7B,WAAW,EAAE,IAAI,CAAC,aAAa,CAAC,WAAW;gBAC3C,QAAQ,EAAE,IAAI,CAAC,aAAa,CAAC,QAAQ;gBACrC,aAAa,EAAE,IAAI,CAAC,aAAa,CAAC,aAAa;gBAC/C,UAAU,EAAE,IAAI,CAAC,aAAa,CAAC,UAAU;gBACzC,QAAQ,EAAE,IAAI,CAAC,aAAa,CAAC,QAAQ;aACxC,CAAC,CAAC;YACH,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;QACjD,CAAC;KAAA;CACJ;AA3ED,8CA2EC;AAAA,CAAC"}
|
|
@@ -9,7 +9,7 @@ export type RoleFullRow = {
|
|
|
9
9
|
created_at: Date;
|
|
10
10
|
updated_at: Date;
|
|
11
11
|
policies: (string | null)[];
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
role_category: (EntityCategoryInputRow | null)[];
|
|
13
|
+
role_field: (EntityFieldInputRow | null)[];
|
|
14
|
+
role_tag: (EntityTagInputRow | null)[];
|
|
15
15
|
};
|
|
@@ -5,7 +5,7 @@ export type RoleInputRow = {
|
|
|
5
5
|
name: string;
|
|
6
6
|
description: (string | null);
|
|
7
7
|
policies: (string | null)[];
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
role_category: (EntityCategoryInputRow | null)[];
|
|
9
|
+
role_field: (EntityFieldInputRow | null)[];
|
|
10
|
+
role_tag: (EntityTagInputRow | null)[];
|
|
11
11
|
};
|
package/package.json
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "namirasoft-access",
|
|
3
|
-
"title": "Namirasoft Access NPM Package",
|
|
4
|
-
"description": "Namira Software Corporation Access NPM Package",
|
|
5
|
-
"icon": "logo.png",
|
|
6
|
-
"logo": "https://static.namirasoft.com/image/namirasoft/access/logo/base.png",
|
|
7
|
-
"language": "ts",
|
|
8
|
-
"framework": "npm",
|
|
9
|
-
"application": "package",
|
|
10
|
-
"private": false,
|
|
11
|
-
"version": "1.4.
|
|
12
|
-
"author": "Amir Abolhasani",
|
|
13
|
-
"license": "MIT",
|
|
14
|
-
"main": "./dist/index.js",
|
|
15
|
-
"types": "./dist/index.d.ts",
|
|
16
|
-
"scripts": {
|
|
17
|
-
"build": ""
|
|
18
|
-
},
|
|
19
|
-
"dependencies": {
|
|
20
|
-
"namirasoft-core": "^1.4.
|
|
21
|
-
"namirasoft-site": "^1.4.8",
|
|
22
|
-
"namirasoft-node-cli": "^1.4.5",
|
|
23
|
-
"namirasoft-account": "^1.4.
|
|
24
|
-
},
|
|
25
|
-
"bin": {
|
|
26
|
-
"ns-access": "./dist/command/cli.js"
|
|
27
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "namirasoft-access",
|
|
3
|
+
"title": "Namirasoft Access NPM Package",
|
|
4
|
+
"description": "Namira Software Corporation Access NPM Package",
|
|
5
|
+
"icon": "logo.png",
|
|
6
|
+
"logo": "https://static.namirasoft.com/image/namirasoft/access/logo/base.png",
|
|
7
|
+
"language": "ts",
|
|
8
|
+
"framework": "npm",
|
|
9
|
+
"application": "package",
|
|
10
|
+
"private": false,
|
|
11
|
+
"version": "1.4.40",
|
|
12
|
+
"author": "Amir Abolhasani",
|
|
13
|
+
"license": "MIT",
|
|
14
|
+
"main": "./dist/index.js",
|
|
15
|
+
"types": "./dist/index.d.ts",
|
|
16
|
+
"scripts": {
|
|
17
|
+
"build": ""
|
|
18
|
+
},
|
|
19
|
+
"dependencies": {
|
|
20
|
+
"namirasoft-core": "^1.4.43",
|
|
21
|
+
"namirasoft-site": "^1.4.8",
|
|
22
|
+
"namirasoft-node-cli": "^1.4.5",
|
|
23
|
+
"namirasoft-account": "^1.4.49"
|
|
24
|
+
},
|
|
25
|
+
"bin": {
|
|
26
|
+
"ns-access": "./dist/command/cli.js"
|
|
27
|
+
}
|
|
28
28
|
}
|
package/src/AccessControl.ts
CHANGED
|
@@ -1,29 +1,30 @@
|
|
|
1
|
-
import { ErrorOperation } from "namirasoft-core";
|
|
2
|
-
import { PolicyRow } from "./row/PolicyRow";
|
|
3
|
-
|
|
4
|
-
export class AccessControl
|
|
5
|
-
{
|
|
6
|
-
static isValid(policies: PolicyRow[], product_id: string, entity: string, action: string, id: string | null): boolean
|
|
7
|
-
{
|
|
8
|
-
for (let i = 0; i < policies.length; i++)
|
|
9
|
-
{
|
|
10
|
-
const element = policies[i];
|
|
11
|
-
if (element.product_id == "*" || element.product_id === product_id)
|
|
12
|
-
if (element.entity == "*" || element.entity === entity)
|
|
13
|
-
if (element.actions == "*" || element.actions.split(";").includes(action))
|
|
14
|
-
if (element.resources == "*" || id === null || element.resources.split(";").includes(id))
|
|
15
|
-
return element.allow;
|
|
16
|
-
}
|
|
17
|
-
return false;
|
|
18
|
-
}
|
|
19
|
-
static check(policies: PolicyRow[], product_id: string, entity: string, action: string, id: string | null): void
|
|
20
|
-
{
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
1
|
+
import { ErrorOperation } from "namirasoft-core";
|
|
2
|
+
import { PolicyRow } from "./row/PolicyRow";
|
|
3
|
+
|
|
4
|
+
export class AccessControl
|
|
5
|
+
{
|
|
6
|
+
static isValid(policies: PolicyRow[], product_id: string, entity: string, action: string, id: string | null): boolean
|
|
7
|
+
{
|
|
8
|
+
for (let i = 0; i < policies.length; i++)
|
|
9
|
+
{
|
|
10
|
+
const element = policies[i];
|
|
11
|
+
if (element.product_id == "*" || element.product_id === product_id)
|
|
12
|
+
if (element.entity == "*" || element.entity === entity)
|
|
13
|
+
if (element.actions == "*" || element.actions.split(";").includes(action))
|
|
14
|
+
if (element.resources == "*" || id === null || element.resources.split(";").includes(id))
|
|
15
|
+
return element.allow;
|
|
16
|
+
}
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
static check(policies: PolicyRow[], product_id: string, entity: string, action: string, id: string | null): void
|
|
20
|
+
{
|
|
21
|
+
console.log({ policies, product_id, entity, action, id });
|
|
22
|
+
if (!AccessControl.isValid(policies, product_id, entity, action, id))
|
|
23
|
+
{
|
|
24
|
+
let message = `Access denied (Entity: '${entity}', Action: '${action}')`;
|
|
25
|
+
if (id)
|
|
26
|
+
message += ` on resource: ${id}`;
|
|
27
|
+
throw ErrorOperation.getHTTP(403, message);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
29
30
|
}
|
|
@@ -1,81 +1,81 @@
|
|
|
1
|
-
/****************************************************************/
|
|
2
|
-
/* */
|
|
3
|
-
/* This is an Auto-Generated File */
|
|
4
|
-
/* Made By */
|
|
5
|
-
/* Namirasoft SDK Generator NPM Package */
|
|
6
|
-
/* */
|
|
7
|
-
/****************************************************************/
|
|
8
|
-
/****************************************************************/
|
|
9
|
-
/* */
|
|
10
|
-
/* Please do not make any change to this file */
|
|
11
|
-
/* If any changed is reqired, ns-sdkg command must be used */
|
|
12
|
-
/* */
|
|
13
|
-
/****************************************************************/
|
|
14
|
-
/****************************************************************/
|
|
15
|
-
/* */
|
|
16
|
-
/* Namira Software Corporation */
|
|
17
|
-
/* https://namirasoft.com */
|
|
18
|
-
/* */
|
|
19
|
-
/****************************************************************/
|
|
20
|
-
|
|
21
|
-
import { NamirasoftAccessServerAccess } from "./NamirasoftAccessServerAccess";
|
|
22
|
-
import { NamirasoftAccessServerHealthz } from "./NamirasoftAccessServerHealthz";
|
|
23
|
-
import { NamirasoftAccessServerPermission } from "./NamirasoftAccessServerPermission";
|
|
24
|
-
import { NamirasoftAccessServerPermissionCategory } from "./NamirasoftAccessServerPermissionCategory";
|
|
25
|
-
import { NamirasoftAccessServerPermissionField } from "./NamirasoftAccessServerPermissionField";
|
|
26
|
-
import { NamirasoftAccessServerPermissionTag } from "./NamirasoftAccessServerPermissionTag";
|
|
27
|
-
import { NamirasoftAccessServerPolicy } from "./NamirasoftAccessServerPolicy";
|
|
28
|
-
import { NamirasoftAccessServerPolicyCategory } from "./NamirasoftAccessServerPolicyCategory";
|
|
29
|
-
import { NamirasoftAccessServerPolicyField } from "./NamirasoftAccessServerPolicyField";
|
|
30
|
-
import { NamirasoftAccessServerPolicyTag } from "./NamirasoftAccessServerPolicyTag";
|
|
31
|
-
import { NamirasoftAccessServerProduct } from "./NamirasoftAccessServerProduct";
|
|
32
|
-
import { NamirasoftAccessServerRole } from "./NamirasoftAccessServerRole";
|
|
33
|
-
import { NamirasoftAccessServerRoleCategory } from "./NamirasoftAccessServerRoleCategory";
|
|
34
|
-
import { NamirasoftAccessServerRoleField } from "./NamirasoftAccessServerRoleField";
|
|
35
|
-
import { NamirasoftAccessServerRoleTag } from "./NamirasoftAccessServerRoleTag";
|
|
36
|
-
import { NamirasoftAccessServerUserRole } from "./NamirasoftAccessServerUserRole";
|
|
37
|
-
import { NamirasoftAccessServerValue } from "./NamirasoftAccessServerValue";
|
|
38
|
-
import { TokenManager } from "namirasoft-account";
|
|
39
|
-
|
|
40
|
-
export class NamirasoftAccessServer
|
|
41
|
-
{
|
|
42
|
-
manager: TokenManager;
|
|
43
|
-
healthz: NamirasoftAccessServerHealthz;
|
|
44
|
-
value: NamirasoftAccessServerValue;
|
|
45
|
-
permissioncategory: NamirasoftAccessServerPermissionCategory;
|
|
46
|
-
permissionfield: NamirasoftAccessServerPermissionField;
|
|
47
|
-
permissiontag: NamirasoftAccessServerPermissionTag;
|
|
48
|
-
permission: NamirasoftAccessServerPermission;
|
|
49
|
-
policycategory: NamirasoftAccessServerPolicyCategory;
|
|
50
|
-
policyfield: NamirasoftAccessServerPolicyField;
|
|
51
|
-
policytag: NamirasoftAccessServerPolicyTag;
|
|
52
|
-
policy: NamirasoftAccessServerPolicy;
|
|
53
|
-
rolecategory: NamirasoftAccessServerRoleCategory;
|
|
54
|
-
rolefield: NamirasoftAccessServerRoleField;
|
|
55
|
-
roletag: NamirasoftAccessServerRoleTag;
|
|
56
|
-
role: NamirasoftAccessServerRole;
|
|
57
|
-
access: NamirasoftAccessServerAccess;
|
|
58
|
-
product: NamirasoftAccessServerProduct;
|
|
59
|
-
userrole: NamirasoftAccessServerUserRole;
|
|
60
|
-
constructor(base_url: string, manager: TokenManager, onError: (error: Error) => void)
|
|
61
|
-
{
|
|
62
|
-
this.manager = manager;
|
|
63
|
-
this.healthz = new NamirasoftAccessServerHealthz(base_url, manager, onError);
|
|
64
|
-
this.value = new NamirasoftAccessServerValue(base_url, manager, onError);
|
|
65
|
-
this.permissioncategory = new NamirasoftAccessServerPermissionCategory(base_url, manager, onError);
|
|
66
|
-
this.permissionfield = new NamirasoftAccessServerPermissionField(base_url, manager, onError);
|
|
67
|
-
this.permissiontag = new NamirasoftAccessServerPermissionTag(base_url, manager, onError);
|
|
68
|
-
this.permission = new NamirasoftAccessServerPermission(base_url, manager, onError);
|
|
69
|
-
this.policycategory = new NamirasoftAccessServerPolicyCategory(base_url, manager, onError);
|
|
70
|
-
this.policyfield = new NamirasoftAccessServerPolicyField(base_url, manager, onError);
|
|
71
|
-
this.policytag = new NamirasoftAccessServerPolicyTag(base_url, manager, onError);
|
|
72
|
-
this.policy = new NamirasoftAccessServerPolicy(base_url, manager, onError);
|
|
73
|
-
this.rolecategory = new NamirasoftAccessServerRoleCategory(base_url, manager, onError);
|
|
74
|
-
this.rolefield = new NamirasoftAccessServerRoleField(base_url, manager, onError);
|
|
75
|
-
this.roletag = new NamirasoftAccessServerRoleTag(base_url, manager, onError);
|
|
76
|
-
this.role = new NamirasoftAccessServerRole(base_url, manager, onError);
|
|
77
|
-
this.access = new NamirasoftAccessServerAccess(base_url, manager, onError);
|
|
78
|
-
this.product = new NamirasoftAccessServerProduct(base_url, manager, onError);
|
|
79
|
-
this.userrole = new NamirasoftAccessServerUserRole(base_url, manager, onError);
|
|
80
|
-
}
|
|
1
|
+
/****************************************************************/
|
|
2
|
+
/* */
|
|
3
|
+
/* This is an Auto-Generated File */
|
|
4
|
+
/* Made By */
|
|
5
|
+
/* Namirasoft SDK Generator NPM Package */
|
|
6
|
+
/* */
|
|
7
|
+
/****************************************************************/
|
|
8
|
+
/****************************************************************/
|
|
9
|
+
/* */
|
|
10
|
+
/* Please do not make any change to this file */
|
|
11
|
+
/* If any changed is reqired, ns-sdkg command must be used */
|
|
12
|
+
/* */
|
|
13
|
+
/****************************************************************/
|
|
14
|
+
/****************************************************************/
|
|
15
|
+
/* */
|
|
16
|
+
/* Namira Software Corporation */
|
|
17
|
+
/* https://namirasoft.com */
|
|
18
|
+
/* */
|
|
19
|
+
/****************************************************************/
|
|
20
|
+
|
|
21
|
+
import { NamirasoftAccessServerAccess } from "./NamirasoftAccessServerAccess";
|
|
22
|
+
import { NamirasoftAccessServerHealthz } from "./NamirasoftAccessServerHealthz";
|
|
23
|
+
import { NamirasoftAccessServerPermission } from "./NamirasoftAccessServerPermission";
|
|
24
|
+
import { NamirasoftAccessServerPermissionCategory } from "./NamirasoftAccessServerPermissionCategory";
|
|
25
|
+
import { NamirasoftAccessServerPermissionField } from "./NamirasoftAccessServerPermissionField";
|
|
26
|
+
import { NamirasoftAccessServerPermissionTag } from "./NamirasoftAccessServerPermissionTag";
|
|
27
|
+
import { NamirasoftAccessServerPolicy } from "./NamirasoftAccessServerPolicy";
|
|
28
|
+
import { NamirasoftAccessServerPolicyCategory } from "./NamirasoftAccessServerPolicyCategory";
|
|
29
|
+
import { NamirasoftAccessServerPolicyField } from "./NamirasoftAccessServerPolicyField";
|
|
30
|
+
import { NamirasoftAccessServerPolicyTag } from "./NamirasoftAccessServerPolicyTag";
|
|
31
|
+
import { NamirasoftAccessServerProduct } from "./NamirasoftAccessServerProduct";
|
|
32
|
+
import { NamirasoftAccessServerRole } from "./NamirasoftAccessServerRole";
|
|
33
|
+
import { NamirasoftAccessServerRoleCategory } from "./NamirasoftAccessServerRoleCategory";
|
|
34
|
+
import { NamirasoftAccessServerRoleField } from "./NamirasoftAccessServerRoleField";
|
|
35
|
+
import { NamirasoftAccessServerRoleTag } from "./NamirasoftAccessServerRoleTag";
|
|
36
|
+
import { NamirasoftAccessServerUserRole } from "./NamirasoftAccessServerUserRole";
|
|
37
|
+
import { NamirasoftAccessServerValue } from "./NamirasoftAccessServerValue";
|
|
38
|
+
import { TokenManager } from "namirasoft-account";
|
|
39
|
+
|
|
40
|
+
export class NamirasoftAccessServer
|
|
41
|
+
{
|
|
42
|
+
manager: TokenManager;
|
|
43
|
+
healthz: NamirasoftAccessServerHealthz;
|
|
44
|
+
value: NamirasoftAccessServerValue;
|
|
45
|
+
permissioncategory: NamirasoftAccessServerPermissionCategory;
|
|
46
|
+
permissionfield: NamirasoftAccessServerPermissionField;
|
|
47
|
+
permissiontag: NamirasoftAccessServerPermissionTag;
|
|
48
|
+
permission: NamirasoftAccessServerPermission;
|
|
49
|
+
policycategory: NamirasoftAccessServerPolicyCategory;
|
|
50
|
+
policyfield: NamirasoftAccessServerPolicyField;
|
|
51
|
+
policytag: NamirasoftAccessServerPolicyTag;
|
|
52
|
+
policy: NamirasoftAccessServerPolicy;
|
|
53
|
+
rolecategory: NamirasoftAccessServerRoleCategory;
|
|
54
|
+
rolefield: NamirasoftAccessServerRoleField;
|
|
55
|
+
roletag: NamirasoftAccessServerRoleTag;
|
|
56
|
+
role: NamirasoftAccessServerRole;
|
|
57
|
+
access: NamirasoftAccessServerAccess;
|
|
58
|
+
product: NamirasoftAccessServerProduct;
|
|
59
|
+
userrole: NamirasoftAccessServerUserRole;
|
|
60
|
+
constructor(base_url: string, manager: TokenManager, onError: (error: Error) => void)
|
|
61
|
+
{
|
|
62
|
+
this.manager = manager;
|
|
63
|
+
this.healthz = new NamirasoftAccessServerHealthz(base_url, manager, onError);
|
|
64
|
+
this.value = new NamirasoftAccessServerValue(base_url, manager, onError);
|
|
65
|
+
this.permissioncategory = new NamirasoftAccessServerPermissionCategory(base_url, manager, onError);
|
|
66
|
+
this.permissionfield = new NamirasoftAccessServerPermissionField(base_url, manager, onError);
|
|
67
|
+
this.permissiontag = new NamirasoftAccessServerPermissionTag(base_url, manager, onError);
|
|
68
|
+
this.permission = new NamirasoftAccessServerPermission(base_url, manager, onError);
|
|
69
|
+
this.policycategory = new NamirasoftAccessServerPolicyCategory(base_url, manager, onError);
|
|
70
|
+
this.policyfield = new NamirasoftAccessServerPolicyField(base_url, manager, onError);
|
|
71
|
+
this.policytag = new NamirasoftAccessServerPolicyTag(base_url, manager, onError);
|
|
72
|
+
this.policy = new NamirasoftAccessServerPolicy(base_url, manager, onError);
|
|
73
|
+
this.rolecategory = new NamirasoftAccessServerRoleCategory(base_url, manager, onError);
|
|
74
|
+
this.rolefield = new NamirasoftAccessServerRoleField(base_url, manager, onError);
|
|
75
|
+
this.roletag = new NamirasoftAccessServerRoleTag(base_url, manager, onError);
|
|
76
|
+
this.role = new NamirasoftAccessServerRole(base_url, manager, onError);
|
|
77
|
+
this.access = new NamirasoftAccessServerAccess(base_url, manager, onError);
|
|
78
|
+
this.product = new NamirasoftAccessServerProduct(base_url, manager, onError);
|
|
79
|
+
this.userrole = new NamirasoftAccessServerUserRole(base_url, manager, onError);
|
|
80
|
+
}
|
|
81
81
|
};
|
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
/****************************************************************/
|
|
2
|
-
/* */
|
|
3
|
-
/* This is an Auto-Generated File */
|
|
4
|
-
/* Made By */
|
|
5
|
-
/* Namirasoft SDK Generator NPM Package */
|
|
6
|
-
/* */
|
|
7
|
-
/****************************************************************/
|
|
8
|
-
/****************************************************************/
|
|
9
|
-
/* */
|
|
10
|
-
/* Please do not make any change to this file */
|
|
11
|
-
/* If any changed is reqired, ns-sdkg command must be used */
|
|
12
|
-
/* */
|
|
13
|
-
/****************************************************************/
|
|
14
|
-
/****************************************************************/
|
|
15
|
-
/* */
|
|
16
|
-
/* Namira Software Corporation */
|
|
17
|
-
/* https://namirasoft.com */
|
|
18
|
-
/* */
|
|
19
|
-
/****************************************************************/
|
|
20
|
-
|
|
21
|
-
import { AccessRow } from "./row/AccessRow";
|
|
22
|
-
import { NamirasoftAccessServerBase } from "./NamirasoftAccessServerBase";
|
|
23
|
-
import { TokenManager } from "namirasoft-account";
|
|
24
|
-
|
|
25
|
-
export class NamirasoftAccessServerAccess extends NamirasoftAccessServerBase
|
|
26
|
-
{
|
|
27
|
-
constructor(base_url: string, manager: TokenManager, onError: (error: Error) => void)
|
|
28
|
-
{
|
|
29
|
-
super(base_url, manager, onError);
|
|
30
|
-
this.Get = this.Get.bind(this);
|
|
31
|
-
this.SetOwner = this.SetOwner.bind(this);
|
|
32
|
-
}
|
|
33
|
-
async Get(user_id: string): Promise<AccessRow>
|
|
34
|
-
{
|
|
35
|
-
let path = `/access/${user_id}`;
|
|
36
|
-
let { data } = await this._get<AccessRow>(path, {});
|
|
37
|
-
return data;
|
|
38
|
-
}
|
|
39
|
-
async SetOwner(body: { owner_id: (string | null) }): Promise<void>
|
|
40
|
-
{
|
|
41
|
-
let path = `/access/owner`;
|
|
42
|
-
await this._put<void>(path, {}, body);
|
|
43
|
-
}
|
|
1
|
+
/****************************************************************/
|
|
2
|
+
/* */
|
|
3
|
+
/* This is an Auto-Generated File */
|
|
4
|
+
/* Made By */
|
|
5
|
+
/* Namirasoft SDK Generator NPM Package */
|
|
6
|
+
/* */
|
|
7
|
+
/****************************************************************/
|
|
8
|
+
/****************************************************************/
|
|
9
|
+
/* */
|
|
10
|
+
/* Please do not make any change to this file */
|
|
11
|
+
/* If any changed is reqired, ns-sdkg command must be used */
|
|
12
|
+
/* */
|
|
13
|
+
/****************************************************************/
|
|
14
|
+
/****************************************************************/
|
|
15
|
+
/* */
|
|
16
|
+
/* Namira Software Corporation */
|
|
17
|
+
/* https://namirasoft.com */
|
|
18
|
+
/* */
|
|
19
|
+
/****************************************************************/
|
|
20
|
+
|
|
21
|
+
import { AccessRow } from "./row/AccessRow";
|
|
22
|
+
import { NamirasoftAccessServerBase } from "./NamirasoftAccessServerBase";
|
|
23
|
+
import { TokenManager } from "namirasoft-account";
|
|
24
|
+
|
|
25
|
+
export class NamirasoftAccessServerAccess extends NamirasoftAccessServerBase
|
|
26
|
+
{
|
|
27
|
+
constructor(base_url: string, manager: TokenManager, onError: (error: Error) => void)
|
|
28
|
+
{
|
|
29
|
+
super(base_url, manager, onError);
|
|
30
|
+
this.Get = this.Get.bind(this);
|
|
31
|
+
this.SetOwner = this.SetOwner.bind(this);
|
|
32
|
+
}
|
|
33
|
+
async Get(user_id: string): Promise<AccessRow>
|
|
34
|
+
{
|
|
35
|
+
let path = `/access/${user_id}`;
|
|
36
|
+
let { data } = await this._get<AccessRow>(path, {});
|
|
37
|
+
return data;
|
|
38
|
+
}
|
|
39
|
+
async SetOwner(body: { owner_id: (string | null) }): Promise<void>
|
|
40
|
+
{
|
|
41
|
+
let path = `/access/owner`;
|
|
42
|
+
await this._put<void>(path, {}, body);
|
|
43
|
+
}
|
|
44
44
|
};
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
/****************************************************************/
|
|
2
|
-
/* */
|
|
3
|
-
/* This is an Auto-Generated File */
|
|
4
|
-
/* Made By */
|
|
5
|
-
/* Namirasoft SDK Generator NPM Package */
|
|
6
|
-
/* */
|
|
7
|
-
/****************************************************************/
|
|
8
|
-
/****************************************************************/
|
|
9
|
-
/* */
|
|
10
|
-
/* Please do not make any change to this file */
|
|
11
|
-
/* If any changed is reqired, ns-sdkg command must be used */
|
|
12
|
-
/* */
|
|
13
|
-
/****************************************************************/
|
|
14
|
-
/****************************************************************/
|
|
15
|
-
/* */
|
|
16
|
-
/* Namira Software Corporation */
|
|
17
|
-
/* https://namirasoft.com */
|
|
18
|
-
/* */
|
|
19
|
-
/****************************************************************/
|
|
20
|
-
|
|
21
|
-
import { NSABaseServer } from "namirasoft-account";
|
|
22
|
-
import { TokenManager } from "namirasoft-account";
|
|
23
|
-
|
|
24
|
-
export class NamirasoftAccessServerBase extends NSABaseServer
|
|
25
|
-
{
|
|
26
|
-
constructor(base_url: string, manager: TokenManager, onError: (error: Error) => void)
|
|
27
|
-
{
|
|
28
|
-
super(base_url, `1.4.
|
|
29
|
-
}
|
|
1
|
+
/****************************************************************/
|
|
2
|
+
/* */
|
|
3
|
+
/* This is an Auto-Generated File */
|
|
4
|
+
/* Made By */
|
|
5
|
+
/* Namirasoft SDK Generator NPM Package */
|
|
6
|
+
/* */
|
|
7
|
+
/****************************************************************/
|
|
8
|
+
/****************************************************************/
|
|
9
|
+
/* */
|
|
10
|
+
/* Please do not make any change to this file */
|
|
11
|
+
/* If any changed is reqired, ns-sdkg command must be used */
|
|
12
|
+
/* */
|
|
13
|
+
/****************************************************************/
|
|
14
|
+
/****************************************************************/
|
|
15
|
+
/* */
|
|
16
|
+
/* Namira Software Corporation */
|
|
17
|
+
/* https://namirasoft.com */
|
|
18
|
+
/* */
|
|
19
|
+
/****************************************************************/
|
|
20
|
+
|
|
21
|
+
import { NSABaseServer } from "namirasoft-account";
|
|
22
|
+
import { TokenManager } from "namirasoft-account";
|
|
23
|
+
|
|
24
|
+
export class NamirasoftAccessServerBase extends NSABaseServer
|
|
25
|
+
{
|
|
26
|
+
constructor(base_url: string, manager: TokenManager, onError: (error: Error) => void)
|
|
27
|
+
{
|
|
28
|
+
super(base_url, `1.4.39`, manager, onError);
|
|
29
|
+
}
|
|
30
30
|
};
|