@adminide-stack/core 0.0.2-0.0.16-6.0 → 0.0.2-alpha.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/LICENSE +674 -0
- package/README.md +2 -2
- package/lib/constants/billing-plan.d.ts +1 -0
- package/lib/constants/billing-plan.js +5 -0
- package/lib/constants/billing-plan.js.map +1 -0
- package/lib/constants/configuration.d.ts +6 -0
- package/lib/constants/configuration.js +10 -0
- package/lib/constants/configuration.js.map +1 -0
- package/lib/constants/constants.d.ts +0 -41
- package/lib/constants/constants.js +6 -0
- package/lib/constants/constants.js.map +1 -0
- package/lib/constants/default-workspace-config.js +7 -0
- package/lib/constants/default-workspace-config.js.map +1 -0
- package/lib/constants/index.d.ts +5 -0
- package/lib/constants/index.js +24 -0
- package/lib/constants/index.js.map +1 -0
- package/lib/constants/routes.d.ts +4 -0
- package/lib/constants/routes.js +10 -0
- package/lib/constants/routes.js.map +1 -0
- package/lib/constants/types.d.ts +19 -0
- package/lib/constants/types.js +23 -0
- package/lib/constants/types.js.map +1 -0
- package/lib/constants/urls.d.ts +3 -0
- package/lib/constants/urls.js +7 -0
- package/lib/constants/urls.js.map +1 -0
- package/lib/core/configurations/configuration.d.ts +64 -0
- package/lib/core/configurations/configuration.js +236 -0
- package/lib/core/configurations/configuration.js.map +1 -0
- package/lib/core/configurations/events/abstract-configuration-change-event.d.ts +6 -0
- package/lib/core/configurations/events/abstract-configuration-change-event.js +27 -0
- package/lib/core/configurations/events/abstract-configuration-change-event.js.map +1 -0
- package/lib/core/configurations/events/all-keys-configuration-change-event.d.ts +17 -0
- package/lib/core/configurations/events/all-keys-configuration-change-event.js +33 -0
- package/lib/core/configurations/events/all-keys-configuration-change-event.js.map +1 -0
- package/lib/core/configurations/events/configuration-change-event.d.ts +24 -0
- package/lib/core/configurations/events/configuration-change-event.js +84 -0
- package/lib/core/configurations/events/configuration-change-event.js.map +1 -0
- package/lib/core/configurations/events/index.d.ts +4 -0
- package/lib/core/configurations/events/index.js +21 -0
- package/lib/core/configurations/events/index.js.map +1 -0
- package/lib/core/configurations/events/organization-configuration-change-event.d.ts +15 -0
- package/lib/core/configurations/events/organization-configuration-change-event.js +39 -0
- package/lib/core/configurations/events/organization-configuration-change-event.js.map +1 -0
- package/lib/core/configurations/helpers/configuration.d.ts +26 -0
- package/lib/core/configurations/helpers/configuration.js +203 -0
- package/lib/core/configurations/helpers/configuration.js.map +1 -0
- package/lib/core/configurations/helpers/index.d.ts +1 -0
- package/lib/core/configurations/helpers/index.js +18 -0
- package/lib/core/configurations/helpers/index.js.map +1 -0
- package/lib/core/configurations/index.d.ts +4 -0
- package/lib/core/configurations/index.js +21 -0
- package/lib/core/configurations/index.js.map +1 -0
- package/lib/core/configurations/models/configuration-model.d.ts +24 -0
- package/lib/core/configurations/models/configuration-model.js +143 -0
- package/lib/core/configurations/models/configuration-model.js.map +1 -0
- package/lib/core/configurations/models/index.d.ts +1 -0
- package/lib/core/configurations/models/index.js +18 -0
- package/lib/core/configurations/models/index.js.map +1 -0
- package/lib/core/disposable.d.ts +28 -0
- package/lib/core/disposable.js +82 -0
- package/lib/core/disposable.js.map +1 -0
- package/lib/core/event.d.ts +76 -0
- package/lib/core/event.js +249 -0
- package/lib/core/event.js.map +1 -0
- package/lib/core/event.test.d.ts +1 -0
- package/lib/core/event.test.js +15 -0
- package/lib/core/event.test.js.map +1 -0
- package/lib/core/index.d.ts +6 -0
- package/lib/core/index.js +23 -0
- package/lib/core/index.js.map +1 -0
- package/lib/core/organization/configuration.d.ts +31 -0
- package/lib/core/organization/configuration.js +87 -0
- package/lib/core/organization/configuration.js.map +1 -0
- package/lib/core/organization/helpers/index.d.ts +1 -0
- package/lib/core/organization/helpers/index.js +18 -0
- package/lib/core/organization/helpers/index.js.map +1 -0
- package/lib/core/organization/helpers/organization-helpers.d.ts +6 -0
- package/lib/core/organization/helpers/organization-helpers.js +34 -0
- package/lib/core/organization/helpers/organization-helpers.js.map +1 -0
- package/lib/core/organization/index.d.ts +3 -0
- package/lib/core/organization/index.js +20 -0
- package/lib/core/organization/index.js.map +1 -0
- package/lib/core/organization/organization.d.ts +31 -0
- package/lib/core/organization/organization.js +135 -0
- package/lib/core/organization/organization.js.map +1 -0
- package/lib/core/path.d.ts +58 -0
- package/lib/core/path.js +189 -0
- package/lib/core/path.js.map +1 -0
- package/lib/core/path.test.d.ts +1 -0
- package/lib/core/path.test.js +205 -0
- package/lib/core/path.test.js.map +1 -0
- package/lib/core/types.d.ts +1 -0
- package/lib/core/types.js +3 -0
- package/lib/core/types.js.map +1 -0
- package/lib/core/uri.d.ts +68 -0
- package/lib/core/uri.js +158 -0
- package/lib/core/uri.js.map +1 -0
- package/lib/core/uri.test.d.ts +1 -0
- package/lib/core/uri.test.js +136 -0
- package/lib/core/uri.test.js.map +1 -0
- package/lib/enums/connection-status.d.ts +6 -0
- package/lib/enums/connection-status.js +11 -0
- package/lib/enums/connection-status.js.map +1 -0
- package/lib/enums/index.d.ts +7 -0
- package/lib/enums/index.js +24 -0
- package/lib/enums/index.js.map +1 -0
- package/lib/enums/integration-configuration-status.d.ts +5 -0
- package/lib/enums/integration-configuration-status.js +10 -0
- package/lib/enums/integration-configuration-status.js.map +1 -0
- package/lib/enums/integrations-configuration-steps.d.ts +8 -0
- package/lib/enums/integrations-configuration-steps.js +13 -0
- package/lib/enums/integrations-configuration-steps.js.map +1 -0
- package/lib/enums/integrations-connection-names.d.ts +11 -0
- package/lib/enums/integrations-connection-names.js +17 -0
- package/lib/enums/integrations-connection-names.js.map +1 -0
- package/lib/enums/integrations.d.ts +9 -0
- package/lib/enums/integrations.js +14 -0
- package/lib/enums/integrations.js.map +1 -0
- package/lib/enums/permissions.d.ts +7 -0
- package/lib/enums/permissions.js +12 -0
- package/lib/enums/permissions.js.map +1 -0
- package/lib/enums/team-member-status.d.ts +4 -0
- package/lib/enums/team-member-status.js +9 -0
- package/lib/enums/team-member-status.js.map +1 -0
- package/lib/errors/auth-error-messages.d.ts +25 -0
- package/lib/errors/auth-error-messages.js +31 -0
- package/lib/errors/auth-error-messages.js.map +1 -0
- package/lib/errors/auth-error.d.ts +8 -0
- package/lib/errors/auth-error.js +13 -0
- package/lib/errors/auth-error.js.map +1 -0
- package/lib/errors/index.d.ts +2 -0
- package/lib/errors/index.js +19 -0
- package/lib/errors/index.js.map +1 -0
- package/lib/index.d.ts +6 -0
- package/lib/index.js +23 -256
- package/lib/index.js.map +1 -1
- package/lib/interfaces/apollo-context.d.ts +48 -0
- package/lib/interfaces/apollo-context.js +3 -0
- package/lib/interfaces/apollo-context.js.map +1 -0
- package/lib/interfaces/common.d.ts +2 -2
- package/lib/interfaces/common.js +3 -0
- package/lib/interfaces/common.js.map +1 -0
- package/lib/interfaces/configuration/configuration-file-service.d.ts +5 -0
- package/lib/interfaces/configuration/configuration-file-service.js +3 -0
- package/lib/interfaces/configuration/configuration-file-service.js.map +1 -0
- package/lib/interfaces/configuration/configuration-server-service.d.ts +10 -0
- package/lib/interfaces/configuration/configuration-server-service.js +3 -0
- package/lib/interfaces/configuration/configuration-server-service.js.map +1 -0
- package/lib/interfaces/configuration/configuration.d.ts +39 -0
- package/lib/interfaces/configuration/configuration.js +53 -0
- package/lib/interfaces/configuration/configuration.js.map +1 -0
- package/lib/interfaces/configuration/configuraton-service.d.ts +60 -0
- package/lib/interfaces/configuration/configuraton-service.js +3 -0
- package/lib/interfaces/configuration/configuraton-service.js.map +1 -0
- package/lib/interfaces/configuration/event.d.ts +12 -0
- package/lib/interfaces/configuration/event.js +3 -0
- package/lib/interfaces/configuration/event.js.map +1 -0
- package/lib/interfaces/configuration/index.d.ts +5 -0
- package/lib/interfaces/configuration/index.js +22 -0
- package/lib/interfaces/configuration/index.js.map +1 -0
- package/lib/interfaces/contex-key-service.d.ts +2 -0
- package/lib/interfaces/contex-key-service.js +3 -0
- package/lib/interfaces/contex-key-service.js.map +1 -0
- package/lib/interfaces/database-migration.d.ts +8 -0
- package/lib/interfaces/database-migration.js +3 -0
- package/lib/interfaces/database-migration.js.map +1 -0
- package/lib/interfaces/enum.d.ts +26 -0
- package/lib/interfaces/enum.js +71 -0
- package/lib/interfaces/enum.js.map +1 -0
- package/lib/interfaces/environment/argv.d.ts +6 -0
- package/lib/interfaces/environment/argv.js +3 -0
- package/lib/interfaces/environment/argv.js.map +1 -0
- package/lib/interfaces/environment/environment-service.d.ts +7 -0
- package/lib/interfaces/environment/environment-service.js +3 -0
- package/lib/interfaces/environment/environment-service.js.map +1 -0
- package/lib/interfaces/environment/index.d.ts +2 -0
- package/lib/interfaces/environment/index.js +19 -0
- package/lib/interfaces/environment/index.js.map +1 -0
- package/lib/interfaces/generated/generated-models.d.ts +9198 -0
- package/lib/interfaces/generated/generated-models.js +3183 -0
- package/lib/interfaces/generated/generated-models.js.map +1 -0
- package/lib/interfaces/generated/index.d.ts +1 -0
- package/lib/interfaces/generated/index.js +18 -0
- package/lib/interfaces/generated/index.js.map +1 -0
- package/lib/interfaces/index.d.ts +16 -1
- package/lib/interfaces/index.js +34 -0
- package/lib/interfaces/index.js.map +1 -0
- package/lib/interfaces/lifecycle-service.d.ts +1 -0
- package/lib/interfaces/lifecycle-service.js +8 -0
- package/lib/interfaces/lifecycle-service.js.map +1 -0
- package/lib/interfaces/log/index.d.ts +1 -0
- package/lib/interfaces/log/index.js +18 -0
- package/lib/interfaces/log/index.js.map +1 -0
- package/lib/interfaces/log/log-service.d.ts +16 -0
- package/lib/interfaces/log/log-service.js +3 -0
- package/lib/interfaces/log/log-service.js.map +1 -0
- package/lib/interfaces/nav-items.d.ts +5 -0
- package/lib/interfaces/nav-items.js +3 -0
- package/lib/interfaces/nav-items.js.map +1 -0
- package/lib/interfaces/organization/index.d.ts +3 -0
- package/lib/interfaces/organization/index.js +20 -0
- package/lib/interfaces/organization/index.js.map +1 -0
- package/lib/interfaces/organization/organization-context-service.d.ts +65 -0
- package/lib/interfaces/organization/organization-context-service.js +3 -0
- package/lib/interfaces/organization/organization-context-service.js.map +1 -0
- package/lib/interfaces/organization/organization-context.d.ts +39 -0
- package/lib/interfaces/organization/organization-context.js +31 -0
- package/lib/interfaces/organization/organization-context.js.map +1 -0
- package/lib/interfaces/organization/organizations-context.d.ts +35 -0
- package/lib/interfaces/organization/organizations-context.js +3 -0
- package/lib/interfaces/organization/organizations-context.js.map +1 -0
- package/lib/interfaces/page-store.d.ts +16 -0
- package/lib/interfaces/page-store.js +3 -0
- package/lib/interfaces/page-store.js.map +1 -0
- package/lib/interfaces/permissions.d.ts +2 -0
- package/lib/interfaces/permissions.js +3 -0
- package/lib/interfaces/permissions.js.map +1 -0
- package/lib/interfaces/preferences-service.d.ts +40 -0
- package/lib/interfaces/preferences-service.js +3 -0
- package/lib/interfaces/preferences-service.js.map +1 -0
- package/lib/interfaces/service.d.ts +18 -0
- package/lib/interfaces/service.js +3 -0
- package/lib/interfaces/service.js.map +1 -0
- package/lib/interfaces/workbench-exports.d.ts +5 -0
- package/lib/interfaces/workbench-exports.js +6 -0
- package/lib/interfaces/workbench-exports.js.map +1 -0
- package/lib/modules/account-api/enums/index.d.ts +51 -0
- package/lib/modules/account-api/enums/index.js +56 -0
- package/lib/modules/account-api/enums/index.js.map +1 -0
- package/lib/modules/account-api/index.d.ts +1 -0
- package/lib/modules/account-api/index.js +18 -0
- package/lib/modules/account-api/index.js.map +1 -0
- package/lib/modules/billing-api/enums/index.d.ts +22 -0
- package/lib/modules/billing-api/enums/index.js +28 -0
- package/lib/modules/billing-api/enums/index.js.map +1 -0
- package/lib/modules/billing-api/index.d.ts +1 -0
- package/lib/modules/billing-api/index.js +18 -0
- package/lib/modules/billing-api/index.js.map +1 -0
- package/lib/modules/index.d.ts +2 -0
- package/lib/modules/index.js +19 -0
- package/lib/modules/index.js.map +1 -0
- package/lib/services/abstract-configuration.d.ts +54 -0
- package/lib/services/abstract-configuration.js +80 -0
- package/lib/services/abstract-configuration.js.map +1 -0
- package/lib/services/abstract-organization-context-service.d.ts +40 -0
- package/lib/services/abstract-organization-context-service.js +115 -0
- package/lib/services/abstract-organization-context-service.js.map +1 -0
- package/lib/services/index.d.ts +2 -0
- package/lib/services/index.js +19 -0
- package/lib/services/index.js.map +1 -0
- package/lib/utils/configuration-utils.d.ts +4 -0
- package/lib/utils/configuration-utils.js +15 -0
- package/lib/utils/configuration-utils.js.map +1 -0
- package/lib/utils/date-utils.d.ts +1 -0
- package/lib/utils/date-utils.js +9 -0
- package/lib/utils/date-utils.js.map +1 -0
- package/lib/utils/flatten-utils.d.ts +1 -0
- package/lib/utils/flatten-utils.js +20 -0
- package/lib/utils/flatten-utils.js.map +1 -0
- package/lib/utils/generate-uri.d.ts +35 -0
- package/lib/utils/generate-uri.js +50 -0
- package/lib/utils/generate-uri.js.map +1 -0
- package/lib/utils/generated-settings-id.d.ts +2 -0
- package/lib/utils/generated-settings-id.js +13 -0
- package/lib/utils/generated-settings-id.js.map +1 -0
- package/lib/utils/index.d.ts +9 -0
- package/lib/utils/index.js +26 -0
- package/lib/utils/index.js.map +1 -0
- package/lib/utils/omit-deep.d.ts +1 -0
- package/lib/utils/omit-deep.js +16 -0
- package/lib/utils/omit-deep.js.map +1 -0
- package/lib/utils/roles-utils.d.ts +2 -0
- package/lib/utils/roles-utils.js +11 -0
- package/lib/utils/roles-utils.js.map +1 -0
- package/lib/utils/uri.d.ts +3 -0
- package/lib/utils/uri.js +21 -0
- package/lib/utils/uri.js.map +1 -0
- package/lib/utils/utils.d.ts +3 -0
- package/lib/utils/utils.js +37 -0
- package/lib/utils/utils.js.map +1 -0
- package/lib/utils/validations.d.ts +1 -0
- package/lib/utils/validations.js +9 -0
- package/lib/utils/validations.js.map +1 -0
- package/package.json +34 -48
- package/lib/interfaces/workspace.d.ts +0 -159
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/modules/account-api/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAwB"}
|
@@ -0,0 +1,22 @@
|
|
1
|
+
export declare enum IBillingModules {
|
2
|
+
subscriptions = "subscriptions",
|
3
|
+
paymentMethods = "paymentMethods",
|
4
|
+
paymentProfile = "paymentProfile"
|
5
|
+
}
|
6
|
+
export declare enum IPreDefineBillingPermissions {
|
7
|
+
viewSubscriptions = "organization.billing.subscriptions.view",
|
8
|
+
createSubscriptions = "organization.billing.subscriptions.create",
|
9
|
+
editSubscriptions = "organization.billing.subscriptions.edit",
|
10
|
+
deleteSubscriptions = "organization.billing.subscriptions.delete",
|
11
|
+
manageSubscriptions = "organization.billing.subscriptions.manage",
|
12
|
+
viewPaymentMethods = "organization.billing.paymentMethods.view",
|
13
|
+
createPaymentMethods = "organization.billing.paymentMethods.create",
|
14
|
+
editPaymentMethods = "organization.billing.paymentMethods.edit",
|
15
|
+
deletePaymentMethods = "organization.billing.paymentMethods.delete",
|
16
|
+
managePaymentMethods = "organization.billing.paymentMethods.manage",
|
17
|
+
viewPaymentProfile = "billing.paymentProfile.view",
|
18
|
+
createPaymentProfile = "billing.paymentProfile.create",
|
19
|
+
editPaymentProfile = "billing.paymentProfile.edit",
|
20
|
+
deletePaymentProfile = "billing.paymentProfile.delete",
|
21
|
+
managePaymentProfile = "billing.paymentProfile.manage"
|
22
|
+
}
|
@@ -0,0 +1,28 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.IPreDefineBillingPermissions = exports.IBillingModules = void 0;
|
4
|
+
var IBillingModules;
|
5
|
+
(function (IBillingModules) {
|
6
|
+
IBillingModules["subscriptions"] = "subscriptions";
|
7
|
+
IBillingModules["paymentMethods"] = "paymentMethods";
|
8
|
+
IBillingModules["paymentProfile"] = "paymentProfile";
|
9
|
+
})(IBillingModules = exports.IBillingModules || (exports.IBillingModules = {}));
|
10
|
+
var IPreDefineBillingPermissions;
|
11
|
+
(function (IPreDefineBillingPermissions) {
|
12
|
+
IPreDefineBillingPermissions["viewSubscriptions"] = "organization.billing.subscriptions.view";
|
13
|
+
IPreDefineBillingPermissions["createSubscriptions"] = "organization.billing.subscriptions.create";
|
14
|
+
IPreDefineBillingPermissions["editSubscriptions"] = "organization.billing.subscriptions.edit";
|
15
|
+
IPreDefineBillingPermissions["deleteSubscriptions"] = "organization.billing.subscriptions.delete";
|
16
|
+
IPreDefineBillingPermissions["manageSubscriptions"] = "organization.billing.subscriptions.manage";
|
17
|
+
IPreDefineBillingPermissions["viewPaymentMethods"] = "organization.billing.paymentMethods.view";
|
18
|
+
IPreDefineBillingPermissions["createPaymentMethods"] = "organization.billing.paymentMethods.create";
|
19
|
+
IPreDefineBillingPermissions["editPaymentMethods"] = "organization.billing.paymentMethods.edit";
|
20
|
+
IPreDefineBillingPermissions["deletePaymentMethods"] = "organization.billing.paymentMethods.delete";
|
21
|
+
IPreDefineBillingPermissions["managePaymentMethods"] = "organization.billing.paymentMethods.manage";
|
22
|
+
IPreDefineBillingPermissions["viewPaymentProfile"] = "billing.paymentProfile.view";
|
23
|
+
IPreDefineBillingPermissions["createPaymentProfile"] = "billing.paymentProfile.create";
|
24
|
+
IPreDefineBillingPermissions["editPaymentProfile"] = "billing.paymentProfile.edit";
|
25
|
+
IPreDefineBillingPermissions["deletePaymentProfile"] = "billing.paymentProfile.delete";
|
26
|
+
IPreDefineBillingPermissions["managePaymentProfile"] = "billing.paymentProfile.manage";
|
27
|
+
})(IPreDefineBillingPermissions = exports.IPreDefineBillingPermissions || (exports.IPreDefineBillingPermissions = {}));
|
28
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/modules/billing-api/enums/index.ts"],"names":[],"mappings":";;;AAAA,IAAY,eAIX;AAJD,WAAY,eAAe;IACvB,kDAA8B,CAAA;IAC9B,oDAAiC,CAAA;IACjC,oDAAgC,CAAA;AACpC,CAAC,EAJW,eAAe,GAAf,uBAAe,KAAf,uBAAe,QAI1B;AAED,IAAY,4BAkBX;AAlBD,WAAY,4BAA4B;IACpC,6FAA4D,CAAA;IAC5D,iGAAgE,CAAA;IAChE,6FAA4D,CAAA;IAC5D,iGAAgE,CAAA;IAChE,iGAAgE,CAAA;IAEhE,+FAA8D,CAAA;IAC9D,mGAAkE,CAAA;IAClE,+FAA8D,CAAA;IAC9D,mGAAkE,CAAA;IAClE,mGAAkE,CAAA;IAElE,kFAAiD,CAAA;IACjD,sFAAqD,CAAA;IACrD,kFAAiD,CAAA;IACjD,sFAAqD,CAAA;IACrD,sFAAqD,CAAA;AACzD,CAAC,EAlBW,4BAA4B,GAA5B,oCAA4B,KAA5B,oCAA4B,QAkBvC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from './enums';
|
@@ -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("./enums"), exports);
|
18
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/modules/billing-api/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAwB"}
|
@@ -0,0 +1,19 @@
|
|
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("./account-api"), exports);
|
18
|
+
__exportStar(require("./billing-api"), exports);
|
19
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/modules/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA8B;AAC9B,gDAA8B"}
|
@@ -0,0 +1,54 @@
|
|
1
|
+
import { IClientConfigurationService, IConfigurationChangeEvent, IConfigurationOverrides, ConfigurationTarget, IConfigurationData, IConfigurationModel, IOrganizationResource, IIResourceData, IIConfigurationModel, IOrganizationContext } from '../interfaces';
|
2
|
+
import { IDisposable } from '@vscode-alt/monaco-editor/esm/vs/base/common/lifecycle';
|
3
|
+
import { Disposable } from '@workbench-stack/core';
|
4
|
+
import { OrganizationConfiguration as Configuration, ConfigurationModel } from '../core';
|
5
|
+
import { ResourceMap } from '@vscode-alt/monaco-editor/esm/vs/base/common/map';
|
6
|
+
import { URI } from '@vscode-alt/monaco-editor/esm/vs/base/common/uri';
|
7
|
+
import { CdmLogger } from '@cdm-logger/core';
|
8
|
+
import { Event, Emitter } from '@vscode-alt/monaco-editor/esm/vs/base/common/event';
|
9
|
+
declare type ILogger = CdmLogger.ILogger;
|
10
|
+
export declare abstract class AbstractOrganizationConfigurationClientService extends Disposable implements IClientConfigurationService, IDisposable {
|
11
|
+
protected _configuration: Configuration;
|
12
|
+
protected organization: IOrganizationContext;
|
13
|
+
protected logger: ILogger;
|
14
|
+
constructor(logger: ILogger);
|
15
|
+
protected readonly _onDidChangeConfiguration: Emitter<IConfigurationChangeEvent>;
|
16
|
+
readonly onDidChangeConfiguration: Event<IConfigurationChangeEvent>;
|
17
|
+
abstract initialize(organizationContext: any): any;
|
18
|
+
abstract loadResourceConfiguration(resources: IIResourceData[], force: any): any;
|
19
|
+
get configuration(): Configuration;
|
20
|
+
set configuration(configuration: Configuration);
|
21
|
+
getConfigurationData(): IConfigurationData;
|
22
|
+
getValue<T>(): T;
|
23
|
+
getValue<T>(section: string): T;
|
24
|
+
getValue<T>(overrides: IConfigurationOverrides): T;
|
25
|
+
getValue<T>(section: string, overrides: IConfigurationOverrides): T;
|
26
|
+
abstract updateValue(key: string, value: any): Promise<void>;
|
27
|
+
abstract updateValue(key: string, value: any, overrides: IConfigurationOverrides): Promise<void>;
|
28
|
+
abstract updateValue(key: string, value: any, target: ConfigurationTarget): Promise<void>;
|
29
|
+
abstract updateValue(key: string, value: any, overrides: IConfigurationOverrides, target: ConfigurationTarget): Promise<void>;
|
30
|
+
abstract updateValue(key: string, value: any, overrides: IConfigurationOverrides, target: ConfigurationTarget, donotNotifyError: boolean): Promise<void>;
|
31
|
+
abstract updateValue(key: string, value: any, arg3?: any, arg4?: any, donotNotifyError?: any): Promise<void>;
|
32
|
+
abstract reloadConfiguration(resource?: IOrganizationResource): Promise<void>;
|
33
|
+
abstract externalConfiguration?(resource: URI): IConfigurationModel;
|
34
|
+
inspect<T>(key: string, overrides?: IConfigurationOverrides): {
|
35
|
+
default: T;
|
36
|
+
user: T;
|
37
|
+
application?: T;
|
38
|
+
machine?: T;
|
39
|
+
organization?: T;
|
40
|
+
organizationResource?: T;
|
41
|
+
memory?: T;
|
42
|
+
value: T;
|
43
|
+
};
|
44
|
+
keys(): {
|
45
|
+
default: string[];
|
46
|
+
user: string[];
|
47
|
+
organization: string[];
|
48
|
+
organizationResource: string[];
|
49
|
+
};
|
50
|
+
extAcceptConfigurationChanged(data: IConfigurationData, event: IConfigurationChangeEvent): void;
|
51
|
+
static parse(data: IConfigurationData, organization: IOrganizationContext, previousConfiguration?: ConfigurationModel, prevResourceConfigurations?: ResourceMap<ConfigurationModel>): Configuration;
|
52
|
+
protected static parseConfigurationModel(model: IIConfigurationModel): ConfigurationModel;
|
53
|
+
}
|
54
|
+
export {};
|
@@ -0,0 +1,80 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
7
|
+
};
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
10
|
+
};
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
13
|
+
};
|
14
|
+
var AbstractOrganizationConfigurationClientService_1;
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
16
|
+
exports.AbstractOrganizationConfigurationClientService = void 0;
|
17
|
+
const inversify_1 = require("inversify");
|
18
|
+
const core_1 = require("@workbench-stack/core");
|
19
|
+
const core_2 = require("../core");
|
20
|
+
const map_1 = require("@vscode-alt/monaco-editor/esm/vs/base/common/map");
|
21
|
+
const uri_1 = require("@vscode-alt/monaco-editor/esm/vs/base/common/uri");
|
22
|
+
const event_1 = require("@vscode-alt/monaco-editor/esm/vs/base/common/event");
|
23
|
+
let AbstractOrganizationConfigurationClientService = AbstractOrganizationConfigurationClientService_1 = class AbstractOrganizationConfigurationClientService extends core_1.Disposable {
|
24
|
+
constructor(logger) {
|
25
|
+
super();
|
26
|
+
this._onDidChangeConfiguration = this._register(new event_1.Emitter());
|
27
|
+
this.onDidChangeConfiguration = this._onDidChangeConfiguration.event;
|
28
|
+
this.logger = logger.child({ className: 'OrganizationConfigurationClientService' });
|
29
|
+
}
|
30
|
+
get configuration() {
|
31
|
+
return this._configuration;
|
32
|
+
}
|
33
|
+
set configuration(configuration) {
|
34
|
+
this._configuration = configuration;
|
35
|
+
}
|
36
|
+
getConfigurationData() {
|
37
|
+
return this.configuration.toData();
|
38
|
+
}
|
39
|
+
getValue(arg1, arg2) {
|
40
|
+
const section = typeof arg1 === 'string' ? arg1 : undefined;
|
41
|
+
const overrides = (0, core_2.isConfigurationOverrides)(arg1) ? arg1 : (0, core_2.isConfigurationOverrides)(arg2) ? arg2 : {};
|
42
|
+
if (overrides === null || overrides === void 0 ? void 0 : overrides.externalResource) {
|
43
|
+
const externalConfiguration = this.externalConfiguration(overrides.externalResource);
|
44
|
+
return this.configuration.getValue(section, overrides, undefined, externalConfiguration);
|
45
|
+
}
|
46
|
+
return this.configuration.getValue(section, overrides);
|
47
|
+
}
|
48
|
+
inspect(key, overrides) {
|
49
|
+
return this.configuration.inspect(key, overrides);
|
50
|
+
}
|
51
|
+
keys() {
|
52
|
+
return this.configuration.keys();
|
53
|
+
}
|
54
|
+
extAcceptConfigurationChanged(data, event) {
|
55
|
+
this._configuration = AbstractOrganizationConfigurationClientService_1.parse(data, this.organization);
|
56
|
+
// this._confugrationScopes = data.configurationScopes;
|
57
|
+
this._onDidChangeConfiguration.fire(event);
|
58
|
+
}
|
59
|
+
static parse(data, organization, previousConfiguration, prevResourceConfigurations) {
|
60
|
+
const defaultConfiguration = AbstractOrganizationConfigurationClientService_1.parseConfigurationModel(data.defaults);
|
61
|
+
const userConfiguration = AbstractOrganizationConfigurationClientService_1.parseConfigurationModel(data.user);
|
62
|
+
const machineConfiguration = data.machine ? AbstractOrganizationConfigurationClientService_1.parseConfigurationModel(data.machine) : new core_2.ConfigurationModel();
|
63
|
+
const organizationConfiguration = AbstractOrganizationConfigurationClientService_1.parseConfigurationModel(data.organization);
|
64
|
+
const resources = Object.keys(data.resources).reduce((result, key) => {
|
65
|
+
result.set(uri_1.URI.parse(key), AbstractOrganizationConfigurationClientService_1.parseConfigurationModel(data.resources[key]));
|
66
|
+
return result;
|
67
|
+
}, new map_1.ResourceMap());
|
68
|
+
return new core_2.OrganizationConfiguration(defaultConfiguration, userConfiguration, machineConfiguration, organizationConfiguration, resources, previousConfiguration || new core_2.ConfigurationModel(), prevResourceConfigurations || new map_1.ResourceMap(), organization);
|
69
|
+
}
|
70
|
+
static parseConfigurationModel(model) {
|
71
|
+
return new core_2.ConfigurationModel(model.contents, model.keys, model.overrides).freeze();
|
72
|
+
}
|
73
|
+
};
|
74
|
+
AbstractOrganizationConfigurationClientService = AbstractOrganizationConfigurationClientService_1 = __decorate([
|
75
|
+
(0, inversify_1.injectable)(),
|
76
|
+
__param(0, (0, inversify_1.inject)('Logger')),
|
77
|
+
__metadata("design:paramtypes", [Object])
|
78
|
+
], AbstractOrganizationConfigurationClientService);
|
79
|
+
exports.AbstractOrganizationConfigurationClientService = AbstractOrganizationConfigurationClientService;
|
80
|
+
//# sourceMappingURL=abstract-configuration.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"abstract-configuration.js","sourceRoot":"","sources":["../../src/services/abstract-configuration.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yCAA+C;AAM/C,gDAAmD;AACnD,kCAAmH;AACnH,0EAA+E;AAC/E,0EAAuE;AAEvE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C,GAAG,CAAC,CAAC,CAAC,CAAC;YACxH,OAAO,MAAM,CAAC;QAClB,CAAC,EAAE,IAAI,iBAAW,EAAsB,CAAC,CAAC;QAC1C,OAAO,IAAI,gCAAa,CACpB,oBAAoB,EACpB,iBAAiB,EACjB,oBAAoB,EACpB,yBAAyB,EACzB,SAAS,EACT,qBAAqB,IAAI,IAAI,yBAAkB,EAAE,EACjD,0BAA0B,IAAI,IAAI,iBAAW,EAAsB,EACnE,YAAY,CACf,CAAC;IACN,CAAC;IAES,MAAM,CAAC,uBAAuB,CAAC,KAA2B;QAChE,OAAO,IAAI,yBAAkB,CAAC,KAAK,CAAC,QAAQ,EAAE,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC,MAAM,EAAE,CAAC;IACxF,CAAC;CACJ,CAAA;AA7GqB,8CAA8C;IADnE,IAAA,sBAAU,GAAE;IAQJ,WAAA,IAAA,kBAAM,EAAC,QAAQ,CAAC,CAAA;;GAPH,8CAA8C,CA6GnE;AA7GqB,wGAA8C"}
|
@@ -0,0 +1,40 @@
|
|
1
|
+
import { URI } from '@vscode-alt/monaco-editor/esm/vs/base/common/uri';
|
2
|
+
import { Event, Emitter } from '@vscode-alt/monaco-editor/esm/vs/base/common/event';
|
3
|
+
import { Disposable } from '@workbench-stack/core';
|
4
|
+
import { Barrier } from '@vscode-alt/monaco-editor/esm/vs/base/common/async';
|
5
|
+
import { CdmLogger } from '@cdm-logger/core';
|
6
|
+
import { OrganizationContext } from '../core';
|
7
|
+
import { IConfigurationChangeEvent, IOrganizationIdentifier, IOrganizationData, IClientOrganizationContextService, ApplicationState, IOrganizationResource, IOrganizationResourceCreationData, IOrganizationResourcesChangeEvent, ISingleResourceOrganizationIdentifier } from '../interfaces';
|
8
|
+
declare type ILogger = CdmLogger.ILogger;
|
9
|
+
export declare abstract class AbstractOrganizationContextService extends Disposable implements IClientOrganizationContextService {
|
10
|
+
protected organizationContext: OrganizationContext;
|
11
|
+
protected completeOrganizationBarrier: Barrier;
|
12
|
+
protected updateOrganizationBarrier: Barrier;
|
13
|
+
protected logger: ILogger;
|
14
|
+
protected readonly _onDidChangeConfiguration: Emitter<IConfigurationChangeEvent>;
|
15
|
+
readonly onDidChangeConfiguration: Event<IConfigurationChangeEvent>;
|
16
|
+
protected readonly _onDidChangeOrganizationResources: Emitter<IOrganizationResourcesChangeEvent>;
|
17
|
+
readonly onDidChangeOrganizationResources: Event<IOrganizationResourcesChangeEvent>;
|
18
|
+
protected readonly _onDidChangeOrganizationName: Emitter<string>;
|
19
|
+
readonly onDidChangeOrganizationName: Event<string>;
|
20
|
+
protected readonly _onDidChangeApplicationState: Emitter<ApplicationState>;
|
21
|
+
readonly onDidChangeApplicationState: Event<ApplicationState>;
|
22
|
+
constructor(logger: ILogger);
|
23
|
+
abstract initialize(args: any): any;
|
24
|
+
getCompleteOrganization(): Promise<OrganizationContext>;
|
25
|
+
getOrganization(): OrganizationContext;
|
26
|
+
getApplicationState(): ApplicationState;
|
27
|
+
getOrganizationResource(resource: URI): IOrganizationResource | null;
|
28
|
+
abstract addResources(resourcesToAdd: IOrganizationResourceCreationData[], index?: number): Promise<void>;
|
29
|
+
abstract removeResources(resourcesToRemove: URI[]): Promise<void>;
|
30
|
+
abstract updateResources(resourcesToAdd: IOrganizationResourceCreationData[], resourcesToRemove: URI[], index?: number): Promise<void>;
|
31
|
+
isInsideOrganization(resource: URI): boolean;
|
32
|
+
isCurrentOrganization(organizationIdentifier: ISingleResourceOrganizationIdentifier | IOrganizationIdentifier): boolean;
|
33
|
+
extAcceptChangedApplicationState(organizationContext: IOrganizationData, event: ApplicationState): void;
|
34
|
+
extAcceptChangedOrganizationResources(organizationContext: IOrganizationData, event: IOrganizationResourcesChangeEvent): void;
|
35
|
+
extAcceptChangedOrganizationName(organizationContext: IOrganizationData): void;
|
36
|
+
protected releaseOrganizationBarrier(): void;
|
37
|
+
protected releaseUpdateOrganizationBarrier(): void;
|
38
|
+
protected reviveOrganizationUris(organizationData: IOrganizationData): OrganizationContext;
|
39
|
+
}
|
40
|
+
export {};
|
@@ -0,0 +1,115 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
7
|
+
};
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
10
|
+
};
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
13
|
+
};
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
15
|
+
exports.AbstractOrganizationContextService = void 0;
|
16
|
+
const uri_1 = require("@vscode-alt/monaco-editor/esm/vs/base/common/uri");
|
17
|
+
const event_1 = require("@vscode-alt/monaco-editor/esm/vs/base/common/event");
|
18
|
+
// import { Disposable } from '@vscode-alt/monaco-editor/esm/vs/base/common/lifecycle';
|
19
|
+
const core_1 = require("@workbench-stack/core");
|
20
|
+
const async_1 = require("@vscode-alt/monaco-editor/esm/vs/base/common/async");
|
21
|
+
const inversify_1 = require("inversify");
|
22
|
+
const core_2 = require("../core");
|
23
|
+
const core_3 = require("@common-stack/core");
|
24
|
+
const resources_1 = require("@vscode-alt/monaco-editor/esm/vs/base/common/resources");
|
25
|
+
const helpers_1 = require("../core/organization/helpers");
|
26
|
+
let AbstractOrganizationContextService = class AbstractOrganizationContextService extends core_1.Disposable {
|
27
|
+
constructor(logger) {
|
28
|
+
super();
|
29
|
+
this._onDidChangeConfiguration = this._register(new event_1.Emitter());
|
30
|
+
this.onDidChangeConfiguration = this._onDidChangeConfiguration.event;
|
31
|
+
this._onDidChangeOrganizationResources = this._register(new event_1.Emitter());
|
32
|
+
this.onDidChangeOrganizationResources = this._onDidChangeOrganizationResources.event;
|
33
|
+
this._onDidChangeOrganizationName = this._register(new event_1.Emitter());
|
34
|
+
this.onDidChangeOrganizationName = this._onDidChangeOrganizationName.event;
|
35
|
+
this._onDidChangeApplicationState = this._register(new event_1.Emitter());
|
36
|
+
this.onDidChangeApplicationState = this._onDidChangeApplicationState.event;
|
37
|
+
this.logger = logger.child({ className: 'AbstractOrganizationService' });
|
38
|
+
this.completeOrganizationBarrier = new async_1.Barrier();
|
39
|
+
}
|
40
|
+
getCompleteOrganization() {
|
41
|
+
return this.completeOrganizationBarrier.wait().then(() => this.getOrganization());
|
42
|
+
}
|
43
|
+
getOrganization() {
|
44
|
+
return this.organizationContext;
|
45
|
+
}
|
46
|
+
getApplicationState() {
|
47
|
+
// OrganizationContext has configuration file
|
48
|
+
if (this.organizationContext.configuration) {
|
49
|
+
return 3 /* ApplicationState.ORGANIZATION */;
|
50
|
+
}
|
51
|
+
// Resource has single root
|
52
|
+
if (this.organizationContext.resources.length === 1) {
|
53
|
+
return 2 /* ApplicationState.RESOURCE */;
|
54
|
+
}
|
55
|
+
// Empty
|
56
|
+
return 1 /* ApplicationState.EMPTY */;
|
57
|
+
}
|
58
|
+
getOrganizationResource(resource) {
|
59
|
+
return this.organizationContext.getResource(resource);
|
60
|
+
}
|
61
|
+
isInsideOrganization(resource) {
|
62
|
+
return !!this.getOrganizationResource(resource);
|
63
|
+
}
|
64
|
+
isCurrentOrganization(organizationIdentifier) {
|
65
|
+
switch (this.getApplicationState()) {
|
66
|
+
case 2 /* ApplicationState.RESOURCE */:
|
67
|
+
return (0, helpers_1.isSingleResourceOrganizationIdentifier)(organizationIdentifier) && (0, resources_1.isEqual)(organizationIdentifier, this.organizationContext.resources[0].uri);
|
68
|
+
case 3 /* ApplicationState.ORGANIZATION */:
|
69
|
+
return (0, helpers_1.isOrganizationIdentifier)(organizationIdentifier) && this.organizationContext.id === organizationIdentifier.id;
|
70
|
+
}
|
71
|
+
return false;
|
72
|
+
}
|
73
|
+
extAcceptChangedApplicationState(organizationContext, event) {
|
74
|
+
this.organizationContext = this.reviveOrganizationUris(organizationContext);
|
75
|
+
this._onDidChangeApplicationState.fire(event);
|
76
|
+
this.releaseUpdateOrganizationBarrier();
|
77
|
+
}
|
78
|
+
extAcceptChangedOrganizationResources(organizationContext, event) {
|
79
|
+
this.organizationContext = this.reviveOrganizationUris(organizationContext);
|
80
|
+
this._onDidChangeOrganizationResources.fire(event);
|
81
|
+
this.releaseUpdateOrganizationBarrier();
|
82
|
+
}
|
83
|
+
extAcceptChangedOrganizationName(organizationContext) {
|
84
|
+
this.organizationContext = this.reviveOrganizationUris(organizationContext);
|
85
|
+
this._onDidChangeOrganizationName.fire(organizationContext.name);
|
86
|
+
this.releaseUpdateOrganizationBarrier();
|
87
|
+
}
|
88
|
+
releaseOrganizationBarrier() {
|
89
|
+
if (!this.completeOrganizationBarrier.isOpen()) {
|
90
|
+
this.completeOrganizationBarrier.open();
|
91
|
+
}
|
92
|
+
}
|
93
|
+
releaseUpdateOrganizationBarrier() {
|
94
|
+
if (this.updateOrganizationBarrier && !this.updateOrganizationBarrier.isOpen()) {
|
95
|
+
this.updateOrganizationBarrier.open();
|
96
|
+
}
|
97
|
+
}
|
98
|
+
reviveOrganizationUris(organizationData) {
|
99
|
+
let organizationContext, organizationResources;
|
100
|
+
if (organizationData.resources) {
|
101
|
+
organizationResources = organizationData.resources.map(({ index, uri: uriComponent, name }) => (new core_2.OrganizationResource({ index, uri: uri_1.URI.revive(uriComponent), name })));
|
102
|
+
}
|
103
|
+
if (organizationData.configuration) {
|
104
|
+
organizationContext = uri_1.URI.revive(organizationData.configuration);
|
105
|
+
}
|
106
|
+
return new core_2.OrganizationContext(organizationData.id, organizationResources, organizationContext);
|
107
|
+
}
|
108
|
+
};
|
109
|
+
AbstractOrganizationContextService = __decorate([
|
110
|
+
(0, inversify_1.injectable)(),
|
111
|
+
__param(0, (0, inversify_1.inject)(core_3.CommonType.LOGGER)),
|
112
|
+
__metadata("design:paramtypes", [Object])
|
113
|
+
], AbstractOrganizationContextService);
|
114
|
+
exports.AbstractOrganizationContextService = AbstractOrganizationContextService;
|
115
|
+
//# sourceMappingURL=abstract-organization-context-service.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"abstract-organization-context-service.js","sourceRoot":"","sources":["../../src/services/abstract-organization-context-service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,0EAAuE;AACvE,8EAAoF;AACpF,uFAAuF;AACvF,gDAAmD;AACnD,8EAAoF;AAEpF,yCAA+C;AAC/C,kCAAmF;AACnF,6CAAgD;AAMhD,sFAA6H;AAC7H,0DAAgH;AAKzG,IAAe,kCAAkC,GAAjD,MAAe,kCAAmC,SAAQ,iBAAU;IAqBvE,YAEI,MAAe;QAEf,KAAK,EAAE,CAAC;QAjBO,8BAAyB,GAAuC,IAAI,CAAC,SAAS,CAAC,IAAI,eAAO,EAA6B,CAAC,CAAC;QAC5H,6BAAwB,GAAqC,IAAI,CAAC,yBAAyB,CAAC,KAAK,CAAC;QAE/F,sCAAiC,GAA+C,IAAI,CAAC,SAAS,CAAC,IAAI,eAAO,EAAqC,CAAC,CAAC;QACpJ,qCAAgC,GAA6C,IAAI,CAAC,iCAAiC,CAAC,KAAK,CAAC;QAEvH,iCAA4B,GAAoB,IAAI,CAAC,SAAS,CAAC,IAAI,eAAO,EAAU,CAAC,CAAC;QACzF,gCAA2B,GAAkB,IAAI,CAAC,4BAA4B,CAAC,KAAK,CAAC;QAElF,iCAA4B,GAA8B,IAAI,CAAC,SAAS,CAAC,IAAI,eAAO,EAAoB,CAAC,CAAC;QAC7G,gCAA2B,GAA4B,IAAI,CAAC,4BAA4B,CAAC,KAAK,C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C,EAAE,KAAK,EAAE,GAAG,EAAE,YAAY,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,CAC3F,IAAI,2BAAoB,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,SAAG,CAAC,MAAM,CAAC,YAAY,CAAC,EAAE,IAAI,EAAE,CAAC,CAC3E,CAAC,CAAC;SACN;QAED,IAAI,gBAAgB,CAAC,aAAa,EAAE;YAChC,mBAAmB,GAAG,SAAG,CAAC,MAAM,CAAC,gBAAgB,CAAC,aAAa,CAAC,CAAC;SACpE;QACD,OAAO,IAAI,0BAAmB,CAAC,gBAAgB,CAAC,EAAE,EAAE,qBAAqB,EAAE,mBAAmB,CAAC,CAAC;IACpG,CAAC;CAEJ,CAAA;AA1HqB,kCAAkC;IADvD,IAAA,sBAAU,GAAE;IAuBJ,WAAA,IAAA,kBAAM,EAAC,iBAAU,CAAC,MAAM,CAAC,CAAA;;GAtBZ,kCAAkC,CA0HvD;AA1HqB,gFAAkC"}
|
@@ -0,0 +1,19 @@
|
|
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("./abstract-organization-context-service"), exports);
|
18
|
+
__exportStar(require("./abstract-configuration"), exports);
|
19
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/services/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0EAAwD;AACxD,2DAAyC"}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.getScopes = void 0;
|
4
|
+
function getScopes(configurationRegistry) {
|
5
|
+
const scopes = {};
|
6
|
+
const configurationProperties = configurationRegistry.getConfigurationProperties();
|
7
|
+
for (const key of Object.keys(configurationProperties)) {
|
8
|
+
scopes[key] = configurationProperties[key].scope;
|
9
|
+
}
|
10
|
+
scopes['launch'] = 4 /* ConfigurationScope.RESOURCE */;
|
11
|
+
scopes['task'] = 4 /* ConfigurationScope.RESOURCE */;
|
12
|
+
return scopes;
|
13
|
+
}
|
14
|
+
exports.getScopes = getScopes;
|
15
|
+
//# sourceMappingURL=configuration-utils.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"configuration-utils.js","sourceRoot":"","sources":["../../src/utils/configuration-utils.ts"],"names":[],"mappings":";;;AAGA,SAAgB,SAAS,CAAC,qBAA6C;IACnE,MAAM,MAAM,GAAG,EAAE,CAAC;IAClB,MAAM,uBAAuB,GAAG,qBAAqB,CAAC,0BAA0B,EAAE,CAAC;IACnF,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,uBAAuB,CAAC,EAAE;QACpD,MAAM,CAAC,GAAG,CAAC,GAAG,uBAAuB,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC;KACpD;IACD,MAAM,CAAC,QAAQ,CAAC,sCAA8B,CAAC;IAC/C,MAAM,CAAC,MAAM,CAAC,sCAA8B,CAAC;IAC7C,OAAO,MAAM,CAAC;AAClB,CAAC;AATD,8BASC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare const toMilliSeconds: (value: number | string) => number;
|
@@ -0,0 +1,9 @@
|
|
1
|
+
"use strict";
|
2
|
+
// converrts seconds to to milliseconds
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
+
exports.toMilliSeconds = void 0;
|
5
|
+
const toMilliSeconds = (value) => {
|
6
|
+
return Number(value) * 1000;
|
7
|
+
};
|
8
|
+
exports.toMilliSeconds = toMilliSeconds;
|
9
|
+
//# sourceMappingURL=date-utils.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"date-utils.js","sourceRoot":"","sources":["../../src/utils/date-utils.ts"],"names":[],"mappings":";AAAA,uCAAuC;;;AAEhC,MAAM,cAAc,GAAG,CAAC,KAAsB,EAAU,EAAE;IAC/D,OAAO,MAAM,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC;AAC9B,CAAC,CAAA;AAFY,QAAA,cAAc,kBAE1B"}
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare function flatten<T extends Record<string, any>>(object: T, path?: string | null, separator?: string): T;
|
@@ -0,0 +1,20 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.flatten = void 0;
|
4
|
+
function flatten(object, path = null, separator = '.') {
|
5
|
+
return Object.keys(object).reduce((acc, key) => {
|
6
|
+
const value = object[key];
|
7
|
+
const newPath = [path, key].filter(Boolean).join(separator);
|
8
|
+
const isObject = [
|
9
|
+
typeof value === 'object',
|
10
|
+
value !== null,
|
11
|
+
!(value instanceof Date),
|
12
|
+
!(value instanceof RegExp),
|
13
|
+
!(Array.isArray(value) && value.length === 0),
|
14
|
+
].every(Boolean);
|
15
|
+
return isObject
|
16
|
+
? Object.assign(Object.assign({}, acc), flatten(value, newPath, separator)) : Object.assign(Object.assign({}, acc), { [newPath]: value });
|
17
|
+
}, {});
|
18
|
+
}
|
19
|
+
exports.flatten = flatten;
|
20
|
+
//# sourceMappingURL=flatten-utils.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"flatten-utils.js","sourceRoot":"","sources":["../../src/utils/flatten-utils.ts"],"names":[],"mappings":";;;AAEA,SAAgB,OAAO,CACnB,MAAS,EACT,OAAsB,IAAI,EAC1B,SAAS,GAAG,GAAG;IAEf,OAAO,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC,GAAM,EAAE,GAAW,EAAK,EAAE;QAC3D,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;QAE1B,MAAM,OAAO,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAE5D,MAAM,QAAQ,GAAG;YACf,OAAO,KAAK,KAAK,QAAQ;YACzB,KAAK,KAAK,IAAI;YACd,CAAC,CAAC,KAAK,YAAY,IAAI,CAAC;YACxB,CAAC,CAAC,KAAK,YAAY,MAAM,CAAC;YAC1B,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,CAAC;SAC9C,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAEjB,OAAO,QAAQ;YACb,CAAC,iCAAM,GAAG,GAAK,OAAO,CAAC,KAAK,EAAE,OAAO,EAAE,SAAS,CAAC,EACjD,CAAC,iCAAM,GAAG,KAAE,CAAC,OAAO,CAAC,EAAE,KAAK,GAAE,CAAC;IACnC,CAAC,EAAE,EAAO,CAAC,CAAC;AACd,CAAC;AAtBH,0BAsBG"}
|
@@ -0,0 +1,35 @@
|
|
1
|
+
import { URI } from '@vscode-alt/monaco-editor/esm/vs/base/common/uri';
|
2
|
+
import { IConfigCollectionName, IConfigFragmentName } from '../interfaces';
|
3
|
+
/**
|
4
|
+
* Generate URI, it sorts the params in order to generate URI.
|
5
|
+
* @param collectionName Schema Name to be used
|
6
|
+
* @param params Params to use as query
|
7
|
+
* @param fragment
|
8
|
+
* @param authority
|
9
|
+
*/
|
10
|
+
export declare const generateUri: (collectionName: IConfigCollectionName, params: {
|
11
|
+
[key: string]: any;
|
12
|
+
}, fragment: string, authority?: string, options?: {
|
13
|
+
flatten: boolean;
|
14
|
+
}) => URI;
|
15
|
+
/**
|
16
|
+
* Generates URI for User with `_id` as `self` if the user logged in otherwise `guest`
|
17
|
+
*/
|
18
|
+
export declare const generateProxyUserUri: (userProxyId: 'self' | 'guest', fragment?: IConfigFragmentName, authority?: string) => URI;
|
19
|
+
/**
|
20
|
+
* Generates URI for User with `_id` as `self` if the user logged in otherwise `guest`
|
21
|
+
*/
|
22
|
+
export declare const generateUserUri: (params: {
|
23
|
+
[key: string]: any;
|
24
|
+
}, fragment?: IConfigFragmentName, authority?: string) => URI;
|
25
|
+
/**
|
26
|
+
* Generates URI for Application
|
27
|
+
*/
|
28
|
+
export declare const generateApplicationUri: (orgName: string, fragment?: IConfigFragmentName, authority?: string) => URI;
|
29
|
+
export declare const generateResourceUri: (collectionName: IConfigCollectionName, params: {
|
30
|
+
[key: string]: any;
|
31
|
+
name: string;
|
32
|
+
orgName: string;
|
33
|
+
}, fragment: string, authority?: string) => URI;
|
34
|
+
export declare const generateOrgUri: (name: any, fragment: string, authority?: string) => URI;
|
35
|
+
export declare const generateMachineUri: (name: any, fragment: string, authority?: string) => URI;
|
@@ -0,0 +1,50 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.generateMachineUri = exports.generateOrgUri = exports.generateResourceUri = exports.generateApplicationUri = exports.generateUserUri = exports.generateProxyUserUri = exports.generateUri = void 0;
|
4
|
+
const core_1 = require("@workbench-stack/core");
|
5
|
+
const uri_1 = require("@vscode-alt/monaco-editor/esm/vs/base/common/uri");
|
6
|
+
const interfaces_1 = require("../interfaces");
|
7
|
+
const flatten_utils_1 = require("./flatten-utils");
|
8
|
+
const sortKeys = require('sort-keys');
|
9
|
+
const querystring = require('querystring');
|
10
|
+
/**
|
11
|
+
* Generate URI, it sorts the params in order to generate URI.
|
12
|
+
* @param collectionName Schema Name to be used
|
13
|
+
* @param params Params to use as query
|
14
|
+
* @param fragment
|
15
|
+
* @param authority
|
16
|
+
*/
|
17
|
+
const generateUri = (collectionName, params, fragment, authority = '', options = { flatten: false }) => {
|
18
|
+
params = options.flatten ? (0, flatten_utils_1.flatten)(params) : params;
|
19
|
+
const orderedParams = sortKeys(params);
|
20
|
+
const queryString = querystring.stringify(orderedParams);
|
21
|
+
return uri_1.URI.file(`/${collectionName}`).with({
|
22
|
+
scheme: core_1.Schemas.mongoDbFile,
|
23
|
+
authority,
|
24
|
+
fragment,
|
25
|
+
query: queryString,
|
26
|
+
});
|
27
|
+
};
|
28
|
+
exports.generateUri = generateUri;
|
29
|
+
/**
|
30
|
+
* Generates URI for User with `_id` as `self` if the user logged in otherwise `guest`
|
31
|
+
*/
|
32
|
+
const generateProxyUserUri = (userProxyId, fragment = interfaces_1.IConfigFragmentName.Settings, authority = '') => (0, exports.generateUri)(interfaces_1.IConfigCollectionName.Accounts, { _id: userProxyId }, fragment, authority);
|
33
|
+
exports.generateProxyUserUri = generateProxyUserUri;
|
34
|
+
/**
|
35
|
+
* Generates URI for User with `_id` as `self` if the user logged in otherwise `guest`
|
36
|
+
*/
|
37
|
+
const generateUserUri = (params, fragment = interfaces_1.IConfigFragmentName.Settings, authority = '') => (0, exports.generateUri)(interfaces_1.IConfigCollectionName.Accounts, params, fragment, authority);
|
38
|
+
exports.generateUserUri = generateUserUri;
|
39
|
+
/**
|
40
|
+
* Generates URI for Application
|
41
|
+
*/
|
42
|
+
const generateApplicationUri = (orgName, fragment = interfaces_1.IConfigFragmentName.Settings, authority = '') => (0, exports.generateUri)(interfaces_1.IConfigCollectionName.Organizations, { orgName }, fragment, authority);
|
43
|
+
exports.generateApplicationUri = generateApplicationUri;
|
44
|
+
const generateResourceUri = (collectionName, params, fragment, authority = '') => (0, exports.generateUri)(collectionName, params, fragment, authority);
|
45
|
+
exports.generateResourceUri = generateResourceUri;
|
46
|
+
const generateOrgUri = (name, fragment, authority = '') => (0, exports.generateUri)(interfaces_1.IConfigCollectionName.Organizations, { name }, fragment, authority);
|
47
|
+
exports.generateOrgUri = generateOrgUri;
|
48
|
+
const generateMachineUri = (name, fragment, authority = '') => (0, exports.generateUri)(interfaces_1.IConfigCollectionName.Machines, { name }, fragment, authority);
|
49
|
+
exports.generateMachineUri = generateMachineUri;
|
50
|
+
//# sourceMappingURL=generate-uri.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"generate-uri.js","sourceRoot":"","sources":["../../src/utils/generate-uri.ts"],"names":[],"mappings":";;;AAAA,gDAAgD;AAChD,0EAAuE;AACvE,8CAA2E;AAC3E,mDAA0C;AAE1C,MAAM,QAAQ,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;AAEtC,MAAM,WAAW,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;AAE3C;;;;;;GAMG;AACI,MAAM,WAAW,GAAG,CACvB,cAAqC,EACrC,MAA8B,EAC9B,QAAgB,EAChB,SAAS,GAAG,EAAE,EACd,OAAO,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE,EAC9B,EAAE;IACA,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,IAAA,uBAAO,EAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;IACpD,MAAM,aAAa,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC;IACvC,MAAM,WAAW,GAAG,WAAW,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC;IAEzD,OAAO,SAAG,CAAC,IAAI,CAAC,IAAI,cAAc,EAAE,CAAC,CAAC,IAAI,CAAC;QACvC,MAAM,EAAE,cAAO,CAAC,WAAW;QAC3B,SAAS;QACT,QAAQ;QACR,KAAK,EAAE,WAAW;KACrB,CAAC,CAAC;AACP,CAAC,CAAC;AAjBW,QAAA,WAAW,eAiBtB;AAEF;;G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