@metacall/protocol 0.1.13 → 0.1.14
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/protocol.d.ts +7 -0
- package/dist/protocol.js +9 -1
- package/package.json +1 -1
- package/src/protocol.ts +22 -1
package/dist/protocol.d.ts
CHANGED
|
@@ -4,6 +4,12 @@ import { Plans } from './plan';
|
|
|
4
4
|
export declare const isProtocolError: (err: unknown) => boolean;
|
|
5
5
|
export { AxiosError as ProtocolError };
|
|
6
6
|
declare type SubscriptionMap = Record<string, number>;
|
|
7
|
+
export interface SubscriptionDeploy {
|
|
8
|
+
id: string;
|
|
9
|
+
plan: Plans;
|
|
10
|
+
date: number;
|
|
11
|
+
deploy: string;
|
|
12
|
+
}
|
|
7
13
|
export declare type ResourceType = 'Package' | 'Repository';
|
|
8
14
|
export interface AddResponse {
|
|
9
15
|
id: string;
|
|
@@ -16,6 +22,7 @@ interface API {
|
|
|
16
22
|
validate(): Promise<boolean>;
|
|
17
23
|
deployEnabled(): Promise<boolean>;
|
|
18
24
|
listSubscriptions(): Promise<SubscriptionMap>;
|
|
25
|
+
listSubscriptionsDeploys(): Promise<SubscriptionDeploy[]>;
|
|
19
26
|
inspect(): Promise<Deployment[]>;
|
|
20
27
|
upload(name: string, blob: unknown, jsons: MetaCallJSON[], runners: string[]): Promise<string>;
|
|
21
28
|
add(url: string, branch: string, jsons: MetaCallJSON[]): Promise<AddResponse>;
|
package/dist/protocol.js
CHANGED
|
@@ -9,11 +9,14 @@
|
|
|
9
9
|
validate: validates the auth token
|
|
10
10
|
deployEnabled: checks if you're able to deploy
|
|
11
11
|
listSubscriptions: gives you a list of the subscription available
|
|
12
|
+
listSubscriptionsDeploys: gives you a list of the subscription being used in deploys
|
|
12
13
|
inspect: gives you are deploys with it's endpoints
|
|
13
14
|
upload: uploads a zip (package) into the faas
|
|
14
15
|
deploy: deploys the previously uploaded zip into the faas
|
|
15
16
|
deployDelete: deletes the deploy and the zip
|
|
16
|
-
|
|
17
|
+
logs: retrieve the logs of a deploy by runner or deployment
|
|
18
|
+
branchList: get the branches of a repository
|
|
19
|
+
fileList: get files of a repository by branch
|
|
17
20
|
*/
|
|
18
21
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
19
22
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
@@ -57,6 +60,11 @@ exports.default = (token, baseURL) => {
|
|
|
57
60
|
}
|
|
58
61
|
return subscriptions;
|
|
59
62
|
},
|
|
63
|
+
listSubscriptionsDeploys: async () => axios_1.default
|
|
64
|
+
.get(baseURL + '/api/billing/list-subscriptions-deploys', {
|
|
65
|
+
headers: { Authorization: 'jwt ' + token }
|
|
66
|
+
})
|
|
67
|
+
.then(res => res.data),
|
|
60
68
|
inspect: async () => axios_1.default
|
|
61
69
|
.get(baseURL + '/api/inspect', {
|
|
62
70
|
headers: { Authorization: 'jwt ' + token }
|
package/package.json
CHANGED
package/src/protocol.ts
CHANGED
|
@@ -8,11 +8,14 @@
|
|
|
8
8
|
validate: validates the auth token
|
|
9
9
|
deployEnabled: checks if you're able to deploy
|
|
10
10
|
listSubscriptions: gives you a list of the subscription available
|
|
11
|
+
listSubscriptionsDeploys: gives you a list of the subscription being used in deploys
|
|
11
12
|
inspect: gives you are deploys with it's endpoints
|
|
12
13
|
upload: uploads a zip (package) into the faas
|
|
13
14
|
deploy: deploys the previously uploaded zip into the faas
|
|
14
15
|
deployDelete: deletes the deploy and the zip
|
|
15
|
-
|
|
16
|
+
logs: retrieve the logs of a deploy by runner or deployment
|
|
17
|
+
branchList: get the branches of a repository
|
|
18
|
+
fileList: get files of a repository by branch
|
|
16
19
|
*/
|
|
17
20
|
|
|
18
21
|
import axios, { AxiosError, AxiosResponse } from 'axios';
|
|
@@ -27,6 +30,13 @@ export { AxiosError as ProtocolError };
|
|
|
27
30
|
|
|
28
31
|
type SubscriptionMap = Record<string, number>;
|
|
29
32
|
|
|
33
|
+
export interface SubscriptionDeploy {
|
|
34
|
+
id: string;
|
|
35
|
+
plan: Plans;
|
|
36
|
+
date: number;
|
|
37
|
+
deploy: string;
|
|
38
|
+
}
|
|
39
|
+
|
|
30
40
|
export type ResourceType = 'Package' | 'Repository';
|
|
31
41
|
|
|
32
42
|
export interface AddResponse {
|
|
@@ -42,6 +52,7 @@ interface API {
|
|
|
42
52
|
validate(): Promise<boolean>;
|
|
43
53
|
deployEnabled(): Promise<boolean>;
|
|
44
54
|
listSubscriptions(): Promise<SubscriptionMap>;
|
|
55
|
+
listSubscriptionsDeploys(): Promise<SubscriptionDeploy[]>;
|
|
45
56
|
inspect(): Promise<Deployment[]>;
|
|
46
57
|
upload(
|
|
47
58
|
name: string,
|
|
@@ -122,6 +133,16 @@ export default (token: string, baseURL: string): API => {
|
|
|
122
133
|
return subscriptions;
|
|
123
134
|
},
|
|
124
135
|
|
|
136
|
+
listSubscriptionsDeploys: async (): Promise<SubscriptionDeploy[]> =>
|
|
137
|
+
axios
|
|
138
|
+
.get<SubscriptionDeploy[]>(
|
|
139
|
+
baseURL + '/api/billing/list-subscriptions-deploys',
|
|
140
|
+
{
|
|
141
|
+
headers: { Authorization: 'jwt ' + token }
|
|
142
|
+
}
|
|
143
|
+
)
|
|
144
|
+
.then(res => res.data),
|
|
145
|
+
|
|
125
146
|
inspect: async (): Promise<Deployment[]> =>
|
|
126
147
|
axios
|
|
127
148
|
.get<Deployment[]>(baseURL + '/api/inspect', {
|