@sparted/shared-library 1.0.8-alpha.5 → 1.0.8-alpha.6
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.
|
@@ -7,6 +7,7 @@ export declare type CreatePullRequestArgs = {
|
|
|
7
7
|
};
|
|
8
8
|
export declare type CreatePullRequestResponse = {
|
|
9
9
|
url: string;
|
|
10
|
+
number: number;
|
|
10
11
|
};
|
|
11
12
|
export declare type CreatePullRequest = (args: CreatePullRequestArgs) => Promise<CreatePullRequestResponse>;
|
|
12
13
|
export declare type CreatePullRequestFactory = (instance: AxiosInstance) => CreatePullRequest;
|
|
@@ -8,6 +8,7 @@ var utils = require('../commit/utils.js');
|
|
|
8
8
|
|
|
9
9
|
const createPullRequestResponseSchema = zod.z.object({
|
|
10
10
|
url: zod.z.string(),
|
|
11
|
+
number: zod.z.number(),
|
|
11
12
|
});
|
|
12
13
|
const createPullRequestFactory = (instance) => (args) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
13
14
|
const { title, body, head, base } = args;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-pull-request.js","sources":["../../../src/github/merge/create-pull-request.ts"],"sourcesContent":["import type { AxiosInstance } from 'axios';\nimport { z } from 'zod';\n\nimport { handleError } from '../commit/utils';\n\nexport type CreatePullRequestArgs = {\n title: string;\n body: string;\n head: string;\n base: string;\n};\n\nexport type CreatePullRequestResponse = {\n url: string;\n};\n\nconst createPullRequestResponseSchema = z.object({\n url: z.string(),\n});\n\nexport type CreatePullRequest = (args: CreatePullRequestArgs) => Promise<CreatePullRequestResponse>;\n\nexport type CreatePullRequestFactory = (instance: AxiosInstance) => CreatePullRequest;\n\nexport const createPullRequestFactory: CreatePullRequestFactory = (instance) => async (args) => {\n const { title, body, head, base } = args;\n\n try {\n const { data } = await instance.post<CreatePullRequestResponse>('/pulls', {\n title,\n body,\n head,\n base,\n });\n\n return createPullRequestResponseSchema.parse(data);\n } catch (error) {\n throw handleError(error);\n }\n};\n"],"names":["z","__awaiter","handleError"],"mappings":";;;;;;;;
|
|
1
|
+
{"version":3,"file":"create-pull-request.js","sources":["../../../src/github/merge/create-pull-request.ts"],"sourcesContent":["import type { AxiosInstance } from 'axios';\nimport { z } from 'zod';\n\nimport { handleError } from '../commit/utils';\n\nexport type CreatePullRequestArgs = {\n title: string;\n body: string;\n head: string;\n base: string;\n};\n\nexport type CreatePullRequestResponse = {\n url: string;\n number: number;\n};\n\nconst createPullRequestResponseSchema = z.object({\n url: z.string(),\n number: z.number(),\n});\n\nexport type CreatePullRequest = (args: CreatePullRequestArgs) => Promise<CreatePullRequestResponse>;\n\nexport type CreatePullRequestFactory = (instance: AxiosInstance) => CreatePullRequest;\n\nexport const createPullRequestFactory: CreatePullRequestFactory = (instance) => async (args) => {\n const { title, body, head, base } = args;\n\n try {\n const { data } = await instance.post<CreatePullRequestResponse>('/pulls', {\n title,\n body,\n head,\n base,\n });\n\n return createPullRequestResponseSchema.parse(data);\n } catch (error) {\n throw handleError(error);\n }\n};\n"],"names":["z","__awaiter","handleError"],"mappings":";;;;;;;;AAiBA,MAAM,+BAA+B,GAAGA,KAAC,CAAC,MAAM,CAAC;AAC/C,IAAA,GAAG,EAAEA,KAAC,CAAC,MAAM,EAAE;AACf,IAAA,MAAM,EAAEA,KAAC,CAAC,MAAM,EAAE;AACnB,CAAA,CAAC,CAAC;AAMI,MAAM,wBAAwB,GAA6B,CAAC,QAAQ,KAAK,CAAO,IAAI,KAAIC,gBAAA,CAAA,KAAA,CAAA,EAAA,KAAA,CAAA,EAAA,KAAA,CAAA,EAAA,aAAA;IAC7F,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC;IAEzC,IAAI;QACF,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,QAAQ,CAAC,IAAI,CAA4B,QAAQ,EAAE;YACxE,KAAK;YACL,IAAI;YACJ,IAAI;YACJ,IAAI;AACL,SAAA,CAAC,CAAC;AAEH,QAAA,OAAO,+BAA+B,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;AACpD,KAAA;AAAC,IAAA,OAAO,KAAK,EAAE;AACd,QAAA,MAAMC,iBAAW,CAAC,KAAK,CAAC,CAAC;AAC1B,KAAA;AACH,CAAC;;;;"}
|
package/dist/package.json
CHANGED
package/package.json
CHANGED
|
@@ -12,10 +12,12 @@ export type CreatePullRequestArgs = {
|
|
|
12
12
|
|
|
13
13
|
export type CreatePullRequestResponse = {
|
|
14
14
|
url: string;
|
|
15
|
+
number: number;
|
|
15
16
|
};
|
|
16
17
|
|
|
17
18
|
const createPullRequestResponseSchema = z.object({
|
|
18
19
|
url: z.string(),
|
|
20
|
+
number: z.number(),
|
|
19
21
|
});
|
|
20
22
|
|
|
21
23
|
export type CreatePullRequest = (args: CreatePullRequestArgs) => Promise<CreatePullRequestResponse>;
|