@ama-sdk/core 13.0.0-next.3 → 13.0.0-next.5
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/cjs/fwk/mocks/helpers.js +2 -1
- package/esm2015/fwk/mocks/helpers.js +5 -2
- package/package.json +6 -6
- package/src/fwk/mocks/helpers.d.ts +3 -1
- package/src/fwk/mocks/helpers.d.ts.map +1 -1
- package/src/fwk/mocks/helpers.js +5 -2
- package/src/fwk/mocks/helpers.js.map +1 -1
- package/src/fwk/mocks/path-object.d.ts +3 -1
- package/src/fwk/mocks/path-object.d.ts.map +1 -1
package/cjs/fwk/mocks/helpers.js
CHANGED
|
@@ -33,7 +33,8 @@ function getPath(requestUrl, pathObjects, method) {
|
|
|
33
33
|
}
|
|
34
34
|
// Find all matching paths
|
|
35
35
|
var matches = pathObjects.reduce(function(newMatches, pathObject, index) {
|
|
36
|
-
|
|
36
|
+
var regexp = pathObject.urlPattern ? new RegExp(pathObject.urlPattern) : pathObject.regexp;
|
|
37
|
+
if (regexp.test(pathName)) {
|
|
37
38
|
newMatches.push({
|
|
38
39
|
index: index,
|
|
39
40
|
segments: pathObject.path.split('/'),
|
|
@@ -13,7 +13,9 @@
|
|
|
13
13
|
return operation.operationId || "".concat(pathObject.path, "_").concat(lcMethod);
|
|
14
14
|
}
|
|
15
15
|
/**
|
|
16
|
-
* Gets a PathObject from a requested URL
|
|
16
|
+
* Gets a PathObject from a requested URL.
|
|
17
|
+
* If present in the {@link pathObjects} item, the {@link PathObject.urlPattern | urlPattern} will be used to match the {@link requestURL} path part.
|
|
18
|
+
* If not, the matching will be proceed with the {@link PathObject.regexp | regexp} on the whole {@link requestURL}
|
|
17
19
|
* @param requestUrl the URL string
|
|
18
20
|
* @param pathObjects the list of available path objects
|
|
19
21
|
* @param method the optional HTTP method used in case of several matches
|
|
@@ -24,7 +26,8 @@
|
|
|
24
26
|
}
|
|
25
27
|
// Find all matching paths
|
|
26
28
|
var matches = pathObjects.reduce(function(newMatches, pathObject, index) {
|
|
27
|
-
|
|
29
|
+
var regexp = pathObject.urlPattern ? new RegExp(pathObject.urlPattern) : pathObject.regexp;
|
|
30
|
+
if (regexp.test(pathName)) {
|
|
28
31
|
newMatches.push({
|
|
29
32
|
index: index,
|
|
30
33
|
segments: pathObject.path.split('/'),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ama-sdk/core",
|
|
3
|
-
"version": "13.0.0-next.
|
|
3
|
+
"version": "13.0.0-next.5",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"build:builders": "tsc -b tsconfig.builders.json --pretty && yarn generate-cjs-manifest"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@o3r/schematics": "^13.0.0-next.
|
|
46
|
+
"@o3r/schematics": "^13.0.0-next.5",
|
|
47
47
|
"@swc/helpers": "~0.5.0",
|
|
48
48
|
"ts-node": "~10.9.2",
|
|
49
49
|
"tslib": "^2.6.2",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"peerDependencies": {
|
|
53
53
|
"@angular-devkit/schematics": "^19.0.0",
|
|
54
54
|
"@angular/cli": "^19.0.0",
|
|
55
|
-
"@o3r/schematics": "^13.0.0-next.
|
|
55
|
+
"@o3r/schematics": "^13.0.0-next.5",
|
|
56
56
|
"@schematics/angular": "^19.0.0",
|
|
57
57
|
"typescript": "^5.5.4"
|
|
58
58
|
},
|
|
@@ -81,9 +81,9 @@
|
|
|
81
81
|
"@eslint-community/eslint-plugin-eslint-comments": "^4.4.0",
|
|
82
82
|
"@nx/eslint-plugin": "~20.8.0",
|
|
83
83
|
"@nx/jest": "~20.8.0",
|
|
84
|
-
"@o3r/build-helpers": "^13.0.0-next.
|
|
85
|
-
"@o3r/eslint-plugin": "^13.0.0-next.
|
|
86
|
-
"@o3r/test-helpers": "^13.0.0-next.
|
|
84
|
+
"@o3r/build-helpers": "^13.0.0-next.5",
|
|
85
|
+
"@o3r/eslint-plugin": "^13.0.0-next.5",
|
|
86
|
+
"@o3r/test-helpers": "^13.0.0-next.5",
|
|
87
87
|
"@schematics/angular": "~19.2.0",
|
|
88
88
|
"@stylistic/eslint-plugin": "~3.1.0",
|
|
89
89
|
"@swc/cli": "~0.7.7",
|
|
@@ -6,7 +6,9 @@ import { PathObject } from './path-object';
|
|
|
6
6
|
*/
|
|
7
7
|
export declare function getOperationId(pathObject: PathObject, method: string): string | undefined;
|
|
8
8
|
/**
|
|
9
|
-
* Gets a PathObject from a requested URL
|
|
9
|
+
* Gets a PathObject from a requested URL.
|
|
10
|
+
* If present in the {@link pathObjects} item, the {@link PathObject.urlPattern | urlPattern} will be used to match the {@link requestURL} path part.
|
|
11
|
+
* If not, the matching will be proceed with the {@link PathObject.regexp | regexp} on the whole {@link requestURL}
|
|
10
12
|
* @param requestUrl the URL string
|
|
11
13
|
* @param pathObjects the list of available path objects
|
|
12
14
|
* @param method the optional HTTP method used in case of several matches
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../src/fwk/mocks/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACX,MAAM,eAAe,CAAC;AAEvB;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,UAAU,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CASzF;AAED
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../src/fwk/mocks/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACX,MAAM,eAAe,CAAC;AAEvB;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,UAAU,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CASzF;AAED;;;;;;;GAOG;AACH,wBAAgB,OAAO,CAAC,UAAU,EAAE,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS,CAuD9G"}
|
package/src/fwk/mocks/helpers.js
CHANGED
|
@@ -12,7 +12,9 @@ export function getOperationId(pathObject, method) {
|
|
|
12
12
|
return operation.operationId || `${pathObject.path}_${lcMethod}`;
|
|
13
13
|
}
|
|
14
14
|
/**
|
|
15
|
-
* Gets a PathObject from a requested URL
|
|
15
|
+
* Gets a PathObject from a requested URL.
|
|
16
|
+
* If present in the {@link pathObjects} item, the {@link PathObject.urlPattern | urlPattern} will be used to match the {@link requestURL} path part.
|
|
17
|
+
* If not, the matching will be proceed with the {@link PathObject.regexp | regexp} on the whole {@link requestURL}
|
|
16
18
|
* @param requestUrl the URL string
|
|
17
19
|
* @param pathObjects the list of available path objects
|
|
18
20
|
* @param method the optional HTTP method used in case of several matches
|
|
@@ -24,7 +26,8 @@ export function getPath(requestUrl, pathObjects, method) {
|
|
|
24
26
|
}
|
|
25
27
|
// Find all matching paths
|
|
26
28
|
let matches = pathObjects.reduce((newMatches, pathObject, index) => {
|
|
27
|
-
|
|
29
|
+
const regexp = pathObject.urlPattern ? new RegExp(pathObject.urlPattern) : pathObject.regexp;
|
|
30
|
+
if (regexp.test(pathName)) {
|
|
28
31
|
newMatches.push({
|
|
29
32
|
index,
|
|
30
33
|
segments: pathObject.path.split('/'),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../src/fwk/mocks/helpers.ts"],"names":[],"mappings":"AAIA;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAAC,UAAsB,EAAE,MAAc;IACnE,MAAM,QAAQ,GAAG,MAAM,CAAC,WAAW,EAAE,CAAC;IACtC,MAAM,SAAS,GAAG,UAAU,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CACpD,IAAI,CAAC,MAAM,K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AC;QAC5C,CAAC,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,SAAS,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;QACnC,MAAM,IAAI,GAAG,MAAM,CAAC,SAAS,CAAC;QAC9B,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;QAEzB,iHAAiH;QACjH,qGAAqG;QACrG,IAAI,SAAS,KAAK,IAAI,EAAE,CAAC;YACvB,IAAI,MAAM,EAAE,CAAC;gBACX,8DAA8D;gBAC9D,OAAO,CAAC,MAAM,CAAC,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,CAAC;YAChG,CAAC;YACD,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QACpB,CAAC;QAED,SAAS,GAAG,IAAI,CAAC;IACnB,CAAC;IAED,OAAO,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AACxE,CAAC"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { Operation } from './operation';
|
|
2
2
|
/** Describes a path on the swagger specification */
|
|
3
3
|
export interface PathObject {
|
|
4
|
-
/**
|
|
4
|
+
/** Pattern of the URL after part after the baseUrl */
|
|
5
|
+
urlPattern?: string;
|
|
6
|
+
/** The regular expression that defines the full path (including baseUrl) */
|
|
5
7
|
regexp: RegExp;
|
|
6
8
|
/** The url path */
|
|
7
9
|
path: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"path-object.d.ts","sourceRoot":"","sources":["../../../../src/fwk/mocks/path-object.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACV,MAAM,aAAa,CAAC;AAErB,oDAAoD;AACpD,MAAM,WAAW,UAAU;IACzB,
|
|
1
|
+
{"version":3,"file":"path-object.d.ts","sourceRoot":"","sources":["../../../../src/fwk/mocks/path-object.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACV,MAAM,aAAa,CAAC;AAErB,oDAAoD;AACpD,MAAM,WAAW,UAAU;IACzB,sDAAsD;IACtD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,4EAA4E;IAC5E,MAAM,EAAE,MAAM,CAAC;IACf,mBAAmB;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,oDAAoD;IACpD,UAAU,EAAE,SAAS,EAAE,CAAC;CACzB"}
|