Skip to content

Commit

Permalink
Merge pull request #51 from Mastercard/feature/remove-insomnia-url
Browse files Browse the repository at this point in the history
Removing deprecated insomnia-url dependency
  • Loading branch information
danny-gallagher authored Aug 19, 2024
2 parents 89aac49 + 645c801 commit 7e8e48b
Show file tree
Hide file tree
Showing 15 changed files with 4,660 additions and 537 deletions.
4,875 changes: 4,340 additions & 535 deletions package-lock.json

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
}
},
"dependencies": {
"insomnia-url": "^3.3.0",
"mastercard-client-encryption": "^1.6.0",
"mastercard-oauth1-signer": "^1.1.6",
"node-forge": "^1.3.0"
Expand Down
2 changes: 1 addition & 1 deletion src/mastercard-context.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ function MastercardContext(context) {
buildQueryStringFromParams,
joinUrlAndQueryString,
smartEncodeUrl
} = require('insomnia-url');
} = require('./utils/insomnia-url');

const qs = buildQueryStringFromParams(context.request.getParameters());
const fullUrl = joinUrlAndQueryString(context.request.getUrl(), qs);
Expand Down
3 changes: 3 additions & 0 deletions src/utils/insomnia-url/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export { setDefaultProtocol } from './protocol';
export { joinUrlAndQueryString, extractQueryStringFromUrl, buildQueryParameter, buildQueryStringFromParams, deconstructQueryStringToParams, smartEncodeUrl, flexibleEncodeComponent, } from './querystring';
//# sourceMappingURL=index.d.ts.map
1 change: 1 addition & 0 deletions src/utils/insomnia-url/index.d.ts.map

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

14 changes: 14 additions & 0 deletions src/utils/insomnia-url/index.js

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

1 change: 1 addition & 0 deletions src/utils/insomnia-url/index.js.map

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

7 changes: 7 additions & 0 deletions src/utils/insomnia-url/protocol.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/**
* Set a default protocol for a URL
* @param url URL to set protocol on
* @param [defaultProto='http:'] default protocol
*/
export declare const setDefaultProtocol: (url: string, defaultProto?: string | undefined) => string;
//# sourceMappingURL=protocol.d.ts.map
1 change: 1 addition & 0 deletions src/utils/insomnia-url/protocol.d.ts.map

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

23 changes: 23 additions & 0 deletions src/utils/insomnia-url/protocol.js

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

1 change: 1 addition & 0 deletions src/utils/insomnia-url/protocol.js.map

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

46 changes: 46 additions & 0 deletions src/utils/insomnia-url/querystring.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
export declare const getJoiner: (url: string) => "?" | "&";
/**
* Join querystring to URL
*/
export declare const joinUrlAndQueryString: (url: string, qs: string) => string;
/**
* Extract querystring from URL
*/
export declare const extractQueryStringFromUrl: (url: string) => string;
/**
* Build a querystring parameter from a param object
*/
export declare const buildQueryParameter: (param: {
name?: string;
value?: string | number;
}, strict?: boolean | undefined) => string;
/**
* Build a querystring from a list of name/value pairs
*/
export declare const buildQueryStringFromParams: (parameters: {
name: string;
value?: string;
}[], strict?: boolean | undefined) => string;
/**
* Deconstruct a querystring to name/value pairs
* @param [qs] {string}
* @param [strict=true] {boolean} - allow empty names and values
* @returns {{name: string, value: string}[]}
*/
export declare const deconstructQueryStringToParams: (qs: string, strict?: boolean | undefined) => {
name: string;
value: string;
}[];
/**
* Automatically encode the path and querystring components
* @param url url to encode
* @param encode enable encoding
*/
export declare const smartEncodeUrl: (url: string, encode?: boolean | undefined) => string;
/**
* URL encode a string in a flexible way
* @param str string to encode
* @param ignore characters to ignore
*/
export declare const flexibleEncodeComponent: (str?: string, ignore?: string) => string;
//# sourceMappingURL=querystring.d.ts.map
1 change: 1 addition & 0 deletions src/utils/insomnia-url/querystring.d.ts.map

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

220 changes: 220 additions & 0 deletions src/utils/insomnia-url/querystring.js

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

Loading

0 comments on commit 7e8e48b

Please sign in to comment.