inferred-types 0.50.21 → 0.50.23
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/constants/RepoConstants.d.ts +3 -3
- package/dist/constants/RepoConstants.js +3 -3
- package/dist/constants/tsconfig.tsbuildinfo +1 -1
- package/dist/index.cjs +186 -176
- package/dist/index.js +186 -176
- package/dist/inferred-types/tsconfig.tsbuildinfo +1 -1
- package/dist/runtime/tsconfig.tsbuildinfo +1 -1
- package/dist/runtime/type-guards/index.d.ts +0 -4
- package/dist/runtime/type-guards/index.d.ts.map +1 -1
- package/dist/runtime/type-guards/index.js +0 -4
- package/dist/runtime/type-guards/urls/index.d.ts +4 -0
- package/dist/runtime/type-guards/urls/index.d.ts.map +1 -1
- package/dist/runtime/type-guards/urls/index.js +4 -0
- package/dist/runtime/type-guards/urls/repos/bitbucket.d.ts +9 -0
- package/dist/runtime/type-guards/urls/repos/bitbucket.d.ts.map +1 -0
- package/dist/runtime/type-guards/urls/repos/bitbucket.js +13 -0
- package/dist/runtime/type-guards/urls/repos/codeCommit.d.ts +9 -0
- package/dist/runtime/type-guards/urls/repos/codeCommit.d.ts.map +1 -0
- package/dist/runtime/type-guards/urls/repos/codeCommit.js +13 -0
- package/dist/runtime/type-guards/{github.d.ts → urls/repos/github.d.ts} +1 -1
- package/dist/runtime/type-guards/urls/repos/github.d.ts.map +1 -0
- package/dist/runtime/type-guards/{github.js → urls/repos/github.js} +10 -5
- package/dist/runtime/type-guards/urls/repos/index.d.ts +12 -0
- package/dist/runtime/type-guards/urls/repos/index.d.ts.map +1 -0
- package/dist/runtime/type-guards/urls/repos/index.js +15 -0
- package/dist/runtime/type-guards/urls/repos/isSemanticVersion.d.ts +21 -0
- package/dist/runtime/type-guards/urls/repos/isSemanticVersion.d.ts.map +1 -0
- package/dist/runtime/type-guards/urls/repos/isSemanticVersion.js +30 -0
- package/dist/runtime/type-guards/urls/retail.d.ts.map +1 -0
- package/dist/runtime/type-guards/{retail.js → urls/retail.js} +1 -1
- package/dist/runtime/type-guards/urls/youtube.d.ts.map +1 -0
- package/dist/types/string-literals/character-sets/urls/bitbucket.d.ts +30 -0
- package/dist/types/string-literals/character-sets/urls/bitbucket.d.ts.map +1 -0
- package/dist/types/string-literals/character-sets/urls/bitbucket.js +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/dist/runtime/type-guards/github.d.ts.map +0 -1
- package/dist/runtime/type-guards/repos.d.ts +0 -40
- package/dist/runtime/type-guards/repos.d.ts.map +0 -1
- package/dist/runtime/type-guards/repos.js +0 -60
- package/dist/runtime/type-guards/retail.d.ts.map +0 -1
- package/dist/runtime/type-guards/youtube.d.ts.map +0 -1
- /package/dist/runtime/type-guards/{retail.d.ts → urls/retail.d.ts} +0 -0
- /package/dist/runtime/type-guards/{youtube.d.ts → urls/youtube.d.ts} +0 -0
- /package/dist/runtime/type-guards/{youtube.js → urls/youtube.js} +0 -0
|
@@ -36,8 +36,6 @@ export * from "./isDoneFn";
|
|
|
36
36
|
export * from "./isUrl";
|
|
37
37
|
export * from "./isCssAspectRatio";
|
|
38
38
|
export * from "./isInlineSvg";
|
|
39
|
-
export * from "./youtube";
|
|
40
|
-
export * from "./repos";
|
|
41
39
|
export * from "./network-tg";
|
|
42
40
|
export * from "./isHexadecimal";
|
|
43
41
|
export * from "./isTrimmable";
|
|
@@ -49,8 +47,6 @@ export * from "./api-tg";
|
|
|
49
47
|
export * from "./isBooleanLike";
|
|
50
48
|
export * from "./isRegExp";
|
|
51
49
|
export * from "./isAlpha";
|
|
52
|
-
export * from "./github";
|
|
53
|
-
export * from "./retail";
|
|
54
50
|
export * from "./tokens/index";
|
|
55
51
|
export * from "./higher-order/index";
|
|
56
52
|
export * from "./tokens/index";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/runtime/type-guards/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa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Ac,CAAC"}
|
|
@@ -36,8 +36,6 @@ export * from "./isDoneFn";
|
|
|
36
36
|
export * from "./isUrl";
|
|
37
37
|
export * from "./isCssAspectRatio";
|
|
38
38
|
export * from "./isInlineSvg";
|
|
39
|
-
export * from "./youtube";
|
|
40
|
-
export * from "./repos";
|
|
41
39
|
export * from "./network-tg";
|
|
42
40
|
export * from "./isHexadecimal";
|
|
43
41
|
export * from "./isTrimmable";
|
|
@@ -49,8 +47,6 @@ export * from "./api-tg";
|
|
|
49
47
|
export * from "./isBooleanLike";
|
|
50
48
|
export * from "./isRegExp";
|
|
51
49
|
export * from "./isAlpha";
|
|
52
|
-
export * from "./github";
|
|
53
|
-
export * from "./retail";
|
|
54
50
|
export * from "./tokens/index";
|
|
55
51
|
export * from "./higher-order/index";
|
|
56
52
|
export * from "./tokens/index";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/runtime/type-guards/urls/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AAEzB,cAAc,cAAc,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/runtime/type-guards/urls/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AAEzB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAE1B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { REPO_SOURCE_LOOKUP } from "src/constants/index";
|
|
2
|
+
import { UrlsFrom } from "src/types/index";
|
|
3
|
+
/**
|
|
4
|
+
* **isBitbucketUrl**`(val)`
|
|
5
|
+
*
|
|
6
|
+
* Type guard which validates that the value passed in is a valid BitBucket URL
|
|
7
|
+
*/
|
|
8
|
+
export declare const isBitbucketUrl: <T>(val: T) => val is T & UrlsFrom<(typeof REPO_SOURCE_LOOKUP)["bitbucket"]>;
|
|
9
|
+
//# sourceMappingURL=bitbucket.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bitbucket.d.ts","sourceRoot":"","sources":["../../../../../src/runtime/type-guards/urls/repos/bitbucket.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAEzD,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE3C;;;;GAIG;AACH,eAAO,MAAM,cAAc,GAAI,CAAC,OAAO,CAAC,KAAG,GAAG,IAAI,CAAC,GAAG,QAAQ,CAAC,CAAA,OAAO,kBAAkB,EAAC,WAAW,CAAC,CAOpG,CAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { REPO_SOURCE_LOOKUP } from "src/constants/index";
|
|
2
|
+
import { isString } from "../../isString";
|
|
3
|
+
/**
|
|
4
|
+
* **isBitbucketUrl**`(val)`
|
|
5
|
+
*
|
|
6
|
+
* Type guard which validates that the value passed in is a valid BitBucket URL
|
|
7
|
+
*/
|
|
8
|
+
export const isBitbucketUrl = (val) => {
|
|
9
|
+
const valid = REPO_SOURCE_LOOKUP["bitbucket"];
|
|
10
|
+
return isString(val) && valid.some(i => val === i ||
|
|
11
|
+
val.startsWith(`${i}/`) ||
|
|
12
|
+
val.startsWith(`${i}?`));
|
|
13
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { REPO_SOURCE_LOOKUP } from "src/constants/index";
|
|
2
|
+
import { UrlsFrom } from "src/types/index";
|
|
3
|
+
/**
|
|
4
|
+
* **isCodeCommitUrl**`(val)`
|
|
5
|
+
*
|
|
6
|
+
* Type guard which validates that the value passed in is a valid AWS Code Commit URL
|
|
7
|
+
*/
|
|
8
|
+
export declare const isCodeCommitUrl: <T>(val: T) => val is T & UrlsFrom<(typeof REPO_SOURCE_LOOKUP)["codecommit"]>;
|
|
9
|
+
//# sourceMappingURL=codeCommit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codeCommit.d.ts","sourceRoot":"","sources":["../../../../../src/runtime/type-guards/urls/repos/codeCommit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAG3C;;;;GAIG;AACH,eAAO,MAAM,eAAe,GAAI,CAAC,OAAO,CAAC,KAAG,GAAG,IAAI,CAAC,GAAG,QAAQ,CAAC,CAAA,OAAO,kBAAkB,EAAC,YAAY,CAAC,CAOtG,CAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { REPO_SOURCE_LOOKUP } from "src/constants/index";
|
|
2
|
+
import { isString } from "../../isString";
|
|
3
|
+
/**
|
|
4
|
+
* **isCodeCommitUrl**`(val)`
|
|
5
|
+
*
|
|
6
|
+
* Type guard which validates that the value passed in is a valid AWS Code Commit URL
|
|
7
|
+
*/
|
|
8
|
+
export const isCodeCommitUrl = (val) => {
|
|
9
|
+
const valid = REPO_SOURCE_LOOKUP["codecommit"];
|
|
10
|
+
return isString(val) && valid.some(i => val === i ||
|
|
11
|
+
val.startsWith(`${i}/`) ||
|
|
12
|
+
val.startsWith(`${i}?`));
|
|
13
|
+
};
|
|
@@ -5,7 +5,7 @@ import { GithubOrgUrl, GithubRepoIssuesListUrl, GithubRepoIssueUrl, GithubRepoPr
|
|
|
5
5
|
* Type guard which validates that the passed in value is a valid
|
|
6
6
|
* **Github** URL.
|
|
7
7
|
*/
|
|
8
|
-
export declare const isGithubUrl:
|
|
8
|
+
export declare const isGithubUrl: (val: unknown) => val is GithubUrl;
|
|
9
9
|
/**
|
|
10
10
|
* **isGithubOrgUrl**`(val)`
|
|
11
11
|
*
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"github.d.ts","sourceRoot":"","sources":["../../../../../src/runtime/type-guards/urls/repos/github.ts"],"names":[],"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AAqB,GAAG,CAMlF,CAAA;AAGD;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB,GAAI,CAAC,OAAO,CAAC,KAAG,GAAG,IAAI,oBAAoB,GAAG,CAM/E,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { isString } from "
|
|
2
|
-
import { stripLeading, stripTrailing } from "
|
|
1
|
+
import { isString } from "../../isString";
|
|
2
|
+
import { stripLeading, stripTrailing } from "../../../literals";
|
|
3
3
|
/**
|
|
4
4
|
* **isGithubUrl**`(val)`
|
|
5
5
|
*
|
|
@@ -7,9 +7,14 @@ import { stripLeading, stripTrailing } from "../literals";
|
|
|
7
7
|
* **Github** URL.
|
|
8
8
|
*/
|
|
9
9
|
export const isGithubUrl = (val) => {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
const valid = [
|
|
11
|
+
"https://github.com",
|
|
12
|
+
'https://www.github.com',
|
|
13
|
+
'https://github.io'
|
|
14
|
+
];
|
|
15
|
+
return isString(val) && valid.some(i => val === i ||
|
|
16
|
+
val.startsWith(`${i}/`) ||
|
|
17
|
+
val.startsWith(`${i}?`));
|
|
13
18
|
};
|
|
14
19
|
/**
|
|
15
20
|
* **isGithubOrgUrl**`(val)`
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { RepoUrls } from "src/types/index";
|
|
2
|
+
export * from "./github";
|
|
3
|
+
export * from "./bitbucket";
|
|
4
|
+
export * from "./codeCommit";
|
|
5
|
+
export * from "./isSemanticVersion";
|
|
6
|
+
/**
|
|
7
|
+
* **isRepoUrl**`(val)`
|
|
8
|
+
*
|
|
9
|
+
* Type guard which validates that the value passed in is a valid Repo URL
|
|
10
|
+
*/
|
|
11
|
+
export declare const isRepoUrl: (val: unknown) => val is RepoUrls;
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/runtime/type-guards/urls/repos/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAK3C,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAA;AAEnC;;;;GAIG;AACH,eAAO,MAAM,SAAS,QAAS,OAAO,KAAG,GAAG,IAAI,QAE/C,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { isGithubUrl } from "./github";
|
|
2
|
+
import { isBitbucketUrl } from "./bitbucket";
|
|
3
|
+
import { isCodeCommitUrl } from "./codeCommit";
|
|
4
|
+
export * from "./github";
|
|
5
|
+
export * from "./bitbucket";
|
|
6
|
+
export * from "./codeCommit";
|
|
7
|
+
export * from "./isSemanticVersion";
|
|
8
|
+
/**
|
|
9
|
+
* **isRepoUrl**`(val)`
|
|
10
|
+
*
|
|
11
|
+
* Type guard which validates that the value passed in is a valid Repo URL
|
|
12
|
+
*/
|
|
13
|
+
export const isRepoUrl = (val) => {
|
|
14
|
+
return isGithubUrl(val) || isBitbucketUrl(val) || isCodeCommitUrl(val);
|
|
15
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { RepoSource, SemanticVersion } from "src/types/index";
|
|
2
|
+
/**
|
|
3
|
+
* **isRepoSource**`(val)`
|
|
4
|
+
*
|
|
5
|
+
* Type guard which validates whether the value passed in is a
|
|
6
|
+
* `RepoSource`.
|
|
7
|
+
*/
|
|
8
|
+
export declare const isRepoSource: <T>(v: T) => v is T & RepoSource;
|
|
9
|
+
/**
|
|
10
|
+
* **isSemanticVersion**`(val,[allowPrefix]=false)`
|
|
11
|
+
*
|
|
12
|
+
* Type guard which validates whether the value passed in is a
|
|
13
|
+
* semantic version number.
|
|
14
|
+
*
|
|
15
|
+
* - the optional `allowPrefix` parameter allows for a lowercase "v"
|
|
16
|
+
* to be prefixed to the version so that values like `v1.0.12` and
|
|
17
|
+
* `v 1.0.12` are allowed.
|
|
18
|
+
* - by default the `allowPrefix` option is set to false
|
|
19
|
+
*/
|
|
20
|
+
export declare const isSemanticVersion: <T, P extends boolean>(v: T, allowPrefix?: P) => v is T & SemanticVersion<P>;
|
|
21
|
+
//# sourceMappingURL=isSemanticVersion.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isSemanticVersion.d.ts","sourceRoot":"","sources":["../../../../../src/runtime/type-guards/urls/repos/isSemanticVersion.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,eAAe,EAChB,MAAM,iBAAiB,CAAC;AAIzB;;;;;GAKG;AACH,eAAO,MAAM,YAAY,GAAI,CAAC,KAAK,CAAC,KAAG,CAAC,IAAI,CAAC,GAAG,UAE/C,CAAA;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,iBAAiB,GAAI,CAAC,EAAC,CAAC,SAAS,OAAO,KACjD,CAAC,gBACU,CAAC,KACb,CAAC,IAAI,CAAC,GAAG,eAAe,CAAC,CAAC,CAa5B,CAAA"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { REPO_SOURCES } from "src/constants/index";
|
|
2
|
+
import { stripLeading, isString } from "src/runtime/index";
|
|
3
|
+
/**
|
|
4
|
+
* **isRepoSource**`(val)`
|
|
5
|
+
*
|
|
6
|
+
* Type guard which validates whether the value passed in is a
|
|
7
|
+
* `RepoSource`.
|
|
8
|
+
*/
|
|
9
|
+
export const isRepoSource = (v) => {
|
|
10
|
+
return isString(v) && REPO_SOURCES.includes(v);
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* **isSemanticVersion**`(val,[allowPrefix]=false)`
|
|
14
|
+
*
|
|
15
|
+
* Type guard which validates whether the value passed in is a
|
|
16
|
+
* semantic version number.
|
|
17
|
+
*
|
|
18
|
+
* - the optional `allowPrefix` parameter allows for a lowercase "v"
|
|
19
|
+
* to be prefixed to the version so that values like `v1.0.12` and
|
|
20
|
+
* `v 1.0.12` are allowed.
|
|
21
|
+
* - by default the `allowPrefix` option is set to false
|
|
22
|
+
*/
|
|
23
|
+
export const isSemanticVersion = (v, allowPrefix = false) => {
|
|
24
|
+
return (isString(v) &&
|
|
25
|
+
v.split(".").length === 3 &&
|
|
26
|
+
!Number.isNaN(Number(v.split(".")[1])) &&
|
|
27
|
+
!Number.isNaN(Number(v.split(".")[2])) &&
|
|
28
|
+
(!Number.isNaN(Number(v.split(".")[0])) ||
|
|
29
|
+
(allowPrefix && !Number.isNaN(Number(stripLeading(v.split(".")[0], "v").trim())))));
|
|
30
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"retail.d.ts","sourceRoot":"","sources":["../../../../src/runtime/type-guards/urls/retail.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AAwBvR;;;GAGG;AACH,eAAO,MAAM,eAAe,QAAS,OAAO,KAAG,GAAG,IAAI,aAErD,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,QAAQ,QAAS,OAAO,KAAG,GAAG,IAAI,MAE9C,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,cAAc,QAAS,OAAO,KAAG,GAAG,IAAI,YAEpD,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,YAAY,QAAS,OAAO,KAAG,GAAG,IAAI,SAElD,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,SAAS,QAAS,OAAO,KAAG,GAAG,IAAI,OAE/C,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,OAAO,Q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AED;;;GAGG;AACH,eAAO,MAAM,WAAW,QAAS,OAAO,KAAG,GAAG,IAAI,SAGjD,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isString } from "
|
|
1
|
+
import { isString } from "../isString";
|
|
2
2
|
import { AMAZON_DNS, APPLE_DNS, BEST_BUY_DNS, COSTCO_DNS, CVS_DNS, DELL_DNS, EBAY_DNS, ETSY_DNS, HM_DNS, HOME_DEPOT_DNS, KROGER_DNS, MACYS_DNS, NIKE_DNS, TARGET_DNS, WALGREENS_DNS, WALMART_DNS, WAYFAIR_DNS, WHOLE_FOODS_DNS, ZARA_DNS, } from "src/constants/index";
|
|
3
3
|
/**
|
|
4
4
|
* type guard which validates that the `val` passed in is a valid URL
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"youtube.d.ts","sourceRoot":"","sources":["../../../../src/runtime/type-guards/urls/youtube.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,cAAc,EACd,kBAAkB,EAClB,eAAe,EACf,UAAU,EACV,uBAAuB,EACxB,MAAM,iBAAiB,CAAC;AAGzB;;;;;GAKG;AACH,eAAO,MAAM,YAAY,GAAI,CAAC,OAAO,CAAC,KAAG,GAAG,IAAI,CAAC,GAAG,UAMnD,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,GAAI,CAAC,OAAM,CAAC,KAAG,GAAG,IAAI,CAAC,GAAG,eAEvD,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,GAAI,CAAC,OAAO,CAAC,KAAG,GAAG,IAAI,CAAC,GAAG,UAMxD,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,GAAI,CAAC,OAAO,CAAC,KAAG,GAAG,IAAI,CAAC,GAAG,kBAS3D,CAAA;AAeD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,gBAAgB,GAC3B,CAAC,EACD,CAAC,SAAS,eAAe,yBAErB,CAAC,SACE,CAAC,KACP,GAAG,IAAI,CAAC,GAAG,cAAc,CAAC,CAAC,CAK7B,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,GAAI,CAAC,OAAO,CAAC,YAKhD,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,GAAI,CAAC,OAAO,CAAC,YAK9C,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,GAAI,CAAC,OAAO,CAAC,YAK7C,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,yBAAyB,GAAI,CAAC,OAAO,CAAC,YAKlD,CAAA;AAGD,eAAO,MAAM,mBAAmB,GAAI,CAAC,SAAS,MAAM,OAC7C,CAAC,KACL,GAAG,IAAI,CAAC,GAAG,iBAMb,CAAA;AAED,eAAO,MAAM,yBAAyB,GAAI,CAAC,OAAO,CAAC,KAAG,GAAG,IAAI,CAAC,GAAG,uBAKhE,CAAA"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { REPO_SOURCE_LOOKUP } from "src/constants/index";
|
|
2
|
+
import { UrlsFrom } from "src/types/index";
|
|
3
|
+
type URL = typeof REPO_SOURCE_LOOKUP["bitbucket"];
|
|
4
|
+
/**
|
|
5
|
+
* All valid URL signatures for a Bitbucket repo.
|
|
6
|
+
*/
|
|
7
|
+
export type BitbucketUrl = UrlsFrom<URL>;
|
|
8
|
+
/**
|
|
9
|
+
* A URL pattern which will show the repositories for a given organization
|
|
10
|
+
*/
|
|
11
|
+
export type BitbucketRepoListUrl = `https://${URL[number]}/${string}/workspace/repositories`;
|
|
12
|
+
/**
|
|
13
|
+
* A URL pattern which matches any repo content in a Bitbucket repo.
|
|
14
|
+
*/
|
|
15
|
+
export type BitbucketRepoUrl<TOrg extends string, TRepo extends string> = `https://${URL[number]}/${TOrg}/${TRepo}`;
|
|
16
|
+
/**
|
|
17
|
+
* A URL pattern which matches any repo's summary page (for a given branch)
|
|
18
|
+
*/
|
|
19
|
+
export type BitbucketRepoSummaryUrl<TOrg extends string, TRepo extends string, TBranch extends string> = `https://${URL[number]}/${TOrg}/${TRepo}/src/${TBranch}`;
|
|
20
|
+
/**
|
|
21
|
+
* A URL pattern which matches a file in a given repo and branch
|
|
22
|
+
*/
|
|
23
|
+
export type BitbucketRepoFileUrl<TOrg extends string, TRepo extends string, TBranch extends string, TFilepath extends string> = `https://${URL[number]}/${TOrg}/${TRepo}/src/${TBranch}/${TFilepath}`;
|
|
24
|
+
export type BitbucketRepoPipelines<TOrg extends string, TRepo extends string> = `https://${URL[number]}/${TOrg}/${TRepo}/pipelines`;
|
|
25
|
+
export type BitbucketRepoBranchList<TOrg extends string, TRepo extends string> = `https://${URL[number]}/${TOrg}/${TRepo}/branches/`;
|
|
26
|
+
export type BitbucketRepoCommitsByBranch<TOrg extends string, TRepo extends string, TBranch extends string> = `https://${URL[number]}/${TOrg}/${TRepo}/commits/branch/${TBranch}`;
|
|
27
|
+
export type BitbucketRepoCommit<TOrg extends string, TRepo extends string, TCommit extends string> = `https://${URL[number]}/${TOrg}/${TRepo}/commits/${TCommit}`;
|
|
28
|
+
export type BitbucketRepoPullRequests<TOrg extends string, TRepo extends string> = `https://${URL[number]}/${TOrg}/${TRepo}/pull-requests/${string}`;
|
|
29
|
+
export {};
|
|
30
|
+
//# sourceMappingURL=bitbucket.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bitbucket.d.ts","sourceRoot":"","sources":["../../../../../src/types/string-literals/character-sets/urls/bitbucket.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE3C,KAAK,GAAG,GAAG,OAAO,kBAAkB,CAAC,WAAW,CAAC,CAAC;AAElD;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC;AAEzC;;GAEG;AACH,MAAM,MA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