@adobe/ccweb-add-on-analytics 3.0.0 → 3.2.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/.c8rc.json +4 -0
- package/dist/app/AnalyticsConsent.d.ts +16 -2
- package/dist/app/AnalyticsConsent.d.ts.map +1 -1
- package/dist/app/AnalyticsConsent.js +89 -1
- package/dist/app/AnalyticsService.d.ts +15 -3
- package/dist/app/AnalyticsService.d.ts.map +1 -1
- package/dist/app/AnalyticsService.js +88 -1
- package/dist/app/index.d.ts +0 -2
- package/dist/app/index.d.ts.map +1 -1
- package/dist/app/index.js +0 -2
- package/dist/base/BaseCommand.d.ts +6 -5
- package/dist/base/BaseCommand.d.ts.map +1 -1
- package/dist/config/inversify.config.d.ts +1 -1
- package/dist/config/inversify.config.d.ts.map +1 -1
- package/dist/config/inversify.config.js +4 -3
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +5 -5
- package/src/app/AnalyticsConsent.ts +84 -4
- package/src/app/AnalyticsService.ts +74 -6
- package/src/app/index.ts +0 -2
- package/src/base/BaseCommand.ts +6 -5
- package/src/config/inversify.config.ts +5 -5
- package/src/test/app/{WxpAnalyticsConsent.spec.ts → AnalyticsConsent.spec.ts} +13 -14
- package/src/test/app/{WxpAnalyticsService.spec.ts → AnalyticsService.spec.ts} +12 -13
- package/src/test/models/CLIProgram.spec.ts +1 -1
- package/dist/app/WxpAnalyticsConsent.d.ts +0 -54
- package/dist/app/WxpAnalyticsConsent.d.ts.map +0 -1
- package/dist/app/WxpAnalyticsConsent.js +0 -113
- package/dist/app/WxpAnalyticsService.d.ts +0 -60
- package/dist/app/WxpAnalyticsService.d.ts.map +0 -1
- package/dist/app/WxpAnalyticsService.js +0 -112
- package/src/app/WxpAnalyticsConsent.ts +0 -119
- package/src/app/WxpAnalyticsService.ts +0 -120
package/.c8rc.json
CHANGED
|
@@ -21,11 +21,23 @@
|
|
|
21
21
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
22
|
* SOFTWARE.
|
|
23
23
|
********************************************************************************/
|
|
24
|
+
import type { Logger } from "@adobe/ccweb-add-on-core";
|
|
25
|
+
import { UserPreferences } from "@adobe/ccweb-add-on-core";
|
|
26
|
+
import "reflect-metadata";
|
|
24
27
|
/**
|
|
25
|
-
*
|
|
28
|
+
* Implementation class to get and set user's consent
|
|
26
29
|
* on allowing the application to collect and send analytics to Adobe.
|
|
27
30
|
*/
|
|
28
|
-
export
|
|
31
|
+
export declare class AnalyticsConsent {
|
|
32
|
+
private readonly _preferences;
|
|
33
|
+
private readonly _logger;
|
|
34
|
+
/**
|
|
35
|
+
* Instantiate {@link AnalyticsConsent}.
|
|
36
|
+
* @param preferences - {@link UserPreferences} reference.
|
|
37
|
+
* @param logger - {@link Logger} reference.
|
|
38
|
+
* @returns Reference to a new {@link AnalyticsConsent} instance.
|
|
39
|
+
*/
|
|
40
|
+
constructor(preferences: UserPreferences, logger: Logger);
|
|
29
41
|
/**
|
|
30
42
|
* Get user consent to collect and send analytics to Adobe.
|
|
31
43
|
* @returns Promise of boolean value representing whether the user has provided consent.
|
|
@@ -36,5 +48,7 @@ export interface AnalyticsConsent {
|
|
|
36
48
|
* @param consent - Boolean value representing whether the user has provided consent.
|
|
37
49
|
*/
|
|
38
50
|
set(consent: boolean): Promise<void>;
|
|
51
|
+
private _promptMessage;
|
|
52
|
+
private _promptMessageOption;
|
|
39
53
|
}
|
|
40
54
|
//# sourceMappingURL=AnalyticsConsent.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AnalyticsConsent.d.ts","sourceRoot":"","sources":["../../src/app/AnalyticsConsent.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;kFAsBkF;AAElF;;;GAGG;AACH,
|
|
1
|
+
{"version":3,"file":"AnalyticsConsent.d.ts","sourceRoot":"","sources":["../../src/app/AnalyticsConsent.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;kFAsBkF;AAElF,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAwB,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAIjF,OAAO,kBAAkB,CAAC;AAE1B;;;GAGG;AACH,qBACa,gBAAgB;IACzB,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAkB;IAC/C,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IAEjC;;;;;OAKG;gBAEqC,WAAW,EAAE,eAAe,EACrC,MAAM,EAAE,MAAM;IAM7C;;;OAGG;IACG,GAAG,IAAI,OAAO,CAAC,OAAO,CAAC;IAqC7B;;;OAGG;IACG,GAAG,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAM1C,OAAO,CAAC,cAAc;IAItB,OAAO,CAAC,oBAAoB;CAG/B"}
|
|
@@ -21,5 +21,93 @@
|
|
|
21
21
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
22
|
* SOFTWARE.
|
|
23
23
|
********************************************************************************/
|
|
24
|
-
|
|
24
|
+
import { __decorate, __metadata, __param } from "tslib";
|
|
25
|
+
import { ITypes as ICoreTypes, UserPreferences } from "@adobe/ccweb-add-on-core";
|
|
26
|
+
import chalk from "chalk";
|
|
27
|
+
import { inject, injectable } from "inversify";
|
|
28
|
+
import prompts from "prompts";
|
|
29
|
+
import "reflect-metadata";
|
|
30
|
+
/**
|
|
31
|
+
* Implementation class to get and set user's consent
|
|
32
|
+
* on allowing the application to collect and send analytics to Adobe.
|
|
33
|
+
*/
|
|
34
|
+
let AnalyticsConsent = class AnalyticsConsent {
|
|
35
|
+
_preferences;
|
|
36
|
+
_logger;
|
|
37
|
+
/**
|
|
38
|
+
* Instantiate {@link AnalyticsConsent}.
|
|
39
|
+
* @param preferences - {@link UserPreferences} reference.
|
|
40
|
+
* @param logger - {@link Logger} reference.
|
|
41
|
+
* @returns Reference to a new {@link AnalyticsConsent} instance.
|
|
42
|
+
*/
|
|
43
|
+
constructor(preferences, logger) {
|
|
44
|
+
this._preferences = preferences;
|
|
45
|
+
this._logger = logger;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Get user consent to collect and send analytics to Adobe.
|
|
49
|
+
* @returns Promise of boolean value representing whether the user has provided consent.
|
|
50
|
+
*/
|
|
51
|
+
async get() {
|
|
52
|
+
// Always get the preference from cache
|
|
53
|
+
// for checking the analytics consent
|
|
54
|
+
// to avoid a file IO operation.
|
|
55
|
+
const preferenceData = this._preferences.get(true);
|
|
56
|
+
if (preferenceData.hasTelemetryConsent !== undefined) {
|
|
57
|
+
return preferenceData.hasTelemetryConsent;
|
|
58
|
+
}
|
|
59
|
+
this._logger.warning(LOGS.toolCollectsAnalytics, { prefix: LOGS.newLine });
|
|
60
|
+
const choices = [
|
|
61
|
+
{
|
|
62
|
+
title: this._promptMessageOption(LOGS.yesSendAnalytics),
|
|
63
|
+
value: true
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
title: this._promptMessageOption(LOGS.noDontSendAnalytics),
|
|
67
|
+
value: false
|
|
68
|
+
}
|
|
69
|
+
];
|
|
70
|
+
const response = await prompts.prompt({
|
|
71
|
+
type: "select",
|
|
72
|
+
name: "analyticsConsent",
|
|
73
|
+
message: this._promptMessage(LOGS.sendToAdobe),
|
|
74
|
+
choices,
|
|
75
|
+
initial: 0
|
|
76
|
+
});
|
|
77
|
+
if (!response || response.analyticsConsent === undefined) {
|
|
78
|
+
return process.exit(0);
|
|
79
|
+
}
|
|
80
|
+
await this.set(response.analyticsConsent);
|
|
81
|
+
return response.analyticsConsent;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Set user consent to collect and send analytics to Adobe.
|
|
85
|
+
* @param consent - Boolean value representing whether the user has provided consent.
|
|
86
|
+
*/
|
|
87
|
+
async set(consent) {
|
|
88
|
+
const preferenceData = this._preferences.get();
|
|
89
|
+
preferenceData.hasTelemetryConsent = consent;
|
|
90
|
+
this._preferences.set(preferenceData);
|
|
91
|
+
}
|
|
92
|
+
_promptMessage(message) {
|
|
93
|
+
return chalk.hex("#E59400")(message);
|
|
94
|
+
}
|
|
95
|
+
_promptMessageOption(message) {
|
|
96
|
+
return chalk.green.bold(message);
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
AnalyticsConsent = __decorate([
|
|
100
|
+
injectable(),
|
|
101
|
+
__param(0, inject(ICoreTypes.UserPreferences)),
|
|
102
|
+
__param(1, inject(ICoreTypes.Logger)),
|
|
103
|
+
__metadata("design:paramtypes", [UserPreferences, Object])
|
|
104
|
+
], AnalyticsConsent);
|
|
105
|
+
export { AnalyticsConsent };
|
|
106
|
+
const LOGS = {
|
|
107
|
+
newLine: "\n",
|
|
108
|
+
yesSendAnalytics: "Yes, send analytics to Adobe",
|
|
109
|
+
noDontSendAnalytics: "No, don't send analytics to Adobe",
|
|
110
|
+
toolCollectsAnalytics: "This tool collects and sends analytics to help Adobe improve its products.",
|
|
111
|
+
sendToAdobe: "Do you want to allow sending analytics to Adobe"
|
|
112
|
+
};
|
|
25
113
|
//# sourceMappingURL=AnalyticsConsent.js.map
|
|
@@ -21,11 +21,22 @@
|
|
|
21
21
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
22
|
* SOFTWARE.
|
|
23
23
|
********************************************************************************/
|
|
24
|
-
import {
|
|
24
|
+
import { UserPreferences } from "@adobe/ccweb-add-on-core";
|
|
25
|
+
import "reflect-metadata";
|
|
26
|
+
import { CLIProgram } from "../models/CLIProgram.js";
|
|
25
27
|
/**
|
|
26
|
-
* Analytics service
|
|
28
|
+
* Analytics service implementation.
|
|
27
29
|
*/
|
|
28
|
-
export
|
|
30
|
+
export declare class AnalyticsService {
|
|
31
|
+
private readonly _preferences;
|
|
32
|
+
private _program;
|
|
33
|
+
private _startTime;
|
|
34
|
+
/**
|
|
35
|
+
* Instantiate {@link AnalyticsService}.
|
|
36
|
+
* @param preferences - {@link UserPreferences} reference.
|
|
37
|
+
* @returns Reference to a new {@link AnalyticsService} instance.
|
|
38
|
+
*/
|
|
39
|
+
constructor(preferences: UserPreferences);
|
|
29
40
|
/**
|
|
30
41
|
* Set the program which is being executed.
|
|
31
42
|
* @param program - {@link CLIProgram} reference.
|
|
@@ -43,5 +54,6 @@ export interface AnalyticsService {
|
|
|
43
54
|
* @returns Promise.
|
|
44
55
|
*/
|
|
45
56
|
postEvent(eventType: string, eventData: string, isSuccess: boolean): Promise<void>;
|
|
57
|
+
private _getClientId;
|
|
46
58
|
}
|
|
47
59
|
//# sourceMappingURL=AnalyticsService.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AnalyticsService.d.ts","sourceRoot":"","sources":["../../src/app/AnalyticsService.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;kFAsBkF;AAElF,OAAO,EAAE,UAAU,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"AnalyticsService.d.ts","sourceRoot":"","sources":["../../src/app/AnalyticsService.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;kFAsBkF;AAElF,OAAO,EAAwB,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAIjF,OAAO,kBAAkB,CAAC;AAE1B,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAErD;;GAEG;AACH,qBACa,gBAAgB;IACzB,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAkB;IAE/C,OAAO,CAAC,QAAQ,CAAa;IAE7B,OAAO,CAAC,UAAU,CAAS;IAE3B;;;;OAIG;gBAC6C,WAAW,EAAE,eAAe;IAQ5E;;;OAGG;IACH,IAAI,OAAO,CAAC,OAAO,EAAE,UAAU,EAE9B;IAED;;OAEG;IACH,IAAI,SAAS,CAAC,IAAI,EAAE,MAAM,EAEzB;IAED;;;;;;OAMG;IACG,SAAS,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IA8BxF,OAAO,CAAC,YAAY;CASvB"}
|
|
@@ -21,5 +21,92 @@
|
|
|
21
21
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
22
|
* SOFTWARE.
|
|
23
23
|
********************************************************************************/
|
|
24
|
-
|
|
24
|
+
import { __decorate, __metadata, __param } from "tslib";
|
|
25
|
+
import { ITypes as ICoreTypes, UserPreferences } from "@adobe/ccweb-add-on-core";
|
|
26
|
+
import axios from "axios";
|
|
27
|
+
import { inject, injectable } from "inversify";
|
|
28
|
+
import osName from "os-name";
|
|
29
|
+
import "reflect-metadata";
|
|
30
|
+
import { ANALYTICS_API } from "../constants.js";
|
|
31
|
+
import { CLIProgram } from "../models/CLIProgram.js";
|
|
32
|
+
/**
|
|
33
|
+
* Analytics service implementation.
|
|
34
|
+
*/
|
|
35
|
+
let AnalyticsService = class AnalyticsService {
|
|
36
|
+
_preferences;
|
|
37
|
+
_program;
|
|
38
|
+
_startTime;
|
|
39
|
+
/**
|
|
40
|
+
* Instantiate {@link AnalyticsService}.
|
|
41
|
+
* @param preferences - {@link UserPreferences} reference.
|
|
42
|
+
* @returns Reference to a new {@link AnalyticsService} instance.
|
|
43
|
+
*/
|
|
44
|
+
constructor(preferences) {
|
|
45
|
+
this._preferences = preferences;
|
|
46
|
+
this._program = new CLIProgram("", "");
|
|
47
|
+
this._startTime = Date.now();
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Set the program which is being executed.
|
|
51
|
+
* @param program - {@link CLIProgram} reference.
|
|
52
|
+
*/
|
|
53
|
+
set program(program) {
|
|
54
|
+
this._program = program;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Set the start time of an operation.
|
|
58
|
+
*/
|
|
59
|
+
set startTime(time) {
|
|
60
|
+
this._startTime = time;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Post an event to Adobe analytics service.
|
|
64
|
+
* @param eventType - Event type, either a SUCCESS, or an ERROR.
|
|
65
|
+
* @param eventData - Event data.
|
|
66
|
+
* @param isSuccess - Does the event represent a successful operation.
|
|
67
|
+
* @returns Promise.
|
|
68
|
+
*/
|
|
69
|
+
async postEvent(eventType, eventData, isSuccess) {
|
|
70
|
+
try {
|
|
71
|
+
const userPreferences = this._preferences.get();
|
|
72
|
+
if (!userPreferences.hasTelemetryConsent) {
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
const currentTime = Date.now();
|
|
76
|
+
const body = JSON.stringify({
|
|
77
|
+
id: Math.floor(currentTime * Math.random()),
|
|
78
|
+
timestamp: currentTime,
|
|
79
|
+
_adobeio: {
|
|
80
|
+
eventType,
|
|
81
|
+
eventData,
|
|
82
|
+
cliVersion: this._program.version,
|
|
83
|
+
clientId: this._getClientId(),
|
|
84
|
+
command: this._program.name,
|
|
85
|
+
commandDuration: currentTime - this._startTime,
|
|
86
|
+
commandSuccess: isSuccess,
|
|
87
|
+
nodeVersion: process.version,
|
|
88
|
+
osNameVersion: osName()
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
await axios.post(ANALYTICS_API.URL, body, { headers: ANALYTICS_API.HEADERS });
|
|
92
|
+
}
|
|
93
|
+
catch {
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
_getClientId() {
|
|
98
|
+
const userPreferences = this._preferences.get();
|
|
99
|
+
if (userPreferences.clientId === undefined) {
|
|
100
|
+
userPreferences.clientId = Math.floor(Date.now() * Math.random());
|
|
101
|
+
this._preferences.set(userPreferences);
|
|
102
|
+
}
|
|
103
|
+
return userPreferences.clientId;
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
AnalyticsService = __decorate([
|
|
107
|
+
injectable(),
|
|
108
|
+
__param(0, inject(ICoreTypes.UserPreferences)),
|
|
109
|
+
__metadata("design:paramtypes", [UserPreferences])
|
|
110
|
+
], AnalyticsService);
|
|
111
|
+
export { AnalyticsService };
|
|
25
112
|
//# sourceMappingURL=AnalyticsService.js.map
|
package/dist/app/index.d.ts
CHANGED
|
@@ -23,6 +23,4 @@
|
|
|
23
23
|
********************************************************************************/
|
|
24
24
|
export * from "./AnalyticsConsent.js";
|
|
25
25
|
export * from "./AnalyticsService.js";
|
|
26
|
-
export * from "./WxpAnalyticsConsent.js";
|
|
27
|
-
export * from "./WxpAnalyticsService.js";
|
|
28
26
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/app/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/app/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;kFAsBkF;AAElF,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/app/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;kFAsBkF;AAElF,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC"}
|
package/dist/app/index.js
CHANGED
|
@@ -23,6 +23,4 @@
|
|
|
23
23
|
********************************************************************************/
|
|
24
24
|
export * from "./AnalyticsConsent.js";
|
|
25
25
|
export * from "./AnalyticsService.js";
|
|
26
|
-
export * from "./WxpAnalyticsConsent.js";
|
|
27
|
-
export * from "./WxpAnalyticsService.js";
|
|
28
26
|
//# sourceMappingURL=index.js.map
|
|
@@ -21,11 +21,12 @@
|
|
|
21
21
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
22
|
* SOFTWARE.
|
|
23
23
|
********************************************************************************/
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
24
|
+
import type { Config } from "@oclif/core";
|
|
25
|
+
import { Command } from "@oclif/core";
|
|
26
|
+
import type { BooleanFlag, CustomOptions, OptionFlag } from "@oclif/core/lib/interfaces/parser.js";
|
|
27
|
+
import type { AnalyticsConsent } from "../app/AnalyticsConsent.js";
|
|
28
|
+
import type { AnalyticsService } from "../app/AnalyticsService.js";
|
|
29
|
+
import type { CLIProgram } from "../models/CLIProgram.js";
|
|
29
30
|
export declare abstract class BaseCommand extends Command {
|
|
30
31
|
protected readonly _analyticsConsent: AnalyticsConsent;
|
|
31
32
|
protected readonly _analyticsService: AnalyticsService;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseCommand.d.ts","sourceRoot":"","sources":["../../src/base/BaseCommand.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;kFAsBkF;AAElF,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"BaseCommand.d.ts","sourceRoot":"","sources":["../../src/base/BaseCommand.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;kFAsBkF;AAElF,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAS,MAAM,aAAa,CAAC;AAC7C,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,sCAAsC,CAAC;AACnG,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAEnE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAE1D,8BAAsB,WAAY,SAAQ,OAAO;IAC7C,SAAS,CAAC,QAAQ,CAAC,iBAAiB,EAAE,gBAAgB,CAAC;IACvD,SAAS,CAAC,QAAQ,CAAC,iBAAiB,EAAE,gBAAgB,CAAC;gBAE3C,IAAI,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU;IAU/D,MAAM,CAAC,SAAS,EAAE;QACd,SAAS,EAAE,UAAU,CAAC,MAAM,GAAG,SAAS,EAAE,aAAa,CAAC,CAAC;QACzD,OAAO,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;KACjC,CAaC;cAEc,qBAAqB,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC;CAOtF"}
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
22
|
* SOFTWARE.
|
|
23
23
|
********************************************************************************/
|
|
24
|
+
import type { Container } from "inversify";
|
|
24
25
|
import "reflect-metadata";
|
|
25
|
-
import { Container } from "inversify";
|
|
26
26
|
declare const container: Container;
|
|
27
27
|
export { container as IContainer };
|
|
28
28
|
//# sourceMappingURL=inversify.config.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inversify.config.d.ts","sourceRoot":"","sources":["../../src/config/inversify.config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;kFAsBkF;AAGlF,OAAO,
|
|
1
|
+
{"version":3,"file":"inversify.config.d.ts","sourceRoot":"","sources":["../../src/config/inversify.config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;kFAsBkF;AAGlF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,kBAAkB,CAAC;AAK1B,QAAA,MAAM,SAAS,EAAE,SAA0B,CAAC;AAM5C,OAAO,EAAE,SAAS,IAAI,UAAU,EAAE,CAAC"}
|
|
@@ -23,10 +23,11 @@
|
|
|
23
23
|
********************************************************************************/
|
|
24
24
|
import { IContainer as ICoreContainer } from "@adobe/ccweb-add-on-core";
|
|
25
25
|
import "reflect-metadata";
|
|
26
|
-
import {
|
|
26
|
+
import { AnalyticsConsent } from "../app/AnalyticsConsent.js";
|
|
27
|
+
import { AnalyticsService } from "../app/AnalyticsService.js";
|
|
27
28
|
import { ITypes } from "./inversify.types.js";
|
|
28
29
|
const container = ICoreContainer;
|
|
29
|
-
container.bind(ITypes.AnalyticsConsent).to(
|
|
30
|
-
container.bind(ITypes.AnalyticsService).to(
|
|
30
|
+
container.bind(ITypes.AnalyticsConsent).to(AnalyticsConsent).inSingletonScope();
|
|
31
|
+
container.bind(ITypes.AnalyticsService).to(AnalyticsService).inSingletonScope();
|
|
31
32
|
export { container as IContainer };
|
|
32
33
|
//# sourceMappingURL=inversify.config.js.map
|