@gitkraken/provider-apis 0.6.1

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.
@@ -0,0 +1,14 @@
1
+ import { BasicOptions } from '../gitProvider';
2
+ import { Issue } from '../issueProvider';
3
+ import { Provider } from '../provider';
4
+ export declare class Jira extends Provider {
5
+ getIssuesForProject(input: {
6
+ project: string;
7
+ resourceId: string;
8
+ assigneeLogins?: string[];
9
+ authorLogin?: string;
10
+ mentionLogin?: string;
11
+ }, options?: BasicOptions): Promise<{
12
+ data: Issue[];
13
+ }>;
14
+ }
@@ -0,0 +1,6 @@
1
+ import { ProviderConfig, ProviderConfigInit } from '../types';
2
+ export declare class Provider<Config extends ProviderConfigInit = ProviderConfigInit> {
3
+ protected config: ProviderConfig;
4
+ constructor(config?: Config);
5
+ updateConfig(config: Config): void;
6
+ }
@@ -0,0 +1,13 @@
1
+ import { BasicOptions } from '../gitProvider';
2
+ import { Issue } from '../issueProvider';
3
+ import { Provider } from '../provider';
4
+ export declare class Trello extends Provider {
5
+ getIssuesForBoard(input: {
6
+ appKey: string;
7
+ boardId: string;
8
+ filterText?: string;
9
+ assigneeLogins?: string[];
10
+ }, options?: BasicOptions): Promise<{
11
+ data: Issue[];
12
+ }>;
13
+ }
@@ -0,0 +1,76 @@
1
+ /// <reference types="node-fetch" />
2
+ export type Fetch = typeof import('node-fetch').default;
3
+ export declare const isFetch: (fetch: Fetch | RequestFunction) => fetch is typeof import("node-fetch").default;
4
+ export type RequestFunction = <T>(options: RequestOptions) => Promise<Response<T>>;
5
+ export interface Config extends SharedConfig {
6
+ github?: ProviderBaseConfig & EnterpriseConfig;
7
+ gitlab?: ProviderBaseConfig;
8
+ bitbucket?: ProviderBaseConfig;
9
+ azureDevOps?: ProviderBaseConfig;
10
+ jira?: ProviderBaseConfig;
11
+ trello?: ProviderBaseConfig;
12
+ }
13
+ export interface SharedConfig {
14
+ request?: RequestFunction | Fetch;
15
+ }
16
+ export interface ProviderBaseConfig {
17
+ token?: string;
18
+ isPAT?: boolean;
19
+ }
20
+ export interface EnterpriseConfig {
21
+ baseUrl?: string;
22
+ }
23
+ export type ProviderConfigInit = SharedConfig & ProviderBaseConfig;
24
+ export type EnterpriseProviderConfigInit = ProviderConfigInit & EnterpriseConfig;
25
+ export interface ProviderConfig extends EnterpriseProviderConfigInit {
26
+ request: RequestFunction;
27
+ }
28
+ export type Headers = Record<string, any>;
29
+ export interface RequestOptions {
30
+ url: string;
31
+ method?: string;
32
+ body?: string;
33
+ headers?: Headers;
34
+ [key: string]: any;
35
+ }
36
+ export interface Response<T> {
37
+ body: T;
38
+ status: number;
39
+ statusText: string;
40
+ headers: Headers;
41
+ }
42
+ export interface GraphQLBody {
43
+ query: string;
44
+ variables?: Headers;
45
+ }
46
+ export interface GraphQLResponse<T = unknown> {
47
+ data?: T;
48
+ errors?: GraphQLError[];
49
+ }
50
+ export interface GraphQLError {
51
+ path: string[];
52
+ locations: {
53
+ line: number;
54
+ column: number;
55
+ }[];
56
+ message: string;
57
+ extensions?: {
58
+ [key: string]: any;
59
+ };
60
+ type?: string;
61
+ }
62
+ export interface CursorPageInfo {
63
+ hasNextPage: boolean;
64
+ endCursor: string | null;
65
+ }
66
+ export interface NumberedPageInfo {
67
+ hasNextPage: boolean;
68
+ nextPage: number | null;
69
+ }
70
+ export type Result<T> = {
71
+ data: T;
72
+ };
73
+ export type PagedResult<T> = {
74
+ pageInfo: CursorPageInfo | NumberedPageInfo;
75
+ data: T[];
76
+ };
@@ -0,0 +1 @@
1
+ export declare const getRequestHeaders: (token?: string, basicAuth?: boolean) => Record<string, string>;
package/package.json ADDED
@@ -0,0 +1,59 @@
1
+ {
2
+ "name": "@gitkraken/provider-apis",
3
+ "version": "0.6.1",
4
+ "repository": "https://github.com/gitkraken/provider-apis-package-js",
5
+ "author": "Axosoft, LLC dba GitKraken",
6
+ "license": "SEE LICENSE IN LICENSE",
7
+ "engines": {
8
+ "node": ">= 14"
9
+ },
10
+ "main": "dist/index.js",
11
+ "types": "dist/index.d.ts",
12
+ "files": [
13
+ "dist"
14
+ ],
15
+ "scripts": {
16
+ "build": "yarn clean && node ./scripts/build.mjs && tsc",
17
+ "build-docs": "typedoc --plugin typedoc-plugin-markdown --includeVersion --gitRevision 0.6.0 --excludePrivate --excludeProtected --out docs src/index.ts",
18
+ "ci": "yarn lint:ci && yarn prettier:ci && yarn build && yarn test",
19
+ "clean": "rimraf dist",
20
+ "lint": "eslint src test --fix",
21
+ "lint:ci": "eslint src test --max-warnings 0",
22
+ "prepublishOnly": "yarn build",
23
+ "prettier": "prettier --write src test",
24
+ "prettier:ci": "prettier --check src test",
25
+ "test": "yarn test:unit && yarn test:integration",
26
+ "test:unit": "mocha --require ts-node/register 'test/unit/**/*.ts'",
27
+ "test:integration": "mocha --require ts-node/register 'test/integration/**/*.ts'",
28
+ "update-licenses": "node ./scripts/generateLicenses.mjs",
29
+ "watch": "yarn clean && node ./scripts/build.mjs --watch & tsc -w"
30
+ },
31
+ "dependencies": {
32
+ "node-fetch": "2.6.9"
33
+ },
34
+ "devDependencies": {
35
+ "@types/chai": "^4.3.5",
36
+ "@types/mocha": "^10.0.1",
37
+ "@types/node-fetch": "^2.6.4",
38
+ "@types/sinon": "^10.0.15",
39
+ "@typescript-eslint/eslint-plugin": "^5.59.9",
40
+ "@typescript-eslint/parser": "^5.59.9",
41
+ "chai": "^4.3.7",
42
+ "dotenv": "^16.3.1",
43
+ "esbuild": "^0.19.2",
44
+ "eslint": "^8.42.0",
45
+ "eslint-plugin-no-only-tests": "^3.1.0",
46
+ "license-checker-rseidelsohn": "^4.2.6",
47
+ "mocha": "^10.2.0",
48
+ "prettier": "2.8.8",
49
+ "rimraf": "^5.0.1",
50
+ "sinon": "^15.2.0",
51
+ "ts-node": "^10.9.1",
52
+ "typedoc": "^0.24.8",
53
+ "typedoc-plugin-markdown": "^3.15.3",
54
+ "typescript": "5.0.4"
55
+ },
56
+ "resolutions": {
57
+ "jackspeak": "2.1.1"
58
+ }
59
+ }