forked from iann0036/iam-dataset
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadd_docs.js
133 lines (123 loc) · 6.33 KB
/
add_docs.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
const fetch = require('node-fetch');
const fs = require('fs');
async function x() {
var packagedata = await fetch('https://raw.githubusercontent.com/aws/aws-sdk-js/master/package.json');
var package = await packagedata.json();
var out = {};
var sdkmetadatadata = await fetch(`https://5jts1lgtk8.execute-api.ap-southeast-2.amazonaws.com/metadataproxy/${package['version']}`);
sdkmetadata = await sdkmetadatadata.json();
for (var sdkmetadataservice of sdkmetadata['services']) {
var svcname = sdkmetadataservice['name'].split(".")[1];
var shortname = sdkmetadataservice['prefix'] || sdkmetadataservice['identifier'];
var version = sdkmetadataservice['versions'][sdkmetadataservice['versions'].length - 1];
try {
REPLACESHORTNAME = {
'acmpca': 'acm-pca',
'applicationautoscaling': 'application-autoscaling',
'applicationinsights': 'application-insights',
'augmentedairuntime': 'sagemaker-a2i-runtime',
'autoscalingplans': 'autoscaling-plans',
'cloudwatch': 'monitoring',
'cloudwatchevents': 'events',
'cloudwatchlogs': 'logs',
'codegurureviewer': 'codeguru-reviewer',
'codestarconnections': 'codestar-connections',
'codestarnotifications': 'codestar-notifications',
'cognitoidentity': 'cognito-identity',
'cognitoidentityserviceprovider': 'cognito-idp',
'cognitosync': 'cognito-sync',
'computeoptimizer': 'compute-optimizer',
'configservice': 'config',
'connectcontactlens': 'connect-contact-lens',
'costexplorer': 'ce',
'customerprofiles': 'customer-profiles',
'devopsguru': 'devops-guru',
'directoryservice': 'ds',
'dynamodbstreams': 'streams.dynamodb',
'ec2instanceconnect': 'ec2-instance-connect',
'ecrpublic': 'ecr-public',
'efs': 'elasticfilesystem',
'elasticinference': 'elastic-inference',
'elb': 'elasticloadbalancing',
'elbv2': 'elasticloadbalancingv2',
'emr': 'elasticmapreduce',
'emrcontainers': 'emr-containers',
'finspacedata': 'finspace-data',
'forecastqueryservice': 'forecastquery',
'forecastservice': 'forecast',
'iot1clickdevicesservice': 'iot1click-devices',
'iot1clickprojects': 'iot1click-projects',
'iotdata': 'iot-data',
'ioteventsdata': 'iotevents-data',
'iotjobsdataplane': 'iot-jobs-data',
'kinesisvideoarchivedmedia': 'kinesis-video-archived-media',
'kinesisvideomedia': 'kinesis-video-media',
'kinesisvideosignalingchannels': 'kinesis-video-signaling',
'lexmodelbuildingservice': 'lex-models',
'lexmodelsv2': 'models.lex.v2',
'lexruntime': 'runtime.lex',
'lexruntimev2': 'runtime.lex.v2',
'licensemanager': 'license-manager',
'marketplacecatalog': 'marketplace-catalog',
'marketplaceentitlementservice': 'entitlement.marketplace',
'marketplacemetering': 'meteringmarketplace',
'mediapackagevod': 'mediapackage-vod',
'mediastoredata': 'mediastore-data',
'migrationhub': 'AWSMigrationHub',
'migrationhubconfig': 'migrationhub-config',
'mturk': 'mturk-requester',
'networkfirewall': 'network-firewall',
'personalizeevents': 'personalize-events',
'personalizeruntime': 'personalize-runtime',
'pinpointemail': 'pinpoint-email',
'pinpointsmsvoice': 'sms-voice',
'qldbsession': 'qldb-session',
'rdsdataservice': 'rds-data',
'redshiftdata': 'redshift-data',
'resourcegroups': 'resource-groups',
'sagemakeredge': 'sagemaker-edge',
'sagemakerfeaturestoreruntime': 'sagemaker-featurestore-runtime',
'sagemakerruntime': 'runtime.sagemaker',
'serverlessapplicationrepository': 'serverlessrepo',
'servicecatalogappregistry': 'servicecatalog-appregistry',
'servicequotas': 'service-quotas',
'ses': 'email',
'simpledb': 'sdb',
'ssmcontacts': 'ssm-contacts',
'ssmincidents': 'ssm-incidents',
'ssoadmin': 'sso-admin',
'ssooidc': 'sso-oidc',
'stepfunctions': 'states',
'timestreamquery': 'timestream-query',
'timestreamwrite': 'timestream-write',
'transcribeservice': 'transcribe',
'wafregional': 'waf-regional',
'route53recoverycluster': 'route53-recovery-cluster',
'route53recoverycontrolconfig': 'route53-recovery-control-config',
'route53recoveryreadiness': 'route53-recovery-readiness',
'chimesdkidentity': 'chime-sdk-identity',
'chimesdkmessaging': 'chime-sdk-messaging',
'snowdevicemanagement': 'snow-device-management',
'voiceid': 'voice-id',
'chimesdkmeetings': 'chime-sdk-meetings',
'migrationhubrefactorspaces': 'migration-hub-refactor-spaces',
'backupgateway': 'backup-gateway',
'workspacesweb': 'workspaces-web'
};
var sdkshortname = shortname;
if (REPLACESHORTNAME[shortname]) {
sdkshortname = REPLACESHORTNAME[shortname];
}
var sdkdatatxt = await fetch(`https://raw.githubusercontent.com/aws/aws-sdk-js/master/apis/${sdkshortname}-${version}.normal.json`);
var sdkdata = await sdkdatatxt.json();
for (var op of Object.keys(sdkdata["operations"])) {
var actionname = svcname + "." + op;
out[actionname] = sdkdata["operations"][op]["documentation"];
}
} catch(err) {
console.log(err);
}
}
fs.writeFileSync('docs.json', JSON.stringify(out))
}
x();