ofsc-utility 1.0.16 → 1.0.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +8 -1
- package/dist/index.js +13 -2
- package/dist/metadata/activityTypeGroup.d.ts +4 -0
- package/dist/metadata/activityTypeGroup.js +45 -0
- package/dist/metadata/activityTypes.d.ts +3 -0
- package/dist/metadata/activityTypes.js +74 -0
- package/dist/metadata/applictaionsIntegration.d.ts +7 -0
- package/dist/metadata/applictaionsIntegration.js +81 -0
- package/dist/metadata/capacity.d.ts +4 -0
- package/dist/metadata/capacity.js +58 -0
- package/dist/metadata/capacityCategories.d.ts +4 -0
- package/dist/metadata/capacityCategories.js +48 -0
- package/dist/metadata/form.d.ts +4 -0
- package/dist/metadata/form.js +30 -0
- package/dist/metadata/index.d.ts +1 -0
- package/dist/metadata/index.js +78 -0
- package/dist/metadata/inventoryTypes.d.ts +4 -0
- package/dist/metadata/inventoryTypes.js +45 -0
- package/dist/metadata/languages.d.ts +4 -0
- package/dist/metadata/languages.js +33 -0
- package/dist/metadata/nonWorkingReasons.d.ts +4 -0
- package/dist/metadata/nonWorkingReasons.js +32 -0
- package/dist/metadata/properties.d.ts +4 -0
- package/dist/metadata/properties.js +45 -0
- package/dist/metadata/resourceTypes.d.ts +4 -0
- package/dist/metadata/resourceTypes.js +33 -0
- package/dist/metadata/shifts.d.ts +4 -0
- package/dist/metadata/shifts.js +35 -0
- package/dist/metadata/timeSlots.d.ts +4 -0
- package/dist/metadata/timeSlots.js +35 -0
- package/dist/metadata/workSkillConditions.d.ts +6 -0
- package/dist/metadata/workSkillConditions.js +87 -0
- package/dist/metadata/workSkills.d.ts +4 -0
- package/dist/metadata/workSkills.js +35 -0
- package/dist/metadata/workZoneKey.d.ts +4 -0
- package/dist/metadata/workZoneKey.js +44 -0
- package/dist/metadata/workZones.d.ts +4 -0
- package/dist/metadata/workZones.js +31 -0
- package/dist/resources/index.d.ts +5 -0
- package/dist/resources/index.js +27 -0
- package/dist/utilities/index.d.ts +4 -0
- package/dist/utilities/index.js +156 -0
- package/package.json +4 -2
- package/readme.md +5 -4
- package/dist/ofsc-utility.esm.js +0 -3411
- package/dist/ofsc-utility.esm.js.map +0 -1
- package/dist/ofsc-utility.min.js +0 -1
- package/dist/ofsc-utility.min.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export * as ActivityInventories from './activityInventories';
|
|
|
3
3
|
export * as Events from './events';
|
|
4
4
|
export * as Inventory from './inventory';
|
|
5
5
|
export * as InventoryType from './inventoryTypes';
|
|
6
|
+
export * as CreateConfigurationFile from './metadata';
|
|
6
7
|
export * as OauthTokenService from './oauthTokenService';
|
|
7
8
|
export * as Resource from './resources';
|
|
8
9
|
export * as User from './users';
|
|
@@ -12,12 +13,14 @@ export * from './types';
|
|
|
12
13
|
export { generateAllOnHandInventoryOfAllResourcesCSV } from './inventory';
|
|
13
14
|
export { getOAuthToken } from './oauthTokenService';
|
|
14
15
|
export { downloadWorkZoneCSV } from './workZones';
|
|
15
|
-
export { downloadAllResourcesCSV } from './resources';
|
|
16
|
+
export { AllResources, downloadAllResourcesCSV, getworkSkillsOfResource } from './resources';
|
|
16
17
|
export { downloadAllUsersCSV, generateUsersCollaborationCSV } from './users';
|
|
17
18
|
export { downloadAllInventoryTypesCSV, getInventoryTypesDetail, updateCreateInventoryType } from './inventoryTypes';
|
|
18
19
|
export { getActivitybyId, getAllActivities } from './activities';
|
|
19
20
|
export { createActivityCustomerInventories, getActivityCustomerInventories } from './activityInventories';
|
|
20
21
|
export { downloadAllEventsOfDay, downloadAllEventsOfDayCSV } from './events';
|
|
22
|
+
export { createExcelFile } from './utilities';
|
|
23
|
+
export { createConfigurationFile } from './metadata';
|
|
21
24
|
declare const OfscUtility: {
|
|
22
25
|
getOAuthToken: any;
|
|
23
26
|
downloadWorkZoneCSV: any;
|
|
@@ -34,5 +37,9 @@ declare const OfscUtility: {
|
|
|
34
37
|
generateUsersCollaborationCSV: any;
|
|
35
38
|
generateAllOnHandInventoryOfAllResourcesCSV: any;
|
|
36
39
|
getActivitybyId: any;
|
|
40
|
+
AllResources: any;
|
|
41
|
+
getworkSkillsOfResource: any;
|
|
42
|
+
createExcelFile: any;
|
|
43
|
+
createConfigurationFile: any;
|
|
37
44
|
};
|
|
38
45
|
export default OfscUtility;
|
package/dist/index.js
CHANGED
|
@@ -36,13 +36,14 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
36
36
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.downloadAllEventsOfDayCSV = exports.downloadAllEventsOfDay = exports.getActivityCustomerInventories = exports.createActivityCustomerInventories = exports.getAllActivities = exports.getActivitybyId = exports.updateCreateInventoryType = exports.getInventoryTypesDetail = exports.downloadAllInventoryTypesCSV = exports.generateUsersCollaborationCSV = exports.downloadAllUsersCSV = exports.downloadAllResourcesCSV = exports.downloadWorkZoneCSV = exports.getOAuthToken = exports.generateAllOnHandInventoryOfAllResourcesCSV = exports.WorkZone = exports.Utilities = exports.User = exports.Resource = exports.OauthTokenService = exports.InventoryType = exports.Inventory = exports.Events = exports.ActivityInventories = exports.Activity = void 0;
|
|
39
|
+
exports.createConfigurationFile = exports.createExcelFile = exports.downloadAllEventsOfDayCSV = exports.downloadAllEventsOfDay = exports.getActivityCustomerInventories = exports.createActivityCustomerInventories = exports.getAllActivities = exports.getActivitybyId = exports.updateCreateInventoryType = exports.getInventoryTypesDetail = exports.downloadAllInventoryTypesCSV = exports.generateUsersCollaborationCSV = exports.downloadAllUsersCSV = exports.getworkSkillsOfResource = exports.downloadAllResourcesCSV = exports.AllResources = exports.downloadWorkZoneCSV = exports.getOAuthToken = exports.generateAllOnHandInventoryOfAllResourcesCSV = exports.WorkZone = exports.Utilities = exports.User = exports.Resource = exports.OauthTokenService = exports.CreateConfigurationFile = exports.InventoryType = exports.Inventory = exports.Events = exports.ActivityInventories = exports.Activity = void 0;
|
|
40
40
|
// Export all methods grouped by category
|
|
41
41
|
exports.Activity = __importStar(require("./activities"));
|
|
42
42
|
exports.ActivityInventories = __importStar(require("./activityInventories"));
|
|
43
43
|
exports.Events = __importStar(require("./events"));
|
|
44
44
|
exports.Inventory = __importStar(require("./inventory"));
|
|
45
45
|
exports.InventoryType = __importStar(require("./inventoryTypes"));
|
|
46
|
+
exports.CreateConfigurationFile = __importStar(require("./metadata"));
|
|
46
47
|
exports.OauthTokenService = __importStar(require("./oauthTokenService"));
|
|
47
48
|
exports.Resource = __importStar(require("./resources"));
|
|
48
49
|
exports.User = __importStar(require("./users"));
|
|
@@ -57,7 +58,9 @@ Object.defineProperty(exports, "getOAuthToken", { enumerable: true, get: functio
|
|
|
57
58
|
var workZones_1 = require("./workZones");
|
|
58
59
|
Object.defineProperty(exports, "downloadWorkZoneCSV", { enumerable: true, get: function () { return workZones_1.downloadWorkZoneCSV; } });
|
|
59
60
|
var resources_1 = require("./resources");
|
|
61
|
+
Object.defineProperty(exports, "AllResources", { enumerable: true, get: function () { return resources_1.AllResources; } });
|
|
60
62
|
Object.defineProperty(exports, "downloadAllResourcesCSV", { enumerable: true, get: function () { return resources_1.downloadAllResourcesCSV; } });
|
|
63
|
+
Object.defineProperty(exports, "getworkSkillsOfResource", { enumerable: true, get: function () { return resources_1.getworkSkillsOfResource; } });
|
|
61
64
|
var users_1 = require("./users");
|
|
62
65
|
Object.defineProperty(exports, "downloadAllUsersCSV", { enumerable: true, get: function () { return users_1.downloadAllUsersCSV; } });
|
|
63
66
|
Object.defineProperty(exports, "generateUsersCollaborationCSV", { enumerable: true, get: function () { return users_1.generateUsersCollaborationCSV; } });
|
|
@@ -74,6 +77,10 @@ Object.defineProperty(exports, "getActivityCustomerInventories", { enumerable: t
|
|
|
74
77
|
var events_1 = require("./events");
|
|
75
78
|
Object.defineProperty(exports, "downloadAllEventsOfDay", { enumerable: true, get: function () { return events_1.downloadAllEventsOfDay; } });
|
|
76
79
|
Object.defineProperty(exports, "downloadAllEventsOfDayCSV", { enumerable: true, get: function () { return events_1.downloadAllEventsOfDayCSV; } });
|
|
80
|
+
var utilities_1 = require("./utilities");
|
|
81
|
+
Object.defineProperty(exports, "createExcelFile", { enumerable: true, get: function () { return utilities_1.createExcelFile; } });
|
|
82
|
+
var metadata_1 = require("./metadata");
|
|
83
|
+
Object.defineProperty(exports, "createConfigurationFile", { enumerable: true, get: function () { return metadata_1.createConfigurationFile; } });
|
|
77
84
|
// Default export with all functionality
|
|
78
85
|
const OfscUtility = {
|
|
79
86
|
getOAuthToken: require('./oauthTokenService').getOAuthToken,
|
|
@@ -90,6 +97,10 @@ const OfscUtility = {
|
|
|
90
97
|
downloadAllEventsOfDay: require('./events').downloadAllEventsOfDay,
|
|
91
98
|
generateUsersCollaborationCSV: require('./users').generateUsersCollaborationCSV,
|
|
92
99
|
generateAllOnHandInventoryOfAllResourcesCSV: require('./inventory').generateAllOnHandInventoryOfAllResourcesCSV,
|
|
93
|
-
getActivitybyId: require('./activities').getActivitybyId
|
|
100
|
+
getActivitybyId: require('./activities').getActivitybyId,
|
|
101
|
+
AllResources: require('./activities').AllResources,
|
|
102
|
+
getworkSkillsOfResource: require('./resources').getworkSkillsOfResource,
|
|
103
|
+
createExcelFile: require('./utilities').createExcelFile,
|
|
104
|
+
createConfigurationFile: require('./metadata').createConfigurationFile
|
|
94
105
|
};
|
|
95
106
|
exports.default = OfscUtility;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getActivityTypesGroupsMetaData = getActivityTypesGroupsMetaData;
|
|
4
|
+
exports.transformData = transformData;
|
|
5
|
+
const utilities_1 = require("../utilities");
|
|
6
|
+
async function getActivityTypesGroupsMetaData(clientId, clientSecret, instanceUrl, token = "") {
|
|
7
|
+
let responsedata = [];
|
|
8
|
+
let offset = 0;
|
|
9
|
+
const limit = 100;
|
|
10
|
+
while (true) {
|
|
11
|
+
const url = `https://${instanceUrl}.fs.ocs.oraclecloud.com/rest/ofscMetadata/v1/activityTypeGroups?offset=${offset}&limit=${limit}`;
|
|
12
|
+
const res = await (0, utilities_1.fetchWithRetry)(url, clientId, clientSecret, instanceUrl, token);
|
|
13
|
+
token = res.token;
|
|
14
|
+
responsedata = [...responsedata, ...res.data.items];
|
|
15
|
+
if (!res.data.hasMore)
|
|
16
|
+
break;
|
|
17
|
+
offset = res.data.offset + limit;
|
|
18
|
+
}
|
|
19
|
+
const sheet = transformData(responsedata);
|
|
20
|
+
return sheet;
|
|
21
|
+
}
|
|
22
|
+
function transformData(data) {
|
|
23
|
+
const sheets = {};
|
|
24
|
+
// Sheet 1: Activity Type Groups Overview
|
|
25
|
+
const overview = data.map(d => ({
|
|
26
|
+
Label: d.label,
|
|
27
|
+
Name: d.name
|
|
28
|
+
}));
|
|
29
|
+
sheets['Activity Type Groups Overview'] = overview;
|
|
30
|
+
// Sheet 2: Activity Type Groups Activities
|
|
31
|
+
const activityTypes = [];
|
|
32
|
+
data.forEach(d => {
|
|
33
|
+
if (!Array.isArray(d.activityTypes))
|
|
34
|
+
return;
|
|
35
|
+
d.activityTypes.forEach((ts) => {
|
|
36
|
+
activityTypes.push({
|
|
37
|
+
"Activity Group Label": d.label,
|
|
38
|
+
"Activity Group Label Name": d.name,
|
|
39
|
+
'Activity Type': ts.label
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
sheets['Activity Type Groups Activities'] = activityTypes;
|
|
44
|
+
return sheets;
|
|
45
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getActivityTypesMetaData = getActivityTypesMetaData;
|
|
4
|
+
const utilities_1 = require("../utilities");
|
|
5
|
+
async function getActivityTypesMetaData(clientId, clientSecret, instanceUrl, token = "") {
|
|
6
|
+
let responsedata = [];
|
|
7
|
+
let offset = 0;
|
|
8
|
+
const limit = 100;
|
|
9
|
+
while (true) {
|
|
10
|
+
const url = `https://${instanceUrl}.fs.ocs.oraclecloud.com/rest/ofscMetadata/v1/activityTypes?offset=${offset}&limit=${limit}`;
|
|
11
|
+
const res = await (0, utilities_1.fetchWithRetry)(url, clientId, clientSecret, instanceUrl, token);
|
|
12
|
+
token = res.token;
|
|
13
|
+
responsedata = [...responsedata, ...res.data.items];
|
|
14
|
+
if (!res.data.hasMore)
|
|
15
|
+
break;
|
|
16
|
+
offset = res.data.offset + limit;
|
|
17
|
+
}
|
|
18
|
+
const sheet = transformData(responsedata);
|
|
19
|
+
return sheet;
|
|
20
|
+
}
|
|
21
|
+
function transformData(data) {
|
|
22
|
+
const sheets = {};
|
|
23
|
+
// Sheet 1: Activity Type Groups Overview
|
|
24
|
+
const overview = data.map(d => ({
|
|
25
|
+
"Label": d.label,
|
|
26
|
+
"Name": d.name,
|
|
27
|
+
"Status": d.active ? "Active" : "Inactive",
|
|
28
|
+
"Group Label": d.groupLabel,
|
|
29
|
+
"Default Duration": d.defaultDuration,
|
|
30
|
+
'Allow Mass Activities': d.features.allowMassActivities ? 'Active' : '',
|
|
31
|
+
'Teamwork Available': d.features.isTeamworkAvailable ? 'Active' : '',
|
|
32
|
+
'Segmenting Enabled': d.features.isSegmentingEnabled ? 'Active' : '',
|
|
33
|
+
'Allow Move Between Resources': d.features.allowMoveBetweenResources ? 'Active' : '',
|
|
34
|
+
'Allow Creation in Buckets': d.features.allowCreationInBuckets ? 'Active' : '',
|
|
35
|
+
'Allow Reschedule': d.features.allowReschedule ? 'Active' : '',
|
|
36
|
+
'Support Not Ordered Activities': d.features.supportOfNotOrderedActivities ? 'Active' : '',
|
|
37
|
+
'Allow Non-Scheduled Activities': d.features.allowNonScheduled ? 'Active' : '',
|
|
38
|
+
'Support Work Zones': d.features.supportOfWorkZones ? 'Active' : '',
|
|
39
|
+
'Support Work Skills': d.features.supportOfWorkSkills ? 'Active' : '',
|
|
40
|
+
'Support Time Slots': d.features.supportOfTimeSlots ? 'Active' : '',
|
|
41
|
+
'Support Inventory': d.features.supportOfInventory ? 'Active' : '',
|
|
42
|
+
'Support Links': d.features.supportOfLinks ? 'Active' : '',
|
|
43
|
+
'Support Preferred Resources': d.features.supportOfPreferredResources ? 'Active' : '',
|
|
44
|
+
'Allow Repeating Activities': d.features.allowRepeatingActivities ? 'Active' : '',
|
|
45
|
+
'Calculate Travel': d.features.calculateTravel ? 'Active' : '',
|
|
46
|
+
'Calculate Activity Duration Using Statistics': d.features.calculateActivityDurationUsingStatistics ? 'Active' : '',
|
|
47
|
+
'Allow Search': d.features.allowToSearch ? 'Active' : '',
|
|
48
|
+
'Allow Creation from Incoming Interface': d.features.allowToCreateFromIncomingInterface ? 'Active' : '',
|
|
49
|
+
'Enable Day Before Trigger': d.features.enableDayBeforeTrigger ? 'Active' : '',
|
|
50
|
+
'Enable Reminder and Change Triggers': d.features.enableReminderAndChangeTriggers ? 'Active' : '',
|
|
51
|
+
'Enable Not Started Trigger': d.features.enableNotStartedTrigger ? 'Active' : '',
|
|
52
|
+
'Enable SW Warning Trigger': d.features.enableSwWarningTrigger ? 'Active' : '',
|
|
53
|
+
'Calculate Delivery Window': d.features.calculateDeliveryWindow ? 'Active' : '',
|
|
54
|
+
'SLA & Service Window Use Customer Time Zone': d.features.slaAndServiceWindowUseCustomerTimeZone ? 'Active' : '',
|
|
55
|
+
'Support Required Inventory': d.features.supportOfRequiredInventory ? 'Active' : '',
|
|
56
|
+
'Disable Location Tracking': d.features.disableLocationTracking ? 'Active' : '',
|
|
57
|
+
}));
|
|
58
|
+
sheets['Activity Type Overview'] = overview;
|
|
59
|
+
// Sheet 2: Activity Type Time Slots
|
|
60
|
+
const timeSlots = [];
|
|
61
|
+
data.forEach(d => {
|
|
62
|
+
if (!d.timeSlots)
|
|
63
|
+
return;
|
|
64
|
+
d.timeSlots.forEach((ts) => {
|
|
65
|
+
timeSlots.push({
|
|
66
|
+
"Label": d.label,
|
|
67
|
+
"Name": d.name,
|
|
68
|
+
'Time Slot Label': ts.label,
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
});
|
|
72
|
+
sheets['Activity Type TimeSlots'] = timeSlots;
|
|
73
|
+
return sheets;
|
|
74
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
type SheetData = Record<string, any[]>;
|
|
2
|
+
export declare function getApplictaionsIntegrationsDetailMetaData(clientId: string, clientSecret: string, instanceUrl: string, token?: string): Promise<SheetData>;
|
|
3
|
+
export declare function transformData(data: any[]): SheetData;
|
|
4
|
+
export declare function getApplictaionsIntegrationsAPIAccessDetailMetaData(clientId: string, clientSecret: string, instanceUrl: string, label: string, token?: string): Promise<any[]>;
|
|
5
|
+
export declare function getApplictaionsIntegrationsAPIAccessEntitiesDetailMetaData(clientId: string, clientSecret: string, instanceUrl: string, applictaionLabel: string, accesslabel: string, token?: string): Promise<any[]>;
|
|
6
|
+
export declare function getApplictaionsAccessMetaData(clientId: string, clientSecret: string, instanceUrl: string, appData: any[], token?: string): Promise<any[]>;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getApplictaionsIntegrationsDetailMetaData = getApplictaionsIntegrationsDetailMetaData;
|
|
4
|
+
exports.transformData = transformData;
|
|
5
|
+
exports.getApplictaionsIntegrationsAPIAccessDetailMetaData = getApplictaionsIntegrationsAPIAccessDetailMetaData;
|
|
6
|
+
exports.getApplictaionsIntegrationsAPIAccessEntitiesDetailMetaData = getApplictaionsIntegrationsAPIAccessEntitiesDetailMetaData;
|
|
7
|
+
exports.getApplictaionsAccessMetaData = getApplictaionsAccessMetaData;
|
|
8
|
+
const utilities_1 = require("../utilities");
|
|
9
|
+
async function getApplictaionsIntegrationsDetailMetaData(clientId, clientSecret, instanceUrl, token = "") {
|
|
10
|
+
let responsedata = [];
|
|
11
|
+
let offset = 0;
|
|
12
|
+
const limit = 100;
|
|
13
|
+
while (true) {
|
|
14
|
+
const url = `https://${instanceUrl}.fs.ocs.oraclecloud.com/rest/ofscMetadata/v1/applications?offset=${offset}&limit=${limit}`;
|
|
15
|
+
const res = await (0, utilities_1.fetchWithRetry)(url, clientId, clientSecret, instanceUrl, token);
|
|
16
|
+
token = res.token;
|
|
17
|
+
responsedata = [...responsedata, ...res.data.items];
|
|
18
|
+
if (!res.data.items.hasMore)
|
|
19
|
+
break;
|
|
20
|
+
offset = res.data.items.offset + limit;
|
|
21
|
+
}
|
|
22
|
+
const sheet = transformData(responsedata);
|
|
23
|
+
const accessData = await getApplictaionsAccessMetaData(clientId, clientSecret, instanceUrl, responsedata, token);
|
|
24
|
+
sheet['ApplictaonsAccessDetail'] = accessData;
|
|
25
|
+
return sheet;
|
|
26
|
+
}
|
|
27
|
+
function transformData(data) {
|
|
28
|
+
const sheets = {};
|
|
29
|
+
// Sheet 1: Activity Type Groups Overview
|
|
30
|
+
const overview = data.map(d => ({
|
|
31
|
+
"Name": d.name,
|
|
32
|
+
"Label": d.label,
|
|
33
|
+
"Status": d.status,
|
|
34
|
+
"Token Service": d.tokenService
|
|
35
|
+
}));
|
|
36
|
+
sheets['ApplictaonsUsedByIntegrations'] = overview;
|
|
37
|
+
return sheets;
|
|
38
|
+
}
|
|
39
|
+
async function getApplictaionsIntegrationsAPIAccessDetailMetaData(clientId, clientSecret, instanceUrl, label, token = "") {
|
|
40
|
+
let responsedata = [];
|
|
41
|
+
let offset = 0;
|
|
42
|
+
const limit = 100;
|
|
43
|
+
while (true) {
|
|
44
|
+
const url = `https://${instanceUrl}.fs.ocs.oraclecloud.com/rest/ofscMetadata/v1/applications/${label}/apiAccess?offset=${offset}&limit=${limit}`;
|
|
45
|
+
const res = await (0, utilities_1.fetchWithRetry)(url, clientId, clientSecret, instanceUrl, token);
|
|
46
|
+
token = res.token;
|
|
47
|
+
responsedata = [...responsedata, ...res.data.items];
|
|
48
|
+
if (!res.data.items.hasMore)
|
|
49
|
+
break;
|
|
50
|
+
offset = res.data.items.offset + limit;
|
|
51
|
+
}
|
|
52
|
+
return responsedata;
|
|
53
|
+
}
|
|
54
|
+
async function getApplictaionsIntegrationsAPIAccessEntitiesDetailMetaData(clientId, clientSecret, instanceUrl, applictaionLabel, accesslabel, token = "") {
|
|
55
|
+
const url = `https://${instanceUrl}.fs.ocs.oraclecloud.com/rest/ofscMetadata/v1/applications/${applictaionLabel}/apiAccess/${accesslabel}`;
|
|
56
|
+
const res = await (0, utilities_1.fetchWithRetry)(url, clientId, clientSecret, instanceUrl, token);
|
|
57
|
+
token = res.token;
|
|
58
|
+
return res.data.apiEntities || [];
|
|
59
|
+
}
|
|
60
|
+
async function getApplictaionsAccessMetaData(clientId, clientSecret, instanceUrl, appData, token = "") {
|
|
61
|
+
const data = [];
|
|
62
|
+
for (const app of appData) {
|
|
63
|
+
const applictaionlabel = app.label;
|
|
64
|
+
const apiAccess = await getApplictaionsIntegrationsAPIAccessDetailMetaData(clientId, clientSecret, instanceUrl, applictaionlabel, token);
|
|
65
|
+
for (const access of apiAccess) {
|
|
66
|
+
let accesslabel = access.label;
|
|
67
|
+
let accessStatus = access.status;
|
|
68
|
+
if (accessStatus == "active") {
|
|
69
|
+
// call access detail API
|
|
70
|
+
let response = await getApplictaionsIntegrationsAPIAccessEntitiesDetailMetaData(clientId, clientSecret, instanceUrl, applictaionlabel, accesslabel, token);
|
|
71
|
+
response.map(d => data.push({
|
|
72
|
+
"Applictaion Name": applictaionlabel,
|
|
73
|
+
"ApiAccess": accesslabel,
|
|
74
|
+
"Label": d.label.replace(/_/g, ' ').replace(/([a-z])([A-Z])/g, '$1 $2').replace(/\b\w/g, (c) => c.toUpperCase()),
|
|
75
|
+
"Access": d.access.replace(/([a-z])([A-Z])/g, '$1 $2')
|
|
76
|
+
}));
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
return data;
|
|
81
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getCapacityMetaData = getCapacityMetaData;
|
|
4
|
+
exports.transformData = transformData;
|
|
5
|
+
const utilities_1 = require("../utilities");
|
|
6
|
+
async function getCapacityMetaData(clientId, clientSecret, instanceUrl, token = "") {
|
|
7
|
+
let responsedata = [];
|
|
8
|
+
let offset = 0;
|
|
9
|
+
const limit = 100;
|
|
10
|
+
while (true) {
|
|
11
|
+
const url = `https://${instanceUrl}.fs.ocs.oraclecloud.com/rest/ofscMetadata/v1/capacityAreas?offset=${offset}&limit=${limit}`;
|
|
12
|
+
const res = await (0, utilities_1.fetchWithRetry)(url, clientId, clientSecret, instanceUrl, token);
|
|
13
|
+
token = res.token;
|
|
14
|
+
responsedata = [...responsedata, ...res.data.items];
|
|
15
|
+
if (!res.data.hasMore)
|
|
16
|
+
break;
|
|
17
|
+
offset = res.data.offset + limit;
|
|
18
|
+
}
|
|
19
|
+
let capacityData = [];
|
|
20
|
+
for (let i = 0; i < responsedata.length; i++) {
|
|
21
|
+
const element = responsedata[i];
|
|
22
|
+
const url = `https://${instanceUrl}.fs.ocs.oraclecloud.com/rest/ofscMetadata/v1/capacityAreas/${element.label}?offset=0&limit=1000`;
|
|
23
|
+
const res = await (0, utilities_1.fetchWithRetry)(url, clientId, clientSecret, instanceUrl, token);
|
|
24
|
+
capacityData.push(res.data);
|
|
25
|
+
}
|
|
26
|
+
const sheet = transformData(capacityData);
|
|
27
|
+
let capacitycategories = await capacitycategoriesOfacapacityArea(clientId, clientSecret, instanceUrl, responsedata, token);
|
|
28
|
+
sheet['CapacityCategoriesForCapacity'] = capacitycategories;
|
|
29
|
+
return sheet;
|
|
30
|
+
}
|
|
31
|
+
function transformData(data) {
|
|
32
|
+
const sheets = {};
|
|
33
|
+
const overview = data.map(d => ({
|
|
34
|
+
"Bucket": d.parentLabel,
|
|
35
|
+
"Capacity Name": d.name,
|
|
36
|
+
"Type": d.type.replace(/\b\w/g, (c) => c.toUpperCase()),
|
|
37
|
+
"Status": d.status.replace(/\b\w/g, (c) => c.toUpperCase()),
|
|
38
|
+
}));
|
|
39
|
+
sheets['Capacity Overview'] = overview;
|
|
40
|
+
return sheets;
|
|
41
|
+
}
|
|
42
|
+
async function capacitycategoriesOfacapacityArea(clientId, clientSecret, instanceUrl, capacityAreas, token = "") {
|
|
43
|
+
let data = [];
|
|
44
|
+
for (let i = 0; i < capacityAreas.length; i++) {
|
|
45
|
+
const capacityArea = capacityAreas[i];
|
|
46
|
+
const url = `https://${instanceUrl}.fs.ocs.oraclecloud.com/rest/ofscMetadata/v1/capacityAreas/${capacityArea.label}/capacityCategories`;
|
|
47
|
+
const res = await (0, utilities_1.fetchWithRetry)(url, clientId, clientSecret, instanceUrl, token);
|
|
48
|
+
token = res.token;
|
|
49
|
+
for (const category of res.data.items) {
|
|
50
|
+
data.push({
|
|
51
|
+
"capacityArea": capacityArea.label,
|
|
52
|
+
"Capacity Category": category.name,
|
|
53
|
+
"status": category.status === "active" ? "Active" : "Inactive"
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return data;
|
|
58
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getCapacityCategoriesMetaData = getCapacityCategoriesMetaData;
|
|
4
|
+
exports.transformData = transformData;
|
|
5
|
+
const utilities_1 = require("../utilities");
|
|
6
|
+
async function getCapacityCategoriesMetaData(clientId, clientSecret, instanceUrl, token = "") {
|
|
7
|
+
let responsedata = [];
|
|
8
|
+
let offset = 0;
|
|
9
|
+
const limit = 100;
|
|
10
|
+
while (true) {
|
|
11
|
+
const url = `https://${instanceUrl}.fs.ocs.oraclecloud.com/rest/ofscMetadata/v1/capacityCategories?offset=${offset}&limit=${limit}`;
|
|
12
|
+
const res = await (0, utilities_1.fetchWithRetry)(url, clientId, clientSecret, instanceUrl, token);
|
|
13
|
+
token = res.token;
|
|
14
|
+
responsedata = [...responsedata, ...res.data.items];
|
|
15
|
+
if (!res.data.hasMore)
|
|
16
|
+
break;
|
|
17
|
+
offset = res.data.offset + limit;
|
|
18
|
+
}
|
|
19
|
+
const sheet = transformData(responsedata);
|
|
20
|
+
return sheet;
|
|
21
|
+
}
|
|
22
|
+
function transformData(data) {
|
|
23
|
+
const sheets = {};
|
|
24
|
+
// Sheet 1: Activity Type Groups Overview
|
|
25
|
+
const overview = data.map(d => ({
|
|
26
|
+
"Capacity Label": d.label,
|
|
27
|
+
"Capacity Name": d.name,
|
|
28
|
+
Status: d.active ? "Active" : "Inactive"
|
|
29
|
+
}));
|
|
30
|
+
sheets['Capacity Category Overview'] = overview;
|
|
31
|
+
// Sheet 2: Activity Type Groups Activities
|
|
32
|
+
const workSkills = [];
|
|
33
|
+
data.forEach(d => {
|
|
34
|
+
if (!Array.isArray(d.workSkills))
|
|
35
|
+
return;
|
|
36
|
+
d.workSkills.forEach((v) => {
|
|
37
|
+
workSkills.push({
|
|
38
|
+
"Capacity Name": d.name,
|
|
39
|
+
"WorkSkills Label": v.label,
|
|
40
|
+
"workSkills Start Date": v.startDate,
|
|
41
|
+
"workSkills EndDate": v.endDate,
|
|
42
|
+
"workSkills Status": v.endDate ? "Inactive" : "Active"
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
sheets['Capacity Category WorkSkills'] = workSkills;
|
|
47
|
+
return sheets;
|
|
48
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getFormsMetaData = getFormsMetaData;
|
|
4
|
+
exports.transformData = transformData;
|
|
5
|
+
const utilities_1 = require("../utilities");
|
|
6
|
+
async function getFormsMetaData(clientId, clientSecret, instanceUrl, token = "") {
|
|
7
|
+
let responsedata = [];
|
|
8
|
+
let offset = 0;
|
|
9
|
+
const limit = 100;
|
|
10
|
+
while (true) {
|
|
11
|
+
const url = `https://${instanceUrl}.fs.ocs.oraclecloud.com/rest/ofscMetadata/v1/forms?offset=${offset}&limit=${limit}`;
|
|
12
|
+
const res = await (0, utilities_1.fetchWithRetry)(url, clientId, clientSecret, instanceUrl, token);
|
|
13
|
+
token = res.token;
|
|
14
|
+
responsedata = [...responsedata, ...res.data.items];
|
|
15
|
+
if (!res.data.hasMore)
|
|
16
|
+
break;
|
|
17
|
+
offset = res.data.offset + limit;
|
|
18
|
+
}
|
|
19
|
+
const sheet = transformData(responsedata);
|
|
20
|
+
return sheet;
|
|
21
|
+
}
|
|
22
|
+
function transformData(data) {
|
|
23
|
+
const sheets = {};
|
|
24
|
+
const overview = data.map(d => ({
|
|
25
|
+
Label: d.label,
|
|
26
|
+
Name: d.name
|
|
27
|
+
}));
|
|
28
|
+
sheets['Forms Overview'] = overview;
|
|
29
|
+
return sheets;
|
|
30
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function createConfigurationFile(clientId: string, clientSecret: string, instanceUrl: string, fileName?: string): Promise<void>;
|
|
@@ -0,0 +1,78 @@
|
|
|
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.createConfigurationFile = createConfigurationFile;
|
|
37
|
+
const utilities_1 = require("../utilities");
|
|
38
|
+
const ActivityTypesGroups = __importStar(require("./activityTypeGroup"));
|
|
39
|
+
const ActivityTypes = __importStar(require("./activityTypes"));
|
|
40
|
+
const ApplictaionsIntegrations = __importStar(require("./applictaionsIntegration"));
|
|
41
|
+
const Capacity = __importStar(require("./capacity"));
|
|
42
|
+
const CapacityCategories = __importStar(require("./capacityCategories"));
|
|
43
|
+
const Form = __importStar(require("./form"));
|
|
44
|
+
const InventoryTypes = __importStar(require("./inventoryTypes"));
|
|
45
|
+
const Language = __importStar(require("./languages"));
|
|
46
|
+
const NonWorkingReason = __importStar(require("./nonWorkingReasons"));
|
|
47
|
+
const Properties = __importStar(require("./properties"));
|
|
48
|
+
const ResourceType = __importStar(require("./resourceTypes"));
|
|
49
|
+
const Shift = __importStar(require("./shifts"));
|
|
50
|
+
const TimeSlots = __importStar(require("./timeSlots"));
|
|
51
|
+
const WorkSkills = __importStar(require("./workSkillConditions"));
|
|
52
|
+
const WorkZoneKey = __importStar(require("./workZoneKey"));
|
|
53
|
+
const WorkZone = __importStar(require("./workZones"));
|
|
54
|
+
async function createConfigurationFile(clientId, clientSecret, instanceUrl, fileName = "OFSC_CONFIGURATION_SHEET.xlsx") {
|
|
55
|
+
let sheetDataActivityType = await ActivityTypes.getActivityTypesMetaData(clientId, clientSecret, instanceUrl);
|
|
56
|
+
let sheetDataActivityTypeGroup = await ActivityTypesGroups.getActivityTypesGroupsMetaData(clientId, clientSecret, instanceUrl);
|
|
57
|
+
let sheetDataApplictaionsIntegrations = await ApplictaionsIntegrations.getApplictaionsIntegrationsDetailMetaData(clientId, clientSecret, instanceUrl);
|
|
58
|
+
let sheetDataCapacity = await Capacity.getCapacityMetaData(clientId, clientSecret, instanceUrl);
|
|
59
|
+
let sheetDataCapacityCategories = await CapacityCategories.getCapacityCategoriesMetaData(clientId, clientSecret, instanceUrl);
|
|
60
|
+
let sheetDataForm = await Form.getFormsMetaData(clientId, clientSecret, instanceUrl);
|
|
61
|
+
let sheetDataInventoryTypes = await InventoryTypes.getInventoryTypesMetaData(clientId, clientSecret, instanceUrl);
|
|
62
|
+
let sheetDataLanguage = await Language.getLangugaesMetaData(clientId, clientSecret, instanceUrl);
|
|
63
|
+
let sheetDataNonWorkingReason = await NonWorkingReason.getNonWorkingReasonMetaData(clientId, clientSecret, instanceUrl);
|
|
64
|
+
let sheetDataResourceTypes = await ResourceType.getResourceTypesMetaData(clientId, clientSecret, instanceUrl);
|
|
65
|
+
let sheetDataShifts = await Shift.getShiftMetaData(clientId, clientSecret, instanceUrl);
|
|
66
|
+
let sheetDataTimeSlots = await TimeSlots.getTimeSlotsMetaData(clientId, clientSecret, instanceUrl);
|
|
67
|
+
let sheetDataWorkSkillsConsitions = await WorkSkills.getWorkSkillsMetaData(clientId, clientSecret, instanceUrl);
|
|
68
|
+
let sheetDataWorkZoneKey = await WorkZoneKey.getWorkZoneKeyMetaData(clientId, clientSecret, instanceUrl);
|
|
69
|
+
let sheetDataWorkZones = await WorkZone.getWorkZonesMetaData(clientId, clientSecret, instanceUrl);
|
|
70
|
+
let allUsedPropes = [
|
|
71
|
+
...sheetDataWorkZoneKey.props,
|
|
72
|
+
...sheetDataWorkSkillsConsitions.props,
|
|
73
|
+
...sheetDataInventoryTypes.props
|
|
74
|
+
];
|
|
75
|
+
let sheetDataProperties = await Properties.getPropertiesMetaData(clientId, clientSecret, instanceUrl, allUsedPropes);
|
|
76
|
+
let sheets = Object.assign({}, sheetDataActivityType, sheetDataActivityTypeGroup, sheetDataApplictaionsIntegrations, sheetDataCapacity, sheetDataCapacityCategories, sheetDataForm, sheetDataInventoryTypes.data, sheetDataLanguage, sheetDataNonWorkingReason, sheetDataResourceTypes, sheetDataShifts, sheetDataTimeSlots, sheetDataWorkSkillsConsitions.data, sheetDataWorkZoneKey.data, sheetDataWorkZones, sheetDataProperties);
|
|
77
|
+
(0, utilities_1.createExcelFile)(sheets, fileName);
|
|
78
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getInventoryTypesMetaData = getInventoryTypesMetaData;
|
|
4
|
+
exports.transformData = transformData;
|
|
5
|
+
const utilities_1 = require("../utilities");
|
|
6
|
+
async function getInventoryTypesMetaData(clientId, clientSecret, instanceUrl, token = "") {
|
|
7
|
+
let responsedata = [];
|
|
8
|
+
let offset = 0;
|
|
9
|
+
const limit = 100;
|
|
10
|
+
while (true) {
|
|
11
|
+
const url = `https://${instanceUrl}.fs.ocs.oraclecloud.com/rest/ofscMetadata/v1/inventoryTypes?offset=${offset}&limit=${limit}`;
|
|
12
|
+
const res = await (0, utilities_1.fetchWithRetry)(url, clientId, clientSecret, instanceUrl, token);
|
|
13
|
+
token = res.token;
|
|
14
|
+
responsedata = [...responsedata, ...res.data.items];
|
|
15
|
+
if (!res.data.hasMore)
|
|
16
|
+
break;
|
|
17
|
+
offset = res.data.offset + limit;
|
|
18
|
+
}
|
|
19
|
+
const sheet = transformData(responsedata);
|
|
20
|
+
return sheet;
|
|
21
|
+
}
|
|
22
|
+
function transformData(data) {
|
|
23
|
+
const sheets = {};
|
|
24
|
+
// Sheet 1: Activity Type Groups Overview
|
|
25
|
+
const overview = data.map(d => ({
|
|
26
|
+
"Label": d.label,
|
|
27
|
+
"Inv Name": d.name,
|
|
28
|
+
"Unit Of Measurement": d.unitOfMeasurement,
|
|
29
|
+
"Status": d.active ? "Active" : "Inactive",
|
|
30
|
+
"NonSerialized": d.nonSerialized ? "NonSerialized" : "Serialized",
|
|
31
|
+
"Model Property": d.modelProperty,
|
|
32
|
+
"Quantity Precision": d.quantityPrecision,
|
|
33
|
+
}));
|
|
34
|
+
const props = overview.reduce((acc, curr) => {
|
|
35
|
+
acc.push({
|
|
36
|
+
label: curr["Model Property"],
|
|
37
|
+
comment: "It is being used in Inventory Type"
|
|
38
|
+
});
|
|
39
|
+
return acc;
|
|
40
|
+
}, []);
|
|
41
|
+
return {
|
|
42
|
+
data: { 'Inventory Type Overview': overview },
|
|
43
|
+
props
|
|
44
|
+
};
|
|
45
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getLangugaesMetaData = getLangugaesMetaData;
|
|
4
|
+
exports.transformData = transformData;
|
|
5
|
+
const utilities_1 = require("../utilities");
|
|
6
|
+
async function getLangugaesMetaData(clientId, clientSecret, instanceUrl, token = "") {
|
|
7
|
+
let responsedata = [];
|
|
8
|
+
let offset = 0;
|
|
9
|
+
const limit = 100;
|
|
10
|
+
while (true) {
|
|
11
|
+
const url = `https://${instanceUrl}.fs.ocs.oraclecloud.com/rest/ofscMetadata/v1/languages?offset=${offset}&limit=${limit}`;
|
|
12
|
+
const res = await (0, utilities_1.fetchWithRetry)(url, clientId, clientSecret, instanceUrl, token);
|
|
13
|
+
token = res.token;
|
|
14
|
+
responsedata = [...responsedata, ...res.data.items];
|
|
15
|
+
if (!res.data.hasMore)
|
|
16
|
+
break;
|
|
17
|
+
offset = res.data.offset + limit;
|
|
18
|
+
}
|
|
19
|
+
const sheet = transformData(responsedata);
|
|
20
|
+
return sheet;
|
|
21
|
+
}
|
|
22
|
+
function transformData(data) {
|
|
23
|
+
const sheets = {};
|
|
24
|
+
// Sheet 1: Activity Type Groups Overview
|
|
25
|
+
const overview = data.map(d => ({
|
|
26
|
+
// "label": d.label,
|
|
27
|
+
"Code": d.code,
|
|
28
|
+
"Name": d.name,
|
|
29
|
+
"status": d.active ? "Active" : "Inactive",
|
|
30
|
+
}));
|
|
31
|
+
sheets['Languages Overview'] = overview;
|
|
32
|
+
return sheets;
|
|
33
|
+
}
|