Skip to content
Draft
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ module.exports = {
rules: {
"import/order": "error",
"import/namespace": "off",
"import/no-unresolved": ["error", { ignore: ["^inversify$"] }],
"@typescript-eslint/typedef": "off",
"@typescript-eslint/naming-convention": "off",
"@typescript-eslint/explicit-function-return-type": "off",
Expand Down
4 changes: 4 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@
module.exports = {
transform: {
"^.+\\.tsx?$": "ts-jest",
"^.+\\.js$": "ts-jest",
},
transformIgnorePatterns: [
"/node_modules/(?!(inversify|@inversifyjs)/)",
],
testEnvironment: "node",
moduleFileExtensions: ["ts", "js", "json", "node"],
moduleNameMapper: {},
Expand Down
8 changes: 4 additions & 4 deletions lib/generator/exampleGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -275,9 +275,9 @@ export default class Generator {
type pathNode = string | number;
type pathNodes = pathNode[];

const requestPaths = _.paths(example.parameters, { pathFormat: "array" }).map((v) =>
(v as pathNode[]).reverse()
);
const requestPaths: pathNodes[] = (
_.paths(example.parameters, { pathFormat: "array" }) as pathNode[][]
).map((v) => v.reverse());

/**
* construct a inverted index , the key is leaf property key, value is reverse of the path from the root to the leaf property.
Expand Down Expand Up @@ -315,7 +315,7 @@ export default class Generator {
*/
const res = _.mapValuesDeep(
example.responses,
(value, key, parentValue, context) => {
(value: any, key: string | number, parentValue: any, context: any) => {
if (!parentValue) {
log.warn(`parent is null`);
}
Expand Down
66 changes: 33 additions & 33 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"difflib": "0.2.4",
"fast-json-stable-stringify": "^2.1.0",
"glob": "^13.0.0",
"inversify": "^7.10.1",
"inversify": "^8.1.0",
"js-yaml": "^4.1.0",
"json-pointer": "0.6.2",
"json-schema-traverse": "0.4.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"parameters": {
"subscriptionId": "5b4b650e-28b9-4790-b3ab-ddbd88d727c4",
"resourceGroupName": "rgEventGrid",
"domainName": "gwkhmaaliulphadcvpjavjqnmeow",
"domainTopicName": "asjpv",
"domainName": "ngwrdtsotqdusrelnldskjqi",
"domainTopicName": "jhllsypqryndqfxmdceut",
"api-version": "2020-06-01"
},
"responses": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"parameters": {
"subscriptionId": "5b4b650e-28b9-4790-b3ab-ddbd88d727c4",
"resourceGroupName": "rgEventGrid",
"domainName": "iodljwmpvakce",
"domainTopicName": "zcjvlvhrdjqtqoimeq",
"domainName": "snhtrbcnzqg",
"domainTopicName": "owmwwumjqalanjaconlrwv",
"api-version": "2020-06-01"
},
"responses": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"parameters": {
"subscriptionId": "5b4b650e-28b9-4790-b3ab-ddbd88d727c4",
"resourceGroupName": "rgEventGrid",
"domainName": "bpuurjyrmmvjgdkhk",
"domainTopicName": "qpgvxsrh",
"domainName": "nlmnurhlldvk",
"domainTopicName": "vzwvxzm",
"api-version": "2020-06-01"
},
"responses": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"parameters": {
"subscriptionId": "5b4b650e-28b9-4790-b3ab-ddbd88d727c4",
"resourceGroupName": "rgEventGrid",
"domainName": "kfqwmlebsqntdtdybtbqotwtnnlvo",
"domainTopicName": "yxxgwaulyttxrfn",
"domainName": "dgbhzphxezigkelrnqvoosmcte",
"domainTopicName": "nvcnvgbextohrhjjtwgc",
"api-version": "2020-06-01"
},
"responses": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"parameters": {
"subscriptionId": "5b4b650e-28b9-4790-b3ab-ddbd88d727c4",
"resourceGroupName": "rgEventGrid",
"domainName": "ytvnmzefpuazaurgszj",
"domainTopicName": "mech",
"domainName": "avfbdzwgfusptuhfutbxquo",
"domainTopicName": "mveohtvvosuepprkbcpvw",
"api-version": "2020-06-01"
},
"responses": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
"parameters": {
"subscriptionId": "5b4b650e-28b9-4790-b3ab-ddbd88d727c4",
"resourceGroupName": "rgEventGrid",
"domainName": "cgqgnbuywyf",
"domainName": "benjzzjrhvgxjraczqvdqwdxuzjn",
"api-version": "2020-06-01",
"$filter": "qswocf",
"$top": 30
"$filter": "peest",
"$top": 20
},
"responses": {
"200": {
Expand All @@ -30,7 +30,7 @@
"type": "Microsoft.EventGrid/domains/topics"
}
],
"nextLink": "ytsvxheejixghlq"
"nextLink": "fjcgvndyafbxprvqgbqnoujji"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"parameters": {
"subscriptionId": "5b4b650e-28b9-4790-b3ab-ddbd88d727c4",
"resourceGroupName": "rgEventGrid",
"domainName": "kwidhgzjgfrtcbkneysacuj",
"domainName": "wslrulfrrbkabhnlq",
"api-version": "2020-06-01"
},
"responses": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"parameters": {
"subscriptionId": "5b4b650e-28b9-4790-b3ab-ddbd88d727c4",
"resourceGroupName": "rgEventGrid",
"domainName": "bkdtcrhyufheul",
"domainName": "qnquhbebjysyx",
"domainInfo": {
"location": "westus2",
"tags": {},
Expand All @@ -27,12 +27,12 @@
"id": "/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.Network/privateEndpoints/bmtpe5"
},
"groupIds": [
"egkunsjumrmebsehnmhskrthaquly"
"ddvwmdhjzofnglrrlvuozykczsn"
],
"privateLinkServiceConnectionState": {
"status": "Pending",
"description": "mrphqeraeqrrbd",
"actionsRequired": "uyunjjoxnujgwkmttrsg"
"description": "mglfwmocbfayzpintmo",
"actionsRequired": "exxxcymtqpcnmnp"
},
"provisioningState": "Creating"
}
Expand All @@ -42,25 +42,25 @@
"inputSchemaMapping": {
"properties": {
"id": {
"sourceField": "uwjxmdkwnjcnsahguodyeq"
"sourceField": "uxusoqlbtmkalkljuycllvrkhm"
},
"topic": {
"sourceField": "uwjxmdkwnjcnsahguodyeq"
"sourceField": "uxusoqlbtmkalkljuycllvrkhm"
},
"eventTime": {
"sourceField": "uwjxmdkwnjcnsahguodyeq"
"sourceField": "uxusoqlbtmkalkljuycllvrkhm"
},
"eventType": {
"sourceField": "ezyvfkqyqfmnvfkxavjjyvcgkuvrxj",
"defaultValue": "cvgoovwmsinwmxnyfbzd"
"sourceField": "nzsyfkstm",
"defaultValue": "xvhixfoermvgs"
},
"subject": {
"sourceField": "ezyvfkqyqfmnvfkxavjjyvcgkuvrxj",
"defaultValue": "cvgoovwmsinwmxnyfbzd"
"sourceField": "nzsyfkstm",
"defaultValue": "xvhixfoermvgs"
},
"dataVersion": {
"sourceField": "ezyvfkqyqfmnvfkxavjjyvcgkuvrxj",
"defaultValue": "cvgoovwmsinwmxnyfbzd"
"sourceField": "nzsyfkstm",
"defaultValue": "xvhixfoermvgs"
}
},
"inputSchemaMappingType": "Json"
Expand Down Expand Up @@ -96,18 +96,18 @@
"id": "/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.Network/privateEndpoints/bmtpe5"
},
"groupIds": [
"egkunsjumrmebsehnmhskrthaquly"
"ddvwmdhjzofnglrrlvuozykczsn"
],
"privateLinkServiceConnectionState": {
"status": "Pending",
"description": "mrphqeraeqrrbd",
"actionsRequired": "uyunjjoxnujgwkmttrsg"
"description": "mglfwmocbfayzpintmo",
"actionsRequired": "exxxcymtqpcnmnp"
},
"provisioningState": "Creating"
},
"id": "pyhmwq",
"name": "dsruunaacrewv",
"type": "naxqrkhejplkx"
"id": "nhriopmvrlbvsorkbw",
"name": "nmhziqdgdrtwshncyg",
"type": "xvxqrpzmlodxxzdyjsgc"
}
],
"provisioningState": "Succeeded",
Expand All @@ -116,30 +116,30 @@
"inputSchemaMapping": {
"properties": {
"id": {
"sourceField": "uwjxmdkwnjcnsahguodyeq"
"sourceField": "uxusoqlbtmkalkljuycllvrkhm"
},
"topic": {
"sourceField": "uwjxmdkwnjcnsahguodyeq"
"sourceField": "uxusoqlbtmkalkljuycllvrkhm"
},
"eventTime": {
"sourceField": "uwjxmdkwnjcnsahguodyeq"
"sourceField": "uxusoqlbtmkalkljuycllvrkhm"
},
"eventType": {
"sourceField": "ezyvfkqyqfmnvfkxavjjyvcgkuvrxj",
"defaultValue": "cvgoovwmsinwmxnyfbzd"
"sourceField": "nzsyfkstm",
"defaultValue": "xvhixfoermvgs"
},
"subject": {
"sourceField": "ezyvfkqyqfmnvfkxavjjyvcgkuvrxj",
"defaultValue": "cvgoovwmsinwmxnyfbzd"
"sourceField": "nzsyfkstm",
"defaultValue": "xvhixfoermvgs"
},
"dataVersion": {
"sourceField": "ezyvfkqyqfmnvfkxavjjyvcgkuvrxj",
"defaultValue": "cvgoovwmsinwmxnyfbzd"
"sourceField": "nzsyfkstm",
"defaultValue": "xvhixfoermvgs"
}
},
"inputSchemaMappingType": "Json"
},
"metricResourceId": "ulcweuvytjktvgihoeixr"
"metricResourceId": "ifheegnmvi"
},
"id": "/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/domains/exampledomain2",
"name": "exampledomain2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"parameters": {
"subscriptionId": "5b4b650e-28b9-4790-b3ab-ddbd88d727c4",
"resourceGroupName": "rgEventGrid",
"domainName": "zapuxjqccxbtlhmcsgupqpuxg",
"domainName": "lpv",
"api-version": "2020-06-01"
},
"responses": {
Expand Down
Loading
Loading