@microsoft/power-apps-cli 0.5.3 → 0.5.4
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/lib/Verbs/AddDataSource.js +19 -13
- package/lib/Verbs/AddDataSource.js.map +1 -1
- package/lib/Verbs/DeleteDataSource.js +3 -3
- package/lib/Verbs/DeleteDataSource.js.map +1 -1
- package/lib/Verbs/Init.d.ts.map +1 -1
- package/lib/Verbs/Init.js +20 -0
- package/lib/Verbs/Init.js.map +1 -1
- package/lib-cjs/Verbs/AddDataSource.js +38 -43
- package/lib-cjs/Verbs/AddDataSource.js.map +1 -1
- package/lib-cjs/Verbs/DeleteDataSource.js +11 -19
- package/lib-cjs/Verbs/DeleteDataSource.js.map +1 -1
- package/lib-cjs/Verbs/Init.d.ts.map +1 -1
- package/lib-cjs/Verbs/Init.js +39 -8
- package/lib-cjs/Verbs/Init.js.map +1 -1
- package/node_modules/@microsoft/1ds-properties-js/README.md +193 -0
- package/node_modules/@microsoft/1ds-properties-js/bundle/es5/ms.properties-4.3.9.gbl.js +4844 -0
- package/node_modules/@microsoft/1ds-properties-js/bundle/es5/ms.properties-4.3.9.gbl.js.map +1 -0
- package/node_modules/@microsoft/1ds-properties-js/bundle/es5/ms.properties-4.3.9.gbl.min.js +7 -0
- package/node_modules/@microsoft/1ds-properties-js/bundle/es5/ms.properties-4.3.9.gbl.min.js.map +1 -0
- package/node_modules/@microsoft/1ds-properties-js/bundle/es5/ms.properties-4.3.9.integrity.json +46 -0
- package/node_modules/@microsoft/1ds-properties-js/bundle/es5/ms.properties-4.3.9.js +4848 -0
- package/node_modules/@microsoft/1ds-properties-js/bundle/es5/ms.properties-4.3.9.js.map +1 -0
- package/node_modules/@microsoft/1ds-properties-js/bundle/es5/ms.properties-4.3.9.min.js +7 -0
- package/node_modules/@microsoft/1ds-properties-js/bundle/es5/ms.properties-4.3.9.min.js.map +1 -0
- package/node_modules/@microsoft/1ds-properties-js/bundle/es5/ms.properties.gbl.js +4844 -0
- package/node_modules/@microsoft/1ds-properties-js/bundle/es5/ms.properties.gbl.js.map +1 -0
- package/node_modules/@microsoft/1ds-properties-js/bundle/es5/ms.properties.gbl.min.js +7 -0
- package/node_modules/@microsoft/1ds-properties-js/bundle/es5/ms.properties.gbl.min.js.map +1 -0
- package/node_modules/@microsoft/1ds-properties-js/bundle/es5/ms.properties.integrity.json +46 -0
- package/node_modules/@microsoft/1ds-properties-js/bundle/es5/ms.properties.js +4848 -0
- package/node_modules/@microsoft/1ds-properties-js/bundle/es5/ms.properties.js.map +1 -0
- package/node_modules/@microsoft/1ds-properties-js/bundle/es5/ms.properties.min.js +7 -0
- package/node_modules/@microsoft/1ds-properties-js/bundle/es5/ms.properties.min.js.map +1 -0
- package/node_modules/@microsoft/1ds-properties-js/dist/es5/ms.properties.js +4827 -0
- package/node_modules/@microsoft/1ds-properties-js/dist/es5/ms.properties.js.map +1 -0
- package/node_modules/@microsoft/1ds-properties-js/dist/es5/ms.properties.min.js +7 -0
- package/node_modules/@microsoft/1ds-properties-js/dist/es5/ms.properties.min.js.map +1 -0
- package/node_modules/@microsoft/1ds-properties-js/dist-es5/DataModels.js +13 -0
- package/node_modules/@microsoft/1ds-properties-js/dist-es5/DataModels.js.map +1 -0
- package/node_modules/@microsoft/1ds-properties-js/dist-es5/ExtensionKeys.js +95 -0
- package/node_modules/@microsoft/1ds-properties-js/dist-es5/ExtensionKeys.js.map +1 -0
- package/node_modules/@microsoft/1ds-properties-js/dist-es5/Index.js +16 -0
- package/node_modules/@microsoft/1ds-properties-js/dist-es5/Index.js.map +1 -0
- package/node_modules/@microsoft/1ds-properties-js/dist-es5/InternalConstants.js +30 -0
- package/node_modules/@microsoft/1ds-properties-js/dist-es5/InternalConstants.js.map +1 -0
- package/node_modules/@microsoft/1ds-properties-js/dist-es5/PropertiesPlugin.js +200 -0
- package/node_modules/@microsoft/1ds-properties-js/dist-es5/PropertiesPlugin.js.map +1 -0
- package/node_modules/@microsoft/1ds-properties-js/dist-es5/SessionManager.js +168 -0
- package/node_modules/@microsoft/1ds-properties-js/dist-es5/SessionManager.js.map +1 -0
- package/node_modules/@microsoft/1ds-properties-js/dist-es5/TelemetryContext.js +286 -0
- package/node_modules/@microsoft/1ds-properties-js/dist-es5/TelemetryContext.js.map +1 -0
- package/node_modules/@microsoft/1ds-properties-js/dist-es5/Utils.js +106 -0
- package/node_modules/@microsoft/1ds-properties-js/dist-es5/Utils.js.map +1 -0
- package/node_modules/@microsoft/1ds-properties-js/dist-es5/context/Application.js +178 -0
- package/node_modules/@microsoft/1ds-properties-js/dist-es5/context/Application.js.map +1 -0
- package/node_modules/@microsoft/1ds-properties-js/dist-es5/context/Cloud.js +17 -0
- package/node_modules/@microsoft/1ds-properties-js/dist-es5/context/Cloud.js.map +1 -0
- package/node_modules/@microsoft/1ds-properties-js/dist-es5/context/Device.js +17 -0
- package/node_modules/@microsoft/1ds-properties-js/dist-es5/context/Device.js.map +1 -0
- package/node_modules/@microsoft/1ds-properties-js/dist-es5/context/IntWeb.js +58 -0
- package/node_modules/@microsoft/1ds-properties-js/dist-es5/context/IntWeb.js.map +1 -0
- package/node_modules/@microsoft/1ds-properties-js/dist-es5/context/Loc.js +29 -0
- package/node_modules/@microsoft/1ds-properties-js/dist-es5/context/Loc.js.map +1 -0
- package/node_modules/@microsoft/1ds-properties-js/dist-es5/context/OperatingSystem.js +176 -0
- package/node_modules/@microsoft/1ds-properties-js/dist-es5/context/OperatingSystem.js.map +1 -0
- package/node_modules/@microsoft/1ds-properties-js/dist-es5/context/Sdk.js +71 -0
- package/node_modules/@microsoft/1ds-properties-js/dist-es5/context/Sdk.js.map +1 -0
- package/node_modules/@microsoft/1ds-properties-js/dist-es5/context/Session.js +47 -0
- package/node_modules/@microsoft/1ds-properties-js/dist-es5/context/Session.js.map +1 -0
- package/node_modules/@microsoft/1ds-properties-js/dist-es5/context/Trace.js +36 -0
- package/node_modules/@microsoft/1ds-properties-js/dist-es5/context/Trace.js.map +1 -0
- package/node_modules/@microsoft/1ds-properties-js/dist-es5/context/User.js +102 -0
- package/node_modules/@microsoft/1ds-properties-js/dist-es5/context/User.js.map +1 -0
- package/node_modules/@microsoft/1ds-properties-js/dist-es5/context/Utc.js +64 -0
- package/node_modules/@microsoft/1ds-properties-js/dist-es5/context/Utc.js.map +1 -0
- package/node_modules/@microsoft/1ds-properties-js/dist-es5/context/Web.js +274 -0
- package/node_modules/@microsoft/1ds-properties-js/dist-es5/context/Web.js.map +1 -0
- package/node_modules/@microsoft/1ds-properties-js/package.json +65 -0
- package/node_modules/@microsoft/1ds-properties-js/tsconfig.json +27 -0
- package/node_modules/@microsoft/1ds-properties-js/types/1ds-properties-js.d.ts +706 -0
- package/node_modules/@microsoft/1ds-properties-js/types/1ds-properties-js.namespaced.d.ts +2908 -0
- package/node_modules/@microsoft/powerapps-data/package.json +1 -1
- package/node_modules/@microsoft/powerapps-player-actions/lib/Actions/AddDataSource.js +31 -25
- package/node_modules/@microsoft/powerapps-player-actions/lib/Actions/AddDataSource.js.map +1 -1
- package/node_modules/@microsoft/powerapps-player-actions/lib/Actions/DataUtils.d.ts +6 -4
- package/node_modules/@microsoft/powerapps-player-actions/lib/Actions/DataUtils.d.ts.map +1 -1
- package/node_modules/@microsoft/powerapps-player-actions/lib/Actions/DataUtils.js +11 -5
- package/node_modules/@microsoft/powerapps-player-actions/lib/Actions/DataUtils.js.map +1 -1
- package/node_modules/@microsoft/powerapps-player-actions/lib/Actions/DeleteDataSource.js +3 -3
- package/node_modules/@microsoft/powerapps-player-actions/lib/Actions/DeleteDataSource.js.map +1 -1
- package/node_modules/@microsoft/powerapps-player-actions/lib/Types/ActionTypes.d.ts +16 -11
- package/node_modules/@microsoft/powerapps-player-actions/lib/Types/ActionTypes.d.ts.map +1 -1
- package/node_modules/@microsoft/powerapps-player-actions/lib/__tests__/AddDataSource.spec.js +1 -1
- package/node_modules/@microsoft/powerapps-player-actions/lib/__tests__/AddDataSource.spec.js.map +1 -1
- package/node_modules/@microsoft/powerapps-player-actions/lib-cjs/Actions/AddDataSource.js +104 -86
- package/node_modules/@microsoft/powerapps-player-actions/lib-cjs/Actions/AddDataSource.js.map +1 -1
- package/node_modules/@microsoft/powerapps-player-actions/lib-cjs/Actions/DataUtils.d.ts +6 -4
- package/node_modules/@microsoft/powerapps-player-actions/lib-cjs/Actions/DataUtils.d.ts.map +1 -1
- package/node_modules/@microsoft/powerapps-player-actions/lib-cjs/Actions/DataUtils.js +26 -4
- package/node_modules/@microsoft/powerapps-player-actions/lib-cjs/Actions/DataUtils.js.map +1 -1
- package/node_modules/@microsoft/powerapps-player-actions/lib-cjs/Actions/DeleteDataSource.js +52 -46
- package/node_modules/@microsoft/powerapps-player-actions/lib-cjs/Actions/DeleteDataSource.js.map +1 -1
- package/node_modules/@microsoft/powerapps-player-actions/lib-cjs/Types/ActionTypes.d.ts +16 -11
- package/node_modules/@microsoft/powerapps-player-actions/lib-cjs/Types/ActionTypes.d.ts.map +1 -1
- package/node_modules/@microsoft/powerapps-player-actions/lib-cjs/__tests__/AddDataSource.spec.js +1 -1
- package/node_modules/@microsoft/powerapps-player-actions/lib-cjs/__tests__/AddDataSource.spec.js.map +1 -1
- package/node_modules/@microsoft/powerapps-player-actions/package.json +1 -1
- package/node_modules/@pa-client/powerapps-player-services/package.json +69 -69
- package/package.json +5 -3
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* 1DS JS SDK Properties plugin, 4.3.9
|
|
3
|
+
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
|
+
* (Microsoft Internal Only)
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Cloud.ts
|
|
8
|
+
* @author Hector Hernandez (hectorh)
|
|
9
|
+
* @copyright Microsoft 2020
|
|
10
|
+
*/
|
|
11
|
+
var Cloud = /** @class */ (function () {
|
|
12
|
+
function Cloud() {
|
|
13
|
+
}
|
|
14
|
+
return Cloud;
|
|
15
|
+
}());
|
|
16
|
+
export { Cloud };
|
|
17
|
+
//# sourceMappingURL=Cloud.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Cloud.js.map","sources":["Cloud.js"],"sourcesContent":["/**\r\n* Cloud.ts\r\n* @author Hector Hernandez (hectorh)\r\n* @copyright Microsoft 2020\r\n*/\r\nvar Cloud = /** @class */ (function () {\r\n function Cloud() {\r\n }\r\n return Cloud;\r\n}());\r\nexport { Cloud };\r\n//# sourceMappingURL=Cloud.js.map"],"names":[],"mappings":";;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* 1DS JS SDK Properties plugin, 4.3.9
|
|
3
|
+
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
|
+
* (Microsoft Internal Only)
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Device.ts
|
|
8
|
+
* @author Hector Hernandez (hectorh)
|
|
9
|
+
* @copyright Microsoft 2019
|
|
10
|
+
*/
|
|
11
|
+
var Device = /** @class */ (function () {
|
|
12
|
+
function Device() {
|
|
13
|
+
}
|
|
14
|
+
return Device;
|
|
15
|
+
}());
|
|
16
|
+
export { Device };
|
|
17
|
+
//# sourceMappingURL=Device.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Device.js.map","sources":["Device.js"],"sourcesContent":["/**\r\n* Device.ts\r\n* @author Hector Hernandez (hectorh)\r\n* @copyright Microsoft 2019\r\n*/\r\nvar Device = /** @class */ (function () {\r\n function Device() {\r\n }\r\n return Device;\r\n}());\r\nexport { Device };\r\n//# sourceMappingURL=Device.js.map"],"names":[],"mappings":";;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* 1DS JS SDK Properties plugin, 4.3.9
|
|
3
|
+
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
|
+
* (Microsoft Internal Only)
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* IntWeb.ts
|
|
8
|
+
* @author Hector Hernandez (hectorh)
|
|
9
|
+
* @copyright Microsoft 2019
|
|
10
|
+
*/
|
|
11
|
+
import dynamicProto from "@microsoft/dynamicproto-js";
|
|
12
|
+
import { getCookieValue, onConfigChange } from "@microsoft/1ds-core-js";
|
|
13
|
+
import { objDefine } from "@nevware21/ts-utils";
|
|
14
|
+
function _getMsfpc() {
|
|
15
|
+
return this.getMsfpc();
|
|
16
|
+
}
|
|
17
|
+
function _getAnid() {
|
|
18
|
+
return this.getAnid();
|
|
19
|
+
}
|
|
20
|
+
var IntWeb = /** @class */ (function () {
|
|
21
|
+
function IntWeb(propertiesConfig, core, unloadHookContainer) {
|
|
22
|
+
var _cookieMgr;
|
|
23
|
+
dynamicProto(IntWeb, this, function (_self) {
|
|
24
|
+
_populateDefaults(propertiesConfig);
|
|
25
|
+
_self.getMsfpc = function () {
|
|
26
|
+
return getCookieValue(_cookieMgr, "MSFPC");
|
|
27
|
+
};
|
|
28
|
+
_self.getAnid = function () {
|
|
29
|
+
return getCookieValue(_cookieMgr, "ANON").slice(0, 34);
|
|
30
|
+
};
|
|
31
|
+
function _populateDefaults(config) {
|
|
32
|
+
// This function will be re-called whenever any referenced configuration is changed
|
|
33
|
+
var unloadHook = onConfigChange(config, function () {
|
|
34
|
+
_cookieMgr = core && core.getCookieMgr();
|
|
35
|
+
var _config = config || {};
|
|
36
|
+
if (_config.serviceName) {
|
|
37
|
+
_self.serviceName = _config.serviceName; // change serviceName only if incoming values is not null, undefined or ""
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
unloadHookContainer && unloadHookContainer.add(unloadHook);
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
// Removed Stub for IntWeb.prototype.getMsfpc.
|
|
45
|
+
// Removed Stub for IntWeb.prototype.getAnid.
|
|
46
|
+
/**
|
|
47
|
+
* Static constructor, attempt to create accessors
|
|
48
|
+
*/
|
|
49
|
+
IntWeb._staticInit = (function () {
|
|
50
|
+
// Dynamically create get/set property accessors
|
|
51
|
+
var proto = IntWeb.prototype;
|
|
52
|
+
objDefine(proto, "msfpc", { g: _getMsfpc });
|
|
53
|
+
objDefine(proto, "anid", { g: _getAnid });
|
|
54
|
+
})();
|
|
55
|
+
return IntWeb;
|
|
56
|
+
}());
|
|
57
|
+
export { IntWeb };
|
|
58
|
+
//# sourceMappingURL=IntWeb.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IntWeb.js.map","sources":["IntWeb.js"],"sourcesContent":["/**\r\n* IntWeb.ts\r\n* @author Hector Hernandez (hectorh)\r\n* @copyright Microsoft 2019\r\n*/\r\nimport dynamicProto from \"@microsoft/dynamicproto-js\";\r\nimport { getCookieValue, onConfigChange } from \"@microsoft/1ds-core-js\";\r\nimport { objDefine } from \"@nevware21/ts-utils\";\r\nfunction _getMsfpc() {\r\n return this.getMsfpc();\r\n}\r\nfunction _getAnid() {\r\n return this.getAnid();\r\n}\r\nvar IntWeb = /** @class */ (function () {\r\n function IntWeb(propertiesConfig, core, unloadHookContainer) {\r\n var _cookieMgr;\r\n dynamicProto(IntWeb, this, function (_self) {\r\n _populateDefaults(propertiesConfig);\r\n _self.getMsfpc = function () {\r\n return getCookieValue(_cookieMgr, \"MSFPC\");\r\n };\r\n _self.getAnid = function () {\r\n return getCookieValue(_cookieMgr, \"ANON\").slice(0, 34);\r\n };\r\n function _populateDefaults(config) {\r\n // This function will be re-called whenever any referenced configuration is changed\r\n var unloadHook = onConfigChange(config, function () {\r\n _cookieMgr = core && core.getCookieMgr();\r\n var _config = config || {};\r\n if (_config.serviceName) {\r\n _self.serviceName = _config.serviceName; // change serviceName only if incoming values is not null, undefined or \"\"\r\n }\r\n });\r\n unloadHookContainer && unloadHookContainer.add(unloadHook);\r\n }\r\n });\r\n }\r\n /**\r\n * Anonymous visitor Id in hosting domain.\r\n */\r\n IntWeb.prototype.getMsfpc = function () {\r\n // @DynamicProtoStub - DO NOT add any code as this will be removed during packaging\r\n return null;\r\n };\r\n /**\r\n * ANON - MSA Anonymous ID.\r\n */\r\n IntWeb.prototype.getAnid = function () {\r\n // @DynamicProtoStub - DO NOT add any code as this will be removed during packaging\r\n return null;\r\n };\r\n /**\r\n * Static constructor, attempt to create accessors\r\n */\r\n IntWeb._staticInit = (function () {\r\n // Dynamically create get/set property accessors\r\n var proto = IntWeb.prototype;\r\n objDefine(proto, \"msfpc\", { g: _getMsfpc });\r\n objDefine(proto, \"anid\", { g: _getAnid });\r\n })();\r\n return IntWeb;\r\n}());\r\nexport { IntWeb };\r\n//# sourceMappingURL=IntWeb.js.map"],"names":[],"mappings":";;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;6CAMM;AACN;AAOO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* 1DS JS SDK Properties plugin, 4.3.9
|
|
3
|
+
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
|
+
* (Microsoft Internal Only)
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Loc.ts
|
|
8
|
+
* @author Hector Hernandez (hectorh)
|
|
9
|
+
* @copyright Microsoft 2019
|
|
10
|
+
*/
|
|
11
|
+
var Loc = /** @class */ (function () {
|
|
12
|
+
function Loc() {
|
|
13
|
+
// Add time zone
|
|
14
|
+
var timeZone = new Date().getTimezoneOffset();
|
|
15
|
+
var minutes = timeZone % 60;
|
|
16
|
+
var hours = (timeZone - minutes) / 60;
|
|
17
|
+
var timeZonePrefix = "+";
|
|
18
|
+
if (hours > 0) {
|
|
19
|
+
timeZonePrefix = "-";
|
|
20
|
+
}
|
|
21
|
+
hours = Math.abs(hours);
|
|
22
|
+
minutes = Math.abs(minutes);
|
|
23
|
+
this.tz = timeZonePrefix + (hours < 10 ? "0" + hours : hours.toString()) + ":"
|
|
24
|
+
+ (minutes < 10 ? "0" + minutes : minutes.toString());
|
|
25
|
+
}
|
|
26
|
+
return Loc;
|
|
27
|
+
}());
|
|
28
|
+
export { Loc };
|
|
29
|
+
//# sourceMappingURL=Loc.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Loc.js.map","sources":["Loc.js"],"sourcesContent":["/**\r\n* Loc.ts\r\n* @author Hector Hernandez (hectorh)\r\n* @copyright Microsoft 2019\r\n*/\r\nvar Loc = /** @class */ (function () {\r\n function Loc() {\r\n // Add time zone\r\n var timeZone = new Date().getTimezoneOffset();\r\n var minutes = timeZone % 60;\r\n var hours = (timeZone - minutes) / 60;\r\n var timeZonePrefix = \"+\";\r\n if (hours > 0) {\r\n timeZonePrefix = \"-\";\r\n }\r\n hours = Math.abs(hours);\r\n minutes = Math.abs(minutes);\r\n this.tz = timeZonePrefix + (hours < 10 ? \"0\" + hours : hours.toString()) + \":\"\r\n + (minutes < 10 ? \"0\" + minutes : minutes.toString());\r\n }\r\n return Loc;\r\n}());\r\nexport { Loc };\r\n//# sourceMappingURL=Loc.js.map"],"names":[],"mappings":";;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA"}
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* 1DS JS SDK Properties plugin, 4.3.9
|
|
3
|
+
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
|
+
* (Microsoft Internal Only)
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* OperatingSystem.ts
|
|
8
|
+
* @author Hector Hernandez (hectorh)
|
|
9
|
+
* @copyright Microsoft 2019
|
|
10
|
+
*/
|
|
11
|
+
import { getNavigator, isString, onConfigChange } from "@microsoft/1ds-core-js";
|
|
12
|
+
import { objDefine } from "@nevware21/ts-utils";
|
|
13
|
+
var OSNAMEREGEX = {
|
|
14
|
+
WIN: /(windows|win32)/i,
|
|
15
|
+
WINRT: / arm;/i,
|
|
16
|
+
WINPHONE: /windows\sphone\s\d+\.\d+/i,
|
|
17
|
+
OSX: /(macintosh|mac os x)/i,
|
|
18
|
+
IOS: /(ipad|iphone|ipod)(?=.*like mac os x)/i,
|
|
19
|
+
LINUX: /(linux|joli|[kxln]?ubuntu|debian|[open]*suse|gentoo|arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk)/i,
|
|
20
|
+
ANDROID: /android/i,
|
|
21
|
+
CROS: /CrOS/i
|
|
22
|
+
};
|
|
23
|
+
var VERSION_MAPPINGS = {
|
|
24
|
+
"5.1": "XP",
|
|
25
|
+
"6.0": "Vista",
|
|
26
|
+
"6.1": "7",
|
|
27
|
+
"6.2": "8",
|
|
28
|
+
"6.3": "8.1",
|
|
29
|
+
"10.0": "10"
|
|
30
|
+
};
|
|
31
|
+
var REGEX_VERSION = "([\\d,.]+)";
|
|
32
|
+
var REGEX_VERSION_MAC = "([\\d,_,.]+)";
|
|
33
|
+
var UNKNOWN = "Unknown";
|
|
34
|
+
var OSNAMES = [
|
|
35
|
+
{ r: OSNAMEREGEX.WINPHONE, os: "Windows Phone" },
|
|
36
|
+
{ r: OSNAMEREGEX.WINRT, os: "Windows RT" },
|
|
37
|
+
{ r: OSNAMEREGEX.WIN, os: "Windows" /* OPERATING_SYSTEMS.WINDOWS */ },
|
|
38
|
+
{ r: OSNAMEREGEX.IOS, os: "iOS" /* OPERATING_SYSTEMS.IOS */ },
|
|
39
|
+
{ r: OSNAMEREGEX.ANDROID, os: "Android" /* OPERATING_SYSTEMS.ANDROID */ },
|
|
40
|
+
{ r: OSNAMEREGEX.LINUX, os: "Linux" },
|
|
41
|
+
{ r: OSNAMEREGEX.CROS, os: "Chrome OS" },
|
|
42
|
+
{ s: "x11", os: "Unix" },
|
|
43
|
+
{ s: "blackberry", os: "BlackBerry" },
|
|
44
|
+
{ s: "symbian", os: "Symbian" },
|
|
45
|
+
{ s: "nokia", os: "Nokia" },
|
|
46
|
+
{ r: OSNAMEREGEX.OSX, os: "Mac OS X" /* OPERATING_SYSTEMS.MACOSX */ }
|
|
47
|
+
];
|
|
48
|
+
var strSetSysName = "setSysName";
|
|
49
|
+
var strSetSysVer = "setSysVer";
|
|
50
|
+
var strGetSysName = "getSysName";
|
|
51
|
+
var strGetSysVer = "getSysVer";
|
|
52
|
+
function _getOsName(lowerCaseUserAgent) {
|
|
53
|
+
for (var lp = 0; lp < OSNAMES.length; lp++) {
|
|
54
|
+
var match = OSNAMES[lp];
|
|
55
|
+
if (match.r && lowerCaseUserAgent.match(match.r)) {
|
|
56
|
+
return match.os;
|
|
57
|
+
}
|
|
58
|
+
else if (match.s && lowerCaseUserAgent.indexOf(match.s) !== -1) {
|
|
59
|
+
return match.os;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return UNKNOWN;
|
|
63
|
+
}
|
|
64
|
+
function _getOsVersion(userAgent, osName) {
|
|
65
|
+
if (osName === "Windows" /* OPERATING_SYSTEMS.WINDOWS */) {
|
|
66
|
+
return _getGenericOsVersion(userAgent, "Windows NT");
|
|
67
|
+
}
|
|
68
|
+
if (osName === "Android" /* OPERATING_SYSTEMS.ANDROID */) {
|
|
69
|
+
return _getGenericOsVersion(userAgent, osName);
|
|
70
|
+
}
|
|
71
|
+
if (osName === "Mac OS X" /* OPERATING_SYSTEMS.MACOSX */) {
|
|
72
|
+
return _getMacOsxVersion(userAgent);
|
|
73
|
+
}
|
|
74
|
+
if (osName === "iOS" /* OPERATING_SYSTEMS.IOS */) {
|
|
75
|
+
return _getIosVersion(userAgent);
|
|
76
|
+
}
|
|
77
|
+
return UNKNOWN;
|
|
78
|
+
}
|
|
79
|
+
function _getGenericOsVersion(userAgent, osName) {
|
|
80
|
+
var ntVersionMatches = userAgent.match(new RegExp(osName + " " + REGEX_VERSION));
|
|
81
|
+
if (ntVersionMatches) {
|
|
82
|
+
if (VERSION_MAPPINGS[ntVersionMatches[1]]) {
|
|
83
|
+
return VERSION_MAPPINGS[ntVersionMatches[1]];
|
|
84
|
+
}
|
|
85
|
+
return ntVersionMatches[1];
|
|
86
|
+
}
|
|
87
|
+
return UNKNOWN;
|
|
88
|
+
}
|
|
89
|
+
function _getMacOsxVersion(userAgent) {
|
|
90
|
+
var macOsxVersionInUserAgentMatches = userAgent.match(new RegExp("Mac OS X" /* OPERATING_SYSTEMS.MACOSX */ + " " + REGEX_VERSION_MAC));
|
|
91
|
+
if (macOsxVersionInUserAgentMatches) {
|
|
92
|
+
var versionString = macOsxVersionInUserAgentMatches[1].replace(/_/g, ".");
|
|
93
|
+
if (versionString) {
|
|
94
|
+
var delimiter = _getDelimiter(versionString);
|
|
95
|
+
if (delimiter) {
|
|
96
|
+
var components = versionString.split(delimiter);
|
|
97
|
+
return components[0];
|
|
98
|
+
}
|
|
99
|
+
else {
|
|
100
|
+
return versionString;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
return UNKNOWN;
|
|
105
|
+
}
|
|
106
|
+
function _getIosVersion(userAgent) {
|
|
107
|
+
var iosVersionInUserAgentMatches = userAgent.match(new RegExp("OS " + REGEX_VERSION_MAC));
|
|
108
|
+
if (iosVersionInUserAgentMatches) {
|
|
109
|
+
var versionString = iosVersionInUserAgentMatches[1].replace(/_/g, ".");
|
|
110
|
+
if (versionString) {
|
|
111
|
+
var delimiter = _getDelimiter(versionString);
|
|
112
|
+
if (delimiter) {
|
|
113
|
+
var components = versionString.split(delimiter);
|
|
114
|
+
return components[0];
|
|
115
|
+
}
|
|
116
|
+
else {
|
|
117
|
+
return versionString;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
return UNKNOWN;
|
|
122
|
+
}
|
|
123
|
+
function _getDelimiter(versionString) {
|
|
124
|
+
if (versionString.indexOf(".") > -1) {
|
|
125
|
+
return ".";
|
|
126
|
+
}
|
|
127
|
+
if (versionString.indexOf("_") > -1) {
|
|
128
|
+
return "_";
|
|
129
|
+
}
|
|
130
|
+
return null;
|
|
131
|
+
}
|
|
132
|
+
var OperatingSystem = /** @class */ (function () {
|
|
133
|
+
function OperatingSystem(propertiesConfig, unloadHookContainer) {
|
|
134
|
+
var self = this;
|
|
135
|
+
var _config;
|
|
136
|
+
var _name = null;
|
|
137
|
+
var _ver = null;
|
|
138
|
+
var _userName = null; // save user defined name. If defined, this value will overwrite dynamic config values
|
|
139
|
+
var _userVer = null; // save user defined ver. If defined, this value will overwrite dynamic config values
|
|
140
|
+
var _setSysName = function (value) {
|
|
141
|
+
_userName = value;
|
|
142
|
+
};
|
|
143
|
+
var _setSysVer = function (value) {
|
|
144
|
+
_userVer = value;
|
|
145
|
+
};
|
|
146
|
+
var _getSysName = function () {
|
|
147
|
+
return _userName || _name;
|
|
148
|
+
};
|
|
149
|
+
var _getSysVer = function () {
|
|
150
|
+
return _userVer || _ver;
|
|
151
|
+
};
|
|
152
|
+
var unloadHook = onConfigChange(propertiesConfig, function () {
|
|
153
|
+
_config = propertiesConfig || {};
|
|
154
|
+
// if populateOperatingSystemInfo is set to false, previous name and ver will be used
|
|
155
|
+
if (_config.populateOperatingSystemInfo) {
|
|
156
|
+
var theNav = getNavigator() || {};
|
|
157
|
+
var userAgent = propertiesConfig.userAgent || theNav.userAgent || "";
|
|
158
|
+
var userAgentDataPlatform = (propertiesConfig.userAgentData || {}).platform || (theNav.userAgentData || {}).platform;
|
|
159
|
+
if (userAgent) {
|
|
160
|
+
var osName = _getOsName(userAgent.toLowerCase());
|
|
161
|
+
_name = osName;
|
|
162
|
+
_ver = _getOsVersion(userAgent, osName);
|
|
163
|
+
}
|
|
164
|
+
if ((!_name || _name === UNKNOWN) && isString(userAgentDataPlatform)) {
|
|
165
|
+
_name = userAgentDataPlatform;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
});
|
|
169
|
+
unloadHookContainer && unloadHookContainer.add(unloadHook);
|
|
170
|
+
objDefine(self, "name", { s: _setSysName, g: _getSysName });
|
|
171
|
+
objDefine(self, "ver", { s: _setSysVer, g: _getSysVer });
|
|
172
|
+
}
|
|
173
|
+
return OperatingSystem;
|
|
174
|
+
}());
|
|
175
|
+
export { OperatingSystem };
|
|
176
|
+
//# sourceMappingURL=OperatingSystem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OperatingSystem.js.map","sources":["OperatingSystem.js"],"sourcesContent":["/**\r\n* OperatingSystem.ts\r\n* @author Hector Hernandez (hectorh)\r\n* @copyright Microsoft 2019\r\n*/\r\nimport { getNavigator, isString, onConfigChange } from \"@microsoft/1ds-core-js\";\r\nimport { objDefine } from \"@nevware21/ts-utils\";\r\nvar OSNAMEREGEX = {\r\n WIN: /(windows|win32)/i,\r\n WINRT: / arm;/i,\r\n WINPHONE: /windows\\sphone\\s\\d+\\.\\d+/i,\r\n OSX: /(macintosh|mac os x)/i,\r\n IOS: /(ipad|iphone|ipod)(?=.*like mac os x)/i,\r\n LINUX: /(linux|joli|[kxln]?ubuntu|debian|[open]*suse|gentoo|arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk)/i,\r\n ANDROID: /android/i,\r\n CROS: /CrOS/i\r\n};\r\nvar VERSION_MAPPINGS = {\r\n \"5.1\": \"XP\",\r\n \"6.0\": \"Vista\",\r\n \"6.1\": \"7\",\r\n \"6.2\": \"8\",\r\n \"6.3\": \"8.1\",\r\n \"10.0\": \"10\"\r\n};\r\nvar REGEX_VERSION = \"([\\\\d,.]+)\";\r\nvar REGEX_VERSION_MAC = \"([\\\\d,_,.]+)\";\r\nvar UNKNOWN = \"Unknown\";\r\nvar OSNAMES = [\r\n { r: OSNAMEREGEX.WINPHONE, os: \"Windows Phone\" },\r\n { r: OSNAMEREGEX.WINRT, os: \"Windows RT\" },\r\n { r: OSNAMEREGEX.WIN, os: \"Windows\" /* OPERATING_SYSTEMS.WINDOWS */ },\r\n { r: OSNAMEREGEX.IOS, os: \"iOS\" /* OPERATING_SYSTEMS.IOS */ },\r\n { r: OSNAMEREGEX.ANDROID, os: \"Android\" /* OPERATING_SYSTEMS.ANDROID */ },\r\n { r: OSNAMEREGEX.LINUX, os: \"Linux\" },\r\n { r: OSNAMEREGEX.CROS, os: \"Chrome OS\" },\r\n { s: \"x11\", os: \"Unix\" },\r\n { s: \"blackberry\", os: \"BlackBerry\" },\r\n { s: \"symbian\", os: \"Symbian\" },\r\n { s: \"nokia\", os: \"Nokia\" },\r\n { r: OSNAMEREGEX.OSX, os: \"Mac OS X\" /* OPERATING_SYSTEMS.MACOSX */ }\r\n];\r\nvar strSetSysName = \"setSysName\";\r\nvar strSetSysVer = \"setSysVer\";\r\nvar strGetSysName = \"getSysName\";\r\nvar strGetSysVer = \"getSysVer\";\r\nfunction _getOsName(lowerCaseUserAgent) {\r\n for (var lp = 0; lp < OSNAMES.length; lp++) {\r\n var match = OSNAMES[lp];\r\n if (match.r && lowerCaseUserAgent.match(match.r)) {\r\n return match.os;\r\n }\r\n else if (match.s && lowerCaseUserAgent.indexOf(match.s) !== -1) {\r\n return match.os;\r\n }\r\n }\r\n return UNKNOWN;\r\n}\r\nfunction _getOsVersion(userAgent, osName) {\r\n if (osName === \"Windows\" /* OPERATING_SYSTEMS.WINDOWS */) {\r\n return _getGenericOsVersion(userAgent, \"Windows NT\");\r\n }\r\n if (osName === \"Android\" /* OPERATING_SYSTEMS.ANDROID */) {\r\n return _getGenericOsVersion(userAgent, osName);\r\n }\r\n if (osName === \"Mac OS X\" /* OPERATING_SYSTEMS.MACOSX */) {\r\n return _getMacOsxVersion(userAgent);\r\n }\r\n if (osName === \"iOS\" /* OPERATING_SYSTEMS.IOS */) {\r\n return _getIosVersion(userAgent);\r\n }\r\n return UNKNOWN;\r\n}\r\nfunction _getGenericOsVersion(userAgent, osName) {\r\n var ntVersionMatches = userAgent.match(new RegExp(osName + \" \" + REGEX_VERSION));\r\n if (ntVersionMatches) {\r\n if (VERSION_MAPPINGS[ntVersionMatches[1]]) {\r\n return VERSION_MAPPINGS[ntVersionMatches[1]];\r\n }\r\n return ntVersionMatches[1];\r\n }\r\n return UNKNOWN;\r\n}\r\nfunction _getMacOsxVersion(userAgent) {\r\n var macOsxVersionInUserAgentMatches = userAgent.match(new RegExp(\"Mac OS X\" /* OPERATING_SYSTEMS.MACOSX */ + \" \" + REGEX_VERSION_MAC));\r\n if (macOsxVersionInUserAgentMatches) {\r\n var versionString = macOsxVersionInUserAgentMatches[1].replace(/_/g, \".\");\r\n if (versionString) {\r\n var delimiter = _getDelimiter(versionString);\r\n if (delimiter) {\r\n var components = versionString.split(delimiter);\r\n return components[0];\r\n }\r\n else {\r\n return versionString;\r\n }\r\n }\r\n }\r\n return UNKNOWN;\r\n}\r\nfunction _getIosVersion(userAgent) {\r\n var iosVersionInUserAgentMatches = userAgent.match(new RegExp(\"OS \" + REGEX_VERSION_MAC));\r\n if (iosVersionInUserAgentMatches) {\r\n var versionString = iosVersionInUserAgentMatches[1].replace(/_/g, \".\");\r\n if (versionString) {\r\n var delimiter = _getDelimiter(versionString);\r\n if (delimiter) {\r\n var components = versionString.split(delimiter);\r\n return components[0];\r\n }\r\n else {\r\n return versionString;\r\n }\r\n }\r\n }\r\n return UNKNOWN;\r\n}\r\nfunction _getDelimiter(versionString) {\r\n if (versionString.indexOf(\".\") > -1) {\r\n return \".\";\r\n }\r\n if (versionString.indexOf(\"_\") > -1) {\r\n return \"_\";\r\n }\r\n return null;\r\n}\r\nvar OperatingSystem = /** @class */ (function () {\r\n function OperatingSystem(propertiesConfig, unloadHookContainer) {\r\n var self = this;\r\n var _config;\r\n var _name = null;\r\n var _ver = null;\r\n var _userName = null; // save user defined name. If defined, this value will overwrite dynamic config values\r\n var _userVer = null; // save user defined ver. If defined, this value will overwrite dynamic config values\r\n var _setSysName = function (value) {\r\n _userName = value;\r\n };\r\n var _setSysVer = function (value) {\r\n _userVer = value;\r\n };\r\n var _getSysName = function () {\r\n return _userName || _name;\r\n };\r\n var _getSysVer = function () {\r\n return _userVer || _ver;\r\n };\r\n var unloadHook = onConfigChange(propertiesConfig, function () {\r\n _config = propertiesConfig || {};\r\n // if populateOperatingSystemInfo is set to false, previous name and ver will be used\r\n if (_config.populateOperatingSystemInfo) {\r\n var theNav = getNavigator() || {};\r\n var userAgent = propertiesConfig.userAgent || theNav.userAgent || \"\";\r\n var userAgentDataPlatform = (propertiesConfig.userAgentData || {}).platform || (theNav.userAgentData || {}).platform;\r\n if (userAgent) {\r\n var osName = _getOsName(userAgent.toLowerCase());\r\n _name = osName;\r\n _ver = _getOsVersion(userAgent, osName);\r\n }\r\n if ((!_name || _name === UNKNOWN) && isString(userAgentDataPlatform)) {\r\n _name = userAgentDataPlatform;\r\n }\r\n }\r\n });\r\n unloadHookContainer && unloadHookContainer.add(unloadHook);\r\n objDefine(self, \"name\", { s: _setSysName, g: _getSysName });\r\n objDefine(self, \"ver\", { s: _setSysVer, g: _getSysVer });\r\n }\r\n return OperatingSystem;\r\n}());\r\nexport { OperatingSystem };\r\n//# sourceMappingURL=OperatingSystem.js.map"],"names":[],"mappings":";;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* 1DS JS SDK Properties plugin, 4.3.9
|
|
3
|
+
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
|
+
* (Microsoft Internal Only)
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Sdk.ts
|
|
8
|
+
* @author Hector Hernandez (hectorh)
|
|
9
|
+
* @copyright Microsoft 2019
|
|
10
|
+
*/
|
|
11
|
+
import dynamicProto from "@microsoft/dynamicproto-js";
|
|
12
|
+
import { getCookieValue, newGuid, onConfigChange, random32 } from "@microsoft/1ds-core-js";
|
|
13
|
+
var DEVICE_ID_COOKIE = "MicrosoftApplicationsTelemetryDeviceId";
|
|
14
|
+
function _saveData(mgr, propertyStorage, name, value) {
|
|
15
|
+
if (propertyStorage) {
|
|
16
|
+
propertyStorage.setProperty(name, value);
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
// Expires in 365 days (365 * 24 * 60 * 60)
|
|
20
|
+
mgr.set(name, value, 31536000);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
function _getData(mgr, propertyStorage, name) {
|
|
24
|
+
if (propertyStorage) {
|
|
25
|
+
return propertyStorage.getProperty(name) || "";
|
|
26
|
+
}
|
|
27
|
+
return getCookieValue(mgr, name);
|
|
28
|
+
}
|
|
29
|
+
var Sdk = /** @class */ (function () {
|
|
30
|
+
function Sdk(coreConfig, core, unloadHookContainer) {
|
|
31
|
+
var _sequenceId = 0;
|
|
32
|
+
var _cookieMgr;
|
|
33
|
+
dynamicProto(Sdk, this, function (_self) {
|
|
34
|
+
// Start sequence
|
|
35
|
+
_self.seq = _sequenceId;
|
|
36
|
+
_self.epoch = random32(false).toString();
|
|
37
|
+
_self.getSequenceId = function () {
|
|
38
|
+
return ++_sequenceId;
|
|
39
|
+
};
|
|
40
|
+
var unloadHook = onConfigChange(coreConfig, function (details) {
|
|
41
|
+
_cookieMgr = core && core.getCookieMgr();
|
|
42
|
+
var coreConfig = details.cfg;
|
|
43
|
+
var propertyStorage = coreConfig.propertyStorageOverride;
|
|
44
|
+
var cookieMgrEnabled = _cookieMgr.isEnabled();
|
|
45
|
+
if (cookieMgrEnabled || propertyStorage) {
|
|
46
|
+
// Only collect device id if it can be stored
|
|
47
|
+
var deviceId = _getData(_cookieMgr, propertyStorage, DEVICE_ID_COOKIE);
|
|
48
|
+
if (!deviceId) {
|
|
49
|
+
deviceId = newGuid();
|
|
50
|
+
}
|
|
51
|
+
_saveData(_cookieMgr, propertyStorage, DEVICE_ID_COOKIE, deviceId);
|
|
52
|
+
_self.installId = deviceId;
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
_cookieMgr.purge(DEVICE_ID_COOKIE);
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
unloadHookContainer && unloadHookContainer.add(unloadHook);
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
// Get seq value
|
|
62
|
+
// Removed Stub for Sdk.prototype.getSequenceId.
|
|
63
|
+
// This is a workaround for an IE8 bug when using dynamicProto() with classes that don't have any
|
|
64
|
+
// non-dynamic functions or static properties/functions when using uglify-js to minify the resulting code.
|
|
65
|
+
// this will be removed when ES3 support is dropped.
|
|
66
|
+
Sdk.__ieDyn=1;
|
|
67
|
+
|
|
68
|
+
return Sdk;
|
|
69
|
+
}());
|
|
70
|
+
export { Sdk };
|
|
71
|
+
//# sourceMappingURL=Sdk.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Sdk.js.map","sources":["Sdk.js"],"sourcesContent":["/**\r\n* Sdk.ts\r\n* @author Hector Hernandez (hectorh)\r\n* @copyright Microsoft 2019\r\n*/\r\nimport dynamicProto from \"@microsoft/dynamicproto-js\";\r\nimport { getCookieValue, newGuid, onConfigChange, random32 } from \"@microsoft/1ds-core-js\";\r\nvar DEVICE_ID_COOKIE = \"MicrosoftApplicationsTelemetryDeviceId\";\r\nfunction _saveData(mgr, propertyStorage, name, value) {\r\n if (propertyStorage) {\r\n propertyStorage.setProperty(name, value);\r\n }\r\n else {\r\n // Expires in 365 days (365 * 24 * 60 * 60)\r\n mgr.set(name, value, 31536000);\r\n }\r\n}\r\nfunction _getData(mgr, propertyStorage, name) {\r\n if (propertyStorage) {\r\n return propertyStorage.getProperty(name) || \"\";\r\n }\r\n return getCookieValue(mgr, name);\r\n}\r\nvar Sdk = /** @class */ (function () {\r\n function Sdk(coreConfig, core, unloadHookContainer) {\r\n var _sequenceId = 0;\r\n var _cookieMgr;\r\n dynamicProto(Sdk, this, function (_self) {\r\n // Start sequence\r\n _self.seq = _sequenceId;\r\n _self.epoch = random32(false).toString();\r\n _self.getSequenceId = function () {\r\n return ++_sequenceId;\r\n };\r\n var unloadHook = onConfigChange(coreConfig, function (details) {\r\n _cookieMgr = core && core.getCookieMgr();\r\n var coreConfig = details.cfg;\r\n var propertyStorage = coreConfig.propertyStorageOverride;\r\n var cookieMgrEnabled = _cookieMgr.isEnabled();\r\n if (cookieMgrEnabled || propertyStorage) {\r\n // Only collect device id if it can be stored\r\n var deviceId = _getData(_cookieMgr, propertyStorage, DEVICE_ID_COOKIE);\r\n if (!deviceId) {\r\n deviceId = newGuid();\r\n }\r\n _saveData(_cookieMgr, propertyStorage, DEVICE_ID_COOKIE, deviceId);\r\n _self.installId = deviceId;\r\n }\r\n else {\r\n _cookieMgr.purge(DEVICE_ID_COOKIE);\r\n }\r\n });\r\n unloadHookContainer && unloadHookContainer.add(unloadHook);\r\n });\r\n }\r\n // Get seq value\r\n Sdk.prototype.getSequenceId = function () {\r\n // @DynamicProtoStub - DO NOT add any code as this will be removed during packaging\r\n return -1;\r\n };\r\n return Sdk;\r\n}());\r\nexport { Sdk };\r\n//# sourceMappingURL=Sdk.js.map"],"names":[],"mappings":";;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAGM,CAAC;;;;;;eACQ;AACf;AACA;AACA"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* 1DS JS SDK Properties plugin, 4.3.9
|
|
3
|
+
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
|
+
* (Microsoft Internal Only)
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Session.ts
|
|
8
|
+
* @copyright Microsoft 2019
|
|
9
|
+
*/
|
|
10
|
+
import dynamicProto from "@microsoft/dynamicproto-js";
|
|
11
|
+
import { isString } from "@microsoft/1ds-core-js";
|
|
12
|
+
import { objDefine } from "@nevware21/ts-utils";
|
|
13
|
+
function _getId() {
|
|
14
|
+
return this.getId();
|
|
15
|
+
}
|
|
16
|
+
function _setId(id) {
|
|
17
|
+
this.setId(id);
|
|
18
|
+
}
|
|
19
|
+
var Session = /** @class */ (function () {
|
|
20
|
+
function Session() {
|
|
21
|
+
dynamicProto(Session, this, function (_self) {
|
|
22
|
+
_self.setId = function (id) {
|
|
23
|
+
_self.customId = id;
|
|
24
|
+
};
|
|
25
|
+
_self.getId = function () {
|
|
26
|
+
if (isString(_self.customId)) {
|
|
27
|
+
return _self.customId;
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
return _self.automaticId;
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
// Removed Stub for Session.prototype.setId.
|
|
36
|
+
// Removed Stub for Session.prototype.getId.
|
|
37
|
+
/**
|
|
38
|
+
* Static constructor, attempt to create accessors
|
|
39
|
+
*/
|
|
40
|
+
Session._staticInit = (function () {
|
|
41
|
+
// Dynamically create get/set property accessors
|
|
42
|
+
objDefine(Session.prototype, "id", { g: _getId, s: _setId }); // change this
|
|
43
|
+
})();
|
|
44
|
+
return Session;
|
|
45
|
+
}());
|
|
46
|
+
export { Session };
|
|
47
|
+
//# sourceMappingURL=Session.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Session.js.map","sources":["Session.js"],"sourcesContent":["/**\r\n* Session.ts\r\n* @copyright Microsoft 2019\r\n*/\r\nimport dynamicProto from \"@microsoft/dynamicproto-js\";\r\nimport { isString } from \"@microsoft/1ds-core-js\";\r\nimport { objDefine } from \"@nevware21/ts-utils\";\r\nfunction _getId() {\r\n return this.getId();\r\n}\r\nfunction _setId(id) {\r\n this.setId(id);\r\n}\r\nvar Session = /** @class */ (function () {\r\n function Session() {\r\n dynamicProto(Session, this, function (_self) {\r\n _self.setId = function (id) {\r\n _self.customId = id;\r\n };\r\n _self.getId = function () {\r\n if (isString(_self.customId)) {\r\n return _self.customId;\r\n }\r\n else {\r\n return _self.automaticId;\r\n }\r\n };\r\n });\r\n }\r\n Session.prototype.setId = function (id) {\r\n // @DynamicProtoStub - DO NOT add any code as this will be removed during packaging\r\n };\r\n Session.prototype.getId = function () {\r\n // @DynamicProtoStub - DO NOT add any code as this will be removed during packaging\r\n return null;\r\n };\r\n /**\r\n * Static constructor, attempt to create accessors\r\n */\r\n Session._staticInit = (function () {\r\n // Dynamically create get/set property accessors\r\n objDefine(Session.prototype, \"id\", { g: _getId, s: _setId }); // change this\r\n })();\r\n return Session;\r\n}());\r\nexport { Session };\r\n//# sourceMappingURL=Session.js.map"],"names":[],"mappings":";;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;4CAMM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* 1DS JS SDK Properties plugin, 4.3.9
|
|
3
|
+
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
|
+
* (Microsoft Internal Only)
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* AITrace.ts
|
|
8
|
+
* @author Hector Hernandez (hectorh)
|
|
9
|
+
* @copyright Microsoft 2019
|
|
10
|
+
*/
|
|
11
|
+
import { generateW3CId, getLocation, onConfigChange } from "@microsoft/1ds-core-js";
|
|
12
|
+
var Trace = /** @class */ (function () {
|
|
13
|
+
function Trace(propertiesConfig, id, parentId, name, unloadHookContainer) {
|
|
14
|
+
var self = this;
|
|
15
|
+
self.traceId = id || generateW3CId();
|
|
16
|
+
var unloadHook = onConfigChange(propertiesConfig, function () {
|
|
17
|
+
var _config = propertiesConfig;
|
|
18
|
+
if (_config.enableDistributedTracing && !parentId) {
|
|
19
|
+
// When dt is enabled, both the traceId and spanId are required
|
|
20
|
+
parentId = generateW3CId().substring(0, 16);
|
|
21
|
+
}
|
|
22
|
+
self.parentId = self.parentId || parentId; // change parentId only if it was not set previously
|
|
23
|
+
if (_config.enableApplicationInsightsTrace && !name) {
|
|
24
|
+
var loc = getLocation();
|
|
25
|
+
if (loc && loc.pathname) {
|
|
26
|
+
name = loc.pathname;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
self.name = self.name || name; // change name only if it was not set previously
|
|
30
|
+
});
|
|
31
|
+
unloadHookContainer && unloadHookContainer.add(unloadHook);
|
|
32
|
+
}
|
|
33
|
+
return Trace;
|
|
34
|
+
}());
|
|
35
|
+
export { Trace };
|
|
36
|
+
//# sourceMappingURL=Trace.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Trace.js.map","sources":["Trace.js"],"sourcesContent":["/**\r\n* AITrace.ts\r\n* @author Hector Hernandez (hectorh)\r\n* @copyright Microsoft 2019\r\n*/\r\nimport { generateW3CId, getLocation, onConfigChange } from \"@microsoft/1ds-core-js\";\r\nvar Trace = /** @class */ (function () {\r\n function Trace(propertiesConfig, id, parentId, name, unloadHookContainer) {\r\n var self = this;\r\n self.traceId = id || generateW3CId();\r\n var unloadHook = onConfigChange(propertiesConfig, function () {\r\n var _config = propertiesConfig;\r\n if (_config.enableDistributedTracing && !parentId) {\r\n // When dt is enabled, both the traceId and spanId are required\r\n parentId = generateW3CId().substring(0, 16);\r\n }\r\n self.parentId = self.parentId || parentId; // change parentId only if it was not set previously\r\n if (_config.enableApplicationInsightsTrace && !name) {\r\n var loc = getLocation();\r\n if (loc && loc.pathname) {\r\n name = loc.pathname;\r\n }\r\n }\r\n self.name = self.name || name; // change name only if it was not set previously\r\n });\r\n unloadHookContainer && unloadHookContainer.add(unloadHook);\r\n }\r\n return Trace;\r\n}());\r\nexport { Trace };\r\n//# sourceMappingURL=Trace.js.map"],"names":[],"mappings":";;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* 1DS JS SDK Properties plugin, 4.3.9
|
|
3
|
+
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
|
+
* (Microsoft Internal Only)
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* User.ts
|
|
8
|
+
* @author Hector Hernandez (hectorh)
|
|
9
|
+
* @copyright Microsoft 2019
|
|
10
|
+
*/
|
|
11
|
+
import dynamicProto from "@microsoft/dynamicproto-js";
|
|
12
|
+
import { getCookieValue, getISOString, isUndefined, newId, onConfigChange } from "@microsoft/1ds-core-js";
|
|
13
|
+
import { objDefine } from "@nevware21/ts-utils";
|
|
14
|
+
var strSetLocalId = "setLocalId";
|
|
15
|
+
function _getLocalId() {
|
|
16
|
+
return this.getLocalId();
|
|
17
|
+
}
|
|
18
|
+
function _setLocalId(value) {
|
|
19
|
+
this[strSetLocalId](value);
|
|
20
|
+
}
|
|
21
|
+
var User = /** @class */ (function () {
|
|
22
|
+
function User(coreConfig, propertiesConfig, core, unloadHookContainer) {
|
|
23
|
+
var _propertiesConfig;
|
|
24
|
+
var _customLocalId;
|
|
25
|
+
var _cookieMgr;
|
|
26
|
+
dynamicProto(User, this, function (_self) {
|
|
27
|
+
_populateDefaults(propertiesConfig);
|
|
28
|
+
// Add user language
|
|
29
|
+
if (typeof navigator !== "undefined") {
|
|
30
|
+
var nav = navigator;
|
|
31
|
+
_self.locale = nav.userLanguage || nav.language;
|
|
32
|
+
}
|
|
33
|
+
_self.getLocalId = function () {
|
|
34
|
+
if (_customLocalId) {
|
|
35
|
+
return _customLocalId;
|
|
36
|
+
}
|
|
37
|
+
return _populateMuidFromCookie();
|
|
38
|
+
};
|
|
39
|
+
_self[strSetLocalId] = function (value) {
|
|
40
|
+
_customLocalId = value;
|
|
41
|
+
};
|
|
42
|
+
function _populateMuidFromCookie() {
|
|
43
|
+
// Only add default local ID is hash or drop config are not enabled
|
|
44
|
+
if (!_propertiesConfig.hashIdentifiers && !_propertiesConfig.dropIdentifiers) {
|
|
45
|
+
var muidValue = getCookieValue(_cookieMgr, "MUID");
|
|
46
|
+
if (muidValue) {
|
|
47
|
+
_customLocalId = "t:" + muidValue;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return _customLocalId;
|
|
51
|
+
}
|
|
52
|
+
function _populateDefaults(config) {
|
|
53
|
+
// This function will be re-called whenever any referenced configuration is changed
|
|
54
|
+
var unloadHook = onConfigChange(config, function () {
|
|
55
|
+
_cookieMgr = core && core.getCookieMgr();
|
|
56
|
+
_propertiesConfig = config;
|
|
57
|
+
// reset it since this value is dependent on cookieMgr, config.hashIdentifiers and config.dropIdentifiers
|
|
58
|
+
_customLocalId = null;
|
|
59
|
+
if (_cookieMgr && _cookieMgr.isEnabled()) {
|
|
60
|
+
_populateMuidFromCookie();
|
|
61
|
+
if (_propertiesConfig.enableApplicationInsightsUser) {
|
|
62
|
+
// get userId or create new one if none exists
|
|
63
|
+
var aiUser = getCookieValue(_cookieMgr, User.userCookieName);
|
|
64
|
+
if (aiUser) {
|
|
65
|
+
var params = aiUser.split(User.cookieSeparator);
|
|
66
|
+
if (params.length > 0) {
|
|
67
|
+
_self.id = params[0];
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
if (!_self.id) {
|
|
71
|
+
_self.id = newId((coreConfig && !isUndefined(coreConfig.idLength)) ? coreConfig.idLength : 22);
|
|
72
|
+
var acqStr = getISOString(new Date());
|
|
73
|
+
_self.accountAcquisitionDate = acqStr;
|
|
74
|
+
// without expiration, cookies expire at the end of the session
|
|
75
|
+
// set it to 365 days from now
|
|
76
|
+
// 365 * 24 * 60 * 60 * 1000 = 31536000
|
|
77
|
+
var newCookie = [_self.id, acqStr];
|
|
78
|
+
var cookieDomain = _propertiesConfig.cookieDomain ? _propertiesConfig.cookieDomain : undefined;
|
|
79
|
+
_cookieMgr.set(User.userCookieName, newCookie.join(User.cookieSeparator), 31536000, cookieDomain);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
unloadHookContainer && unloadHookContainer.add(unloadHook);
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
// Removed Stub for User.prototype.getLocalId.
|
|
89
|
+
// Removed Stub for User.prototype.setLocalId.
|
|
90
|
+
User.cookieSeparator = "|";
|
|
91
|
+
User.userCookieName = "ai_user";
|
|
92
|
+
/**
|
|
93
|
+
* Static constructor, attempt to create accessors
|
|
94
|
+
*/
|
|
95
|
+
User._staticInit = (function () {
|
|
96
|
+
// Dynamically create get/set property accessors
|
|
97
|
+
objDefine(User.prototype, "localId", { g: _getLocalId, s: _setLocalId });
|
|
98
|
+
})();
|
|
99
|
+
return User;
|
|
100
|
+
}());
|
|
101
|
+
export { User };
|
|
102
|
+
//# sourceMappingURL=User.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"User.js.map","sources":["User.js"],"sourcesContent":["/**\r\n* User.ts\r\n* @author Hector Hernandez (hectorh)\r\n* @copyright Microsoft 2019\r\n*/\r\nimport dynamicProto from \"@microsoft/dynamicproto-js\";\r\nimport { getCookieValue, getISOString, isUndefined, newId, onConfigChange } from \"@microsoft/1ds-core-js\";\r\nimport { objDefine } from \"@nevware21/ts-utils\";\r\nvar strSetLocalId = \"setLocalId\";\r\nfunction _getLocalId() {\r\n return this.getLocalId();\r\n}\r\nfunction _setLocalId(value) {\r\n this[strSetLocalId](value);\r\n}\r\nvar User = /** @class */ (function () {\r\n function User(coreConfig, propertiesConfig, core, unloadHookContainer) {\r\n var _propertiesConfig;\r\n var _customLocalId;\r\n var _cookieMgr;\r\n dynamicProto(User, this, function (_self) {\r\n _populateDefaults(propertiesConfig);\r\n // Add user language\r\n if (typeof navigator !== \"undefined\") {\r\n var nav = navigator;\r\n _self.locale = nav.userLanguage || nav.language;\r\n }\r\n _self.getLocalId = function () {\r\n if (_customLocalId) {\r\n return _customLocalId;\r\n }\r\n return _populateMuidFromCookie();\r\n };\r\n _self[strSetLocalId] = function (value) {\r\n _customLocalId = value;\r\n };\r\n function _populateMuidFromCookie() {\r\n // Only add default local ID is hash or drop config are not enabled\r\n if (!_propertiesConfig.hashIdentifiers && !_propertiesConfig.dropIdentifiers) {\r\n var muidValue = getCookieValue(_cookieMgr, \"MUID\");\r\n if (muidValue) {\r\n _customLocalId = \"t:\" + muidValue;\r\n }\r\n }\r\n return _customLocalId;\r\n }\r\n function _populateDefaults(config) {\r\n // This function will be re-called whenever any referenced configuration is changed\r\n var unloadHook = onConfigChange(config, function () {\r\n _cookieMgr = core && core.getCookieMgr();\r\n _propertiesConfig = config;\r\n // reset it since this value is dependent on cookieMgr, config.hashIdentifiers and config.dropIdentifiers\r\n _customLocalId = null;\r\n if (_cookieMgr && _cookieMgr.isEnabled()) {\r\n _populateMuidFromCookie();\r\n if (_propertiesConfig.enableApplicationInsightsUser) {\r\n // get userId or create new one if none exists\r\n var aiUser = getCookieValue(_cookieMgr, User.userCookieName);\r\n if (aiUser) {\r\n var params = aiUser.split(User.cookieSeparator);\r\n if (params.length > 0) {\r\n _self.id = params[0];\r\n }\r\n }\r\n if (!_self.id) {\r\n _self.id = newId((coreConfig && !isUndefined(coreConfig.idLength)) ? coreConfig.idLength : 22);\r\n var acqStr = getISOString(new Date());\r\n _self.accountAcquisitionDate = acqStr;\r\n // without expiration, cookies expire at the end of the session\r\n // set it to 365 days from now\r\n // 365 * 24 * 60 * 60 * 1000 = 31536000\r\n var newCookie = [_self.id, acqStr];\r\n var cookieDomain = _propertiesConfig.cookieDomain ? _propertiesConfig.cookieDomain : undefined;\r\n _cookieMgr.set(User.userCookieName, newCookie.join(User.cookieSeparator), 31536000, cookieDomain);\r\n }\r\n }\r\n }\r\n });\r\n unloadHookContainer && unloadHookContainer.add(unloadHook);\r\n }\r\n });\r\n }\r\n /**\r\n * The userId as known by the logging library.\r\n */\r\n User.prototype.getLocalId = function () {\r\n // @DynamicProtoStub - DO NOT add any code as this will be removed during packaging\r\n return undefined;\r\n };\r\n User.prototype.setLocalId = function (value) {\r\n // @DynamicProtoStub - DO NOT add any code as this will be removed during packaging\r\n };\r\n User.cookieSeparator = \"|\";\r\n User.userCookieName = \"ai_user\";\r\n /**\r\n * Static constructor, attempt to create accessors\r\n */\r\n User._staticInit = (function () {\r\n // Dynamically create get/set property accessors\r\n objDefine(User.prototype, \"localId\", { g: _getLocalId, s: _setLocalId });\r\n })();\r\n return User;\r\n}());\r\nexport { User };\r\n//# sourceMappingURL=User.js.map"],"names":[],"mappings":";;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;8CASM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA"}
|