epicenter-libs 3.34.1 → 3.35.0
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/CHANGELOG.md +50 -0
- package/README.md +61 -86
- package/dist/browser/epicenter.js +1586 -230
- package/dist/browser/epicenter.js.map +1 -1
- package/dist/cjs/epicenter.js +1508 -145
- package/dist/cjs/epicenter.js.map +1 -1
- package/dist/cjs/package.json +1 -0
- package/dist/epicenter.js +1592 -229
- package/dist/epicenter.js.map +1 -1
- package/dist/epicenter.min.js +1 -1
- package/dist/epicenter.min.js.map +1 -1
- package/dist/module/epicenter.js +1502 -146
- package/dist/module/epicenter.js.map +1 -1
- package/dist/types/adapters/docket.d.ts +80 -0
- package/dist/types/adapters/encyclopedia.d.ts +86 -0
- package/dist/types/adapters/file.d.ts +201 -0
- package/dist/types/adapters/git.d.ts +171 -0
- package/dist/types/adapters/index.d.ts +8 -1
- package/dist/types/adapters/pipeline.d.ts +88 -0
- package/dist/types/adapters/powerpoint.d.ts +130 -0
- package/dist/types/adapters/registration.d.ts +270 -0
- package/dist/types/adapters/task.d.ts +99 -37
- package/dist/types/epicenter.d.ts +2 -2
- package/dist/types/types.d.ts +6 -1
- package/dist/types/utils/router.d.ts +1 -0
- package/package.json +12 -7
- package/src/adapters/docket.ts +109 -0
- package/src/adapters/encyclopedia.ts +128 -0
- package/src/adapters/file.ts +332 -0
- package/src/adapters/git.ts +278 -0
- package/src/adapters/index.ts +14 -0
- package/src/adapters/pipeline.ts +145 -0
- package/src/adapters/powerpoint.ts +238 -0
- package/src/adapters/registration.ts +413 -0
- package/src/adapters/task.ts +170 -47
- package/src/epicenter.ts +10 -3
- package/src/globals.d.ts +6 -0
- package/src/types.ts +61 -0
- package/src/utils/config.ts +5 -4
- package/src/utils/router.ts +1 -0
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import type { RoutingOptions } from '../utils/router';
|
|
2
|
+
import type { TaskTriggerCreateInView } from './task';
|
|
3
|
+
export type OperatingSystem = 'LINUX' | 'MAC' | 'WINDOWS';
|
|
4
|
+
export type WorkerShape = 'GS' | 'GM' | 'GL' | 'GXL' | 'G2XL' | 'G4XL' | 'ML' | 'MXL' | 'M2XL' | 'M4XL' | 'CL' | 'CXL' | 'C2XL' | 'C4XL';
|
|
5
|
+
export type ScaleFlavor = 'PROCESS' | 'DOCKER' | 'JVM' | 'WSDL';
|
|
6
|
+
export interface ScaleCreateInView {
|
|
7
|
+
active: boolean;
|
|
8
|
+
initialWorkerCount: number;
|
|
9
|
+
additionalWorkerLimit: number;
|
|
10
|
+
flavors?: ScaleFlavor[];
|
|
11
|
+
}
|
|
12
|
+
export interface ScaleReadOutView {
|
|
13
|
+
active?: boolean | null;
|
|
14
|
+
initialWorkerCount?: number | null;
|
|
15
|
+
additionalWorkerLimit?: number | null;
|
|
16
|
+
flavors?: ScaleFlavor[] | null;
|
|
17
|
+
test?: boolean | null;
|
|
18
|
+
shape?: WorkerShape | null;
|
|
19
|
+
operatingSystem?: OperatingSystem | null;
|
|
20
|
+
}
|
|
21
|
+
export interface ScaleDocketPayloadCreateInView {
|
|
22
|
+
objectType: 'scale';
|
|
23
|
+
scale: ScaleCreateInView;
|
|
24
|
+
operatingSystem: OperatingSystem;
|
|
25
|
+
workerShape: WorkerShape;
|
|
26
|
+
test?: boolean;
|
|
27
|
+
}
|
|
28
|
+
export interface ScaleDocketPayloadReadOutView {
|
|
29
|
+
objectType: 'scale';
|
|
30
|
+
scale?: ScaleReadOutView | null;
|
|
31
|
+
operatingSystem?: OperatingSystem | null;
|
|
32
|
+
workerShape?: WorkerShape | null;
|
|
33
|
+
test?: boolean | null;
|
|
34
|
+
}
|
|
35
|
+
export type DocketPayloadCreateInView = ScaleDocketPayloadCreateInView;
|
|
36
|
+
export type DocketPayloadReadOutView = ScaleDocketPayloadReadOutView;
|
|
37
|
+
export interface DocketReadOutView {
|
|
38
|
+
docketKey?: string | null;
|
|
39
|
+
date?: string | null;
|
|
40
|
+
payload?: DocketPayloadReadOutView | null;
|
|
41
|
+
ttlMinutes?: number | null;
|
|
42
|
+
complete?: boolean | null;
|
|
43
|
+
error?: string | null;
|
|
44
|
+
attempts?: number | null;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Creates a new docket entry, scheduling a deferred operation for later execution.
|
|
48
|
+
* Requires `support` level authorization.
|
|
49
|
+
* Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/docket`
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* import { docketAdapter } from 'epicenter-libs';
|
|
53
|
+
* const docket = await docketAdapter.create(
|
|
54
|
+
* {
|
|
55
|
+
* objectType: 'scale',
|
|
56
|
+
* operatingSystem: 'LINUX',
|
|
57
|
+
* workerShape: 'GS',
|
|
58
|
+
* scale: {
|
|
59
|
+
* active: true,
|
|
60
|
+
* initialWorkerCount: 1,
|
|
61
|
+
* additionalWorkerLimit: 4,
|
|
62
|
+
* flavors: ['DOCKER'],
|
|
63
|
+
* },
|
|
64
|
+
* },
|
|
65
|
+
* { objectType: 'date', value: '2026-06-01T00:00:00Z' },
|
|
66
|
+
* '2026-05-20T00:00:00Z',
|
|
67
|
+
* { ttlMinutes: 60 },
|
|
68
|
+
* );
|
|
69
|
+
*
|
|
70
|
+
* @param payload Docket payload describing the operation to schedule
|
|
71
|
+
* @param trigger Trigger describing when the operation should fire
|
|
72
|
+
* (cron, date, or offset)
|
|
73
|
+
* @param date ISO-8601 date string indicating when the docket is scheduled
|
|
74
|
+
* @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.
|
|
75
|
+
* @param [optionals.ttlMinutes] Time-to-live in minutes for the docket entry (minimum 2)
|
|
76
|
+
* @returns promise that resolves to the newly created docket
|
|
77
|
+
*/
|
|
78
|
+
export declare function create(payload: DocketPayloadCreateInView, trigger: TaskTriggerCreateInView, date: string, optionals?: {
|
|
79
|
+
ttlMinutes?: number;
|
|
80
|
+
} & RoutingOptions): Promise<DocketReadOutView>;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import type { RoutingOptions } from '../utils/router';
|
|
2
|
+
export type EncyclopediaTranslator = 'ASCIIDOC' | 'ASCIIDOC_TO_HTML' | 'OPENAPI';
|
|
3
|
+
export type DocumentedEndpointMethod = 'CONNECT' | 'DELETE' | 'GET' | 'HEAD' | 'OPTIONS' | 'PATCH' | 'POST' | 'PUT' | 'TRACE';
|
|
4
|
+
export type DocumentedEndpointAuthorization = 'SYSTEM' | 'DASHBOARD' | 'OWNER' | 'AUTHOR' | 'SUPPORT' | 'REVIEWER' | 'FACILITATOR' | 'LEADER' | 'PARTICIPANT' | 'ANONYMOUS';
|
|
5
|
+
export type DocumentedEndpointNotation = 'POST_RATHER_THAN_GET' | 'UNSUPPORTED_IGNORED';
|
|
6
|
+
export type DocumentedParameterSource = 'PATH' | 'HEADER' | 'QUERY' | 'MATRIX';
|
|
7
|
+
export interface DocumentedParameter {
|
|
8
|
+
name?: string;
|
|
9
|
+
source?: DocumentedParameterSource;
|
|
10
|
+
type?: Record<string, unknown>;
|
|
11
|
+
}
|
|
12
|
+
export interface DocumentedEndpoint {
|
|
13
|
+
method?: DocumentedEndpointMethod;
|
|
14
|
+
path?: string;
|
|
15
|
+
authorization?: DocumentedEndpointAuthorization;
|
|
16
|
+
response?: Record<string, unknown>;
|
|
17
|
+
summary?: string;
|
|
18
|
+
description?: string;
|
|
19
|
+
deprecated?: boolean;
|
|
20
|
+
paged?: boolean;
|
|
21
|
+
notations?: DocumentedEndpointNotation[];
|
|
22
|
+
body?: Record<string, unknown>;
|
|
23
|
+
parameters?: DocumentedParameter[];
|
|
24
|
+
produces?: unknown[];
|
|
25
|
+
consumes?: unknown[];
|
|
26
|
+
}
|
|
27
|
+
export interface DocumentedResource {
|
|
28
|
+
silenced?: boolean;
|
|
29
|
+
endpoints?: DocumentedEndpoint[];
|
|
30
|
+
definitions?: Record<string, unknown>;
|
|
31
|
+
}
|
|
32
|
+
export interface KnownServiceReadOutView {
|
|
33
|
+
name?: string;
|
|
34
|
+
development?: boolean;
|
|
35
|
+
trusted?: boolean;
|
|
36
|
+
published?: boolean;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Lists the known API services available for the given encyclopedia version.
|
|
40
|
+
* Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/encyclopedia/v{version}`
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* import { encyclopediaAdapter } from 'epicenter-libs';
|
|
44
|
+
* const services = await encyclopediaAdapter.listServices(3);
|
|
45
|
+
*
|
|
46
|
+
* @param version Encyclopedia version number
|
|
47
|
+
* @param [optionals] Optional arguments; pass network call options overrides here.
|
|
48
|
+
* @returns promise that resolves to an array of known service descriptors
|
|
49
|
+
*/
|
|
50
|
+
export declare function listServices(version: number, optionals?: RoutingOptions): Promise<KnownServiceReadOutView[]>;
|
|
51
|
+
/**
|
|
52
|
+
* Retrieves the documented resource (API documentation) for a specific service and encyclopedia version.
|
|
53
|
+
* Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/encyclopedia/v{version}/{api}`
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* import { encyclopediaAdapter } from 'epicenter-libs';
|
|
57
|
+
* const resource = await encyclopediaAdapter.getResource(3, 'run');
|
|
58
|
+
*
|
|
59
|
+
* @param version Encyclopedia version number
|
|
60
|
+
* @param api Name of the API service to retrieve documentation for
|
|
61
|
+
* @param [optionals] Optional arguments; pass network call options overrides here.
|
|
62
|
+
* @returns promise that resolves to the documented resource containing endpoints and definitions
|
|
63
|
+
*/
|
|
64
|
+
export declare function getResource(version: number, api: string, optionals?: RoutingOptions): Promise<DocumentedResource>;
|
|
65
|
+
/**
|
|
66
|
+
* Retrieves a translated representation of the API documentation for a specific service and encyclopedia version.
|
|
67
|
+
* Supported translators are ASCIIDOC, ASCIIDOC_TO_HTML, and OPENAPI.
|
|
68
|
+
* Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/encyclopedia/as/{translator}/v{version}/{api}`
|
|
69
|
+
*
|
|
70
|
+
* NOTE: The backend returns the translated content with a translator-specific content-type
|
|
71
|
+
* (e.g. `text/asciidoc`, `text/html`, `application/json`). The shared Router throws when the
|
|
72
|
+
* response content-type is not `application/json`, so only the OPENAPI translator works here.
|
|
73
|
+
* For ASCIIDOC and ASCIIDOC_TO_HTML, use the underlying fetch API directly against the
|
|
74
|
+
* constructed URL.
|
|
75
|
+
*
|
|
76
|
+
* @example
|
|
77
|
+
* import { encyclopediaAdapter } from 'epicenter-libs';
|
|
78
|
+
* const openApiDoc = await encyclopediaAdapter.translate('OPENAPI', 3, 'run');
|
|
79
|
+
*
|
|
80
|
+
* @param translator Output format for the documentation; one of 'ASCIIDOC', 'ASCIIDOC_TO_HTML', or 'OPENAPI'
|
|
81
|
+
* @param version Encyclopedia version number
|
|
82
|
+
* @param api Name of the API service to translate documentation for
|
|
83
|
+
* @param [optionals] Optional arguments; pass network call options overrides here.
|
|
84
|
+
* @returns promise that resolves to the translated documentation (only when translator is 'OPENAPI')
|
|
85
|
+
*/
|
|
86
|
+
export declare function translate(translator: EncyclopediaTranslator, version: number, api: string, optionals?: RoutingOptions): Promise<unknown>;
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
import type { RoutingOptions } from '../utils/router';
|
|
2
|
+
export interface FileEntry {
|
|
3
|
+
objectType: 'file';
|
|
4
|
+
name?: string;
|
|
5
|
+
lastModifiedTime?: string;
|
|
6
|
+
size?: number;
|
|
7
|
+
contentType?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface DirectoryEntry {
|
|
10
|
+
objectType: 'directory';
|
|
11
|
+
name?: string;
|
|
12
|
+
lastModifiedTime?: string;
|
|
13
|
+
children?: FileSystemEntry[];
|
|
14
|
+
}
|
|
15
|
+
export type FileSystemEntry = FileEntry | DirectoryEntry;
|
|
16
|
+
/**
|
|
17
|
+
* Lists files and directories at the project root or at a specific path.
|
|
18
|
+
* Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/file[/{filePath}]`
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* import { fileAdapter } from 'epicenter-libs';
|
|
22
|
+
* // List all files at root
|
|
23
|
+
* const entries = await fileAdapter.list();
|
|
24
|
+
* // List contents of a specific directory up to 2 levels deep
|
|
25
|
+
* const entries = await fileAdapter.list('src', { depth: 2 });
|
|
26
|
+
*
|
|
27
|
+
* @param [filePath] Path to a file or directory; omit to list the project root
|
|
28
|
+
* @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.
|
|
29
|
+
* @param [optionals.depth] Maximum depth of directory traversal to include in the response
|
|
30
|
+
* @returns promise that resolves to an array of file and directory entries
|
|
31
|
+
*/
|
|
32
|
+
export declare function list(filePath?: string, optionals?: {
|
|
33
|
+
depth?: number;
|
|
34
|
+
} & RoutingOptions): Promise<FileSystemEntry[]>;
|
|
35
|
+
/**
|
|
36
|
+
* Uploads and replaces files at the project root or at a specific path using multipart/form-data (PUT).
|
|
37
|
+
* Use this when you want to overwrite existing files. For creating new files, use `create`.
|
|
38
|
+
* Base URL: PUT `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/file[/{filePath}]`
|
|
39
|
+
*
|
|
40
|
+
* NOTE: This is browser-only. The `FormData` body is only serialized as multipart/form-data when
|
|
41
|
+
* running in a browser environment; in Node it will not be sent correctly.
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* import { fileAdapter } from 'epicenter-libs';
|
|
45
|
+
* const formData = new FormData();
|
|
46
|
+
* formData.append('file', myFile);
|
|
47
|
+
* const uploaded = await fileAdapter.upload(formData, 'models/model.py');
|
|
48
|
+
*
|
|
49
|
+
* @param formData Multipart form data containing the file(s) to upload
|
|
50
|
+
* @param [filePath] Destination path for the file(s); omit to upload to the project root
|
|
51
|
+
* @param [optionals] Optional arguments; pass network call options overrides here.
|
|
52
|
+
* @returns promise that resolves to an array of the uploaded file entries
|
|
53
|
+
*/
|
|
54
|
+
export declare function upload(formData: FormData, filePath?: string, optionals?: RoutingOptions): Promise<FileEntry[]>;
|
|
55
|
+
/**
|
|
56
|
+
* Creates new files at the project root or at a specific path using multipart/form-data (POST).
|
|
57
|
+
* Use this when creating new files. For overwriting existing files, use `upload`.
|
|
58
|
+
* Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/file[/{filePath}]`
|
|
59
|
+
*
|
|
60
|
+
* NOTE: This is browser-only. The `FormData` body is only serialized as multipart/form-data when
|
|
61
|
+
* running in a browser environment; in Node it will not be sent correctly.
|
|
62
|
+
*
|
|
63
|
+
* @example
|
|
64
|
+
* import { fileAdapter } from 'epicenter-libs';
|
|
65
|
+
* const formData = new FormData();
|
|
66
|
+
* formData.append('file', myFile);
|
|
67
|
+
* const created = await fileAdapter.create(formData, 'models/model.py');
|
|
68
|
+
*
|
|
69
|
+
* @param formData Multipart form data containing the file(s) to create
|
|
70
|
+
* @param [filePath] Destination path for the file(s); omit to create at the project root
|
|
71
|
+
* @param [optionals] Optional arguments; pass network call options overrides here.
|
|
72
|
+
* @returns promise that resolves to an array of the created file entries
|
|
73
|
+
*/
|
|
74
|
+
export declare function create(formData: FormData, filePath?: string, optionals?: RoutingOptions): Promise<FileEntry[]>;
|
|
75
|
+
/**
|
|
76
|
+
* Deletes a file or directory at the project root or at a specific path.
|
|
77
|
+
* Base URL: DELETE `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/file[/{filePath}]`
|
|
78
|
+
*
|
|
79
|
+
* @example
|
|
80
|
+
* import { fileAdapter } from 'epicenter-libs';
|
|
81
|
+
* // Delete a specific file
|
|
82
|
+
* await fileAdapter.remove('models/old-model.py');
|
|
83
|
+
* // Delete all files at the project root
|
|
84
|
+
* await fileAdapter.remove();
|
|
85
|
+
*
|
|
86
|
+
* @param [filePath] Path of the file or directory to delete; omit to delete all files at the project root
|
|
87
|
+
* @param [optionals] Optional arguments; pass network call options overrides here.
|
|
88
|
+
* @returns promise that resolves when the deletion is complete
|
|
89
|
+
*/
|
|
90
|
+
export declare function remove(filePath?: string, optionals?: RoutingOptions): Promise<void>;
|
|
91
|
+
/**
|
|
92
|
+
* Downloads the raw content of a file at the specified path.
|
|
93
|
+
* Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/file/download/{filePath}`
|
|
94
|
+
*
|
|
95
|
+
* NOTE: The backend streams the file with its detected content type (e.g. `application/zip`,
|
|
96
|
+
* `text/plain`, `application/octet-stream`). The shared Router throws when the response
|
|
97
|
+
* content-type is not `application/json`, so this call only succeeds for JSON files. To download
|
|
98
|
+
* other file types, use the underlying fetch API directly against the constructed URL.
|
|
99
|
+
*
|
|
100
|
+
* @example
|
|
101
|
+
* import { fileAdapter } from 'epicenter-libs';
|
|
102
|
+
* const content = await fileAdapter.download('config.json');
|
|
103
|
+
*
|
|
104
|
+
* @param filePath Path to the file to download
|
|
105
|
+
* @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.
|
|
106
|
+
* @param [optionals.depth] Currently unused on the backend; reserved for future expansion.
|
|
107
|
+
* @returns promise that resolves to the raw file content
|
|
108
|
+
*/
|
|
109
|
+
export declare function download(filePath: string, optionals?: {
|
|
110
|
+
depth?: number;
|
|
111
|
+
} & RoutingOptions): Promise<unknown>;
|
|
112
|
+
/**
|
|
113
|
+
* Lists files and directories matching a glob filter pattern, optionally scoped to a specific path.
|
|
114
|
+
* Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/file/filter/{filter}[/{filePath}]`
|
|
115
|
+
*
|
|
116
|
+
* @example
|
|
117
|
+
* import { fileAdapter } from 'epicenter-libs';
|
|
118
|
+
* // List all Python files in the project
|
|
119
|
+
* const pyFiles = await fileAdapter.listByFilter('*.py');
|
|
120
|
+
* // List all Python files within the 'models' directory
|
|
121
|
+
* const pyFiles = await fileAdapter.listByFilter('*.py', 'models');
|
|
122
|
+
*
|
|
123
|
+
* @param filter Glob pattern to filter files by (e.g., '*.py', '*.json')
|
|
124
|
+
* @param [filePath] Directory path to scope the filter to; omit to search the entire project
|
|
125
|
+
* @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.
|
|
126
|
+
* @param [optionals.depth] Maximum depth of directory traversal to include in the response
|
|
127
|
+
* @returns promise that resolves to an array of matching file and directory entries
|
|
128
|
+
*/
|
|
129
|
+
export declare function listByFilter(filter: string, filePath?: string, optionals?: {
|
|
130
|
+
depth?: number;
|
|
131
|
+
} & RoutingOptions): Promise<FileSystemEntry[]>;
|
|
132
|
+
/**
|
|
133
|
+
* Compresses files into a ZIP archive at the project root or at a specific path.
|
|
134
|
+
* Base URL: PATCH `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/file/compress[/{filePath}]`
|
|
135
|
+
*
|
|
136
|
+
* NOTE: The backend streams the resulting archive with content-type `application/zip`. The
|
|
137
|
+
* shared Router throws when the response content-type is not `application/json`, so this call
|
|
138
|
+
* will not return the archive bytes through the normal flow. To retrieve the archive, use the
|
|
139
|
+
* underlying fetch API directly against the constructed URL.
|
|
140
|
+
*
|
|
141
|
+
* @example
|
|
142
|
+
* import { fileAdapter } from 'epicenter-libs';
|
|
143
|
+
* // Compress a specific file or directory
|
|
144
|
+
* await fileAdapter.compress('models');
|
|
145
|
+
* // Compress at root
|
|
146
|
+
* await fileAdapter.compress();
|
|
147
|
+
*
|
|
148
|
+
* @param [filePath] Path of the file or directory to compress; omit to compress at the project root
|
|
149
|
+
* @param [optionals] Optional arguments; pass network call options overrides here.
|
|
150
|
+
* @returns promise that resolves to the compression result
|
|
151
|
+
*/
|
|
152
|
+
export declare function compress(filePath?: string, optionals?: RoutingOptions): Promise<unknown>;
|
|
153
|
+
/**
|
|
154
|
+
* Extracts (explodes) a ZIP archive at the project root or at a specific path in place,
|
|
155
|
+
* deleting the archive after extraction.
|
|
156
|
+
* Base URL: PATCH `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/file/explode[/{filePath}]`
|
|
157
|
+
*
|
|
158
|
+
* @example
|
|
159
|
+
* import { fileAdapter } from 'epicenter-libs';
|
|
160
|
+
* // Extract a specific archive
|
|
161
|
+
* await fileAdapter.explode('archive.zip');
|
|
162
|
+
* // Explode at root
|
|
163
|
+
* await fileAdapter.explode();
|
|
164
|
+
*
|
|
165
|
+
* @param [filePath] Path of the archive to extract; omit to extract at the project root
|
|
166
|
+
* @param [optionals] Optional arguments; pass network call options overrides here.
|
|
167
|
+
* @returns promise that resolves when the extraction is complete
|
|
168
|
+
*/
|
|
169
|
+
export declare function explode(filePath?: string, optionals?: RoutingOptions): Promise<void>;
|
|
170
|
+
/**
|
|
171
|
+
* Moves a file or directory from one path to another within the project.
|
|
172
|
+
* Base URL: PATCH `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/file/move`
|
|
173
|
+
*
|
|
174
|
+
* @example
|
|
175
|
+
* import { fileAdapter } from 'epicenter-libs';
|
|
176
|
+
* await fileAdapter.move('models/old-name.py', 'models/new-name.py');
|
|
177
|
+
* // Move and include the origin directory itself
|
|
178
|
+
* await fileAdapter.move('old-dir', 'new-dir', { includeOrigin: true });
|
|
179
|
+
*
|
|
180
|
+
* @param origin Origin path of the file or directory to move
|
|
181
|
+
* @param destination Destination path to move the file or directory to
|
|
182
|
+
* @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.
|
|
183
|
+
* @param [optionals.includeOrigin] Whether to include the origin directory itself in the move
|
|
184
|
+
* @returns promise that resolves when the move is complete
|
|
185
|
+
*/
|
|
186
|
+
export declare function move(origin: string, destination: string, optionals?: {
|
|
187
|
+
includeOrigin?: boolean;
|
|
188
|
+
} & RoutingOptions): Promise<void>;
|
|
189
|
+
/**
|
|
190
|
+
* Creates a new directory at the specified path.
|
|
191
|
+
* Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/file/directory/{filePath}`
|
|
192
|
+
*
|
|
193
|
+
* @example
|
|
194
|
+
* import { fileAdapter } from 'epicenter-libs';
|
|
195
|
+
* const dir = await fileAdapter.createDirectory('models/new-folder');
|
|
196
|
+
*
|
|
197
|
+
* @param filePath Path at which to create the new directory
|
|
198
|
+
* @param [optionals] Optional arguments; pass network call options overrides here.
|
|
199
|
+
* @returns promise that resolves to the created directory entry
|
|
200
|
+
*/
|
|
201
|
+
export declare function createDirectory(filePath: string, optionals?: RoutingOptions): Promise<DirectoryEntry>;
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import type { RoutingOptions } from '../utils/router';
|
|
2
|
+
export type GitAlgorithm = 'rsa' | 'ed25519';
|
|
3
|
+
export type GitKeySpec = 'openssh' | 'pkcs8' | 'x509';
|
|
4
|
+
export interface GitStatusReadOutView {
|
|
5
|
+
currentBranch?: string | null;
|
|
6
|
+
}
|
|
7
|
+
export interface GitIntegrationReadOutView {
|
|
8
|
+
privateKeySpec?: GitKeySpec | null;
|
|
9
|
+
publicKey?: string | null;
|
|
10
|
+
uri?: string | null;
|
|
11
|
+
publicKeySpec?: GitKeySpec | null;
|
|
12
|
+
algorithm?: GitAlgorithm | null;
|
|
13
|
+
}
|
|
14
|
+
export interface GitIntegrationCreateInView {
|
|
15
|
+
privateKey: string;
|
|
16
|
+
privateKeySpec: GitKeySpec;
|
|
17
|
+
publicKey: string;
|
|
18
|
+
uri: string;
|
|
19
|
+
publicKeySpec: GitKeySpec;
|
|
20
|
+
algorithm: GitAlgorithm;
|
|
21
|
+
}
|
|
22
|
+
export interface GitIntegrationUpdateInView {
|
|
23
|
+
privateKey?: string | null;
|
|
24
|
+
privateKeySpec: GitKeySpec;
|
|
25
|
+
publicKey?: string | null;
|
|
26
|
+
uri?: string | null;
|
|
27
|
+
publicKeySpec: GitKeySpec;
|
|
28
|
+
algorithm: GitAlgorithm;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Retrieves the git integration configuration for the project.
|
|
32
|
+
* Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/git`
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* import { gitAdapter } from 'epicenter-libs';
|
|
36
|
+
* const integration = await gitAdapter.get();
|
|
37
|
+
*
|
|
38
|
+
* @param [optionals] Optional arguments; pass network call options overrides here.
|
|
39
|
+
* @returns promise that resolves to the git integration configuration
|
|
40
|
+
*/
|
|
41
|
+
export declare function get(optionals?: RoutingOptions): Promise<GitIntegrationReadOutView>;
|
|
42
|
+
/**
|
|
43
|
+
* Retrieves the current git status for the project.
|
|
44
|
+
* Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/git/status`
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* import { gitAdapter } from 'epicenter-libs';
|
|
48
|
+
* const status = await gitAdapter.getStatus();
|
|
49
|
+
* console.log(status.currentBranch);
|
|
50
|
+
*
|
|
51
|
+
* @param [optionals] Optional arguments; pass network call options overrides here.
|
|
52
|
+
* @returns promise that resolves to the git status, including the current branch
|
|
53
|
+
*/
|
|
54
|
+
export declare function getStatus(optionals?: RoutingOptions): Promise<GitStatusReadOutView>;
|
|
55
|
+
/**
|
|
56
|
+
* Checks out a branch in the project's git repository.
|
|
57
|
+
* Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/git/checkout/{branch}`
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* import { gitAdapter } from 'epicenter-libs';
|
|
61
|
+
* await gitAdapter.checkout('main');
|
|
62
|
+
*
|
|
63
|
+
* @param branch Name of the branch to check out
|
|
64
|
+
* @param [optionals] Optional arguments; pass network call options overrides here.
|
|
65
|
+
* @returns promise that resolves when the checkout is complete
|
|
66
|
+
*/
|
|
67
|
+
export declare function checkout(branch: string, optionals?: RoutingOptions): Promise<void>;
|
|
68
|
+
/**
|
|
69
|
+
* Resets the project's git repository, optionally to a specific branch.
|
|
70
|
+
* Base URL: DELETE `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/git/reset[/{branch}]`
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* import { gitAdapter } from 'epicenter-libs';
|
|
74
|
+
* await gitAdapter.reset(); // reset current branch
|
|
75
|
+
* await gitAdapter.reset({ branch: 'main' }); // reset to 'main'
|
|
76
|
+
*
|
|
77
|
+
* @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.
|
|
78
|
+
* @param [optionals.branch] Branch to reset to; if omitted, resets the current branch
|
|
79
|
+
* @returns promise that resolves when the reset is complete
|
|
80
|
+
*/
|
|
81
|
+
export declare function reset(optionals?: {
|
|
82
|
+
branch?: string;
|
|
83
|
+
} & RoutingOptions): Promise<void>;
|
|
84
|
+
/**
|
|
85
|
+
* Creates a git integration for the project.
|
|
86
|
+
* Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/git/integration`
|
|
87
|
+
*
|
|
88
|
+
* @example
|
|
89
|
+
* import { gitAdapter } from 'epicenter-libs';
|
|
90
|
+
* const integration = await gitAdapter.createIntegration({
|
|
91
|
+
* uri: 'git@github.com:myorg/myrepo.git',
|
|
92
|
+
* publicKey: '...',
|
|
93
|
+
* privateKey: '...',
|
|
94
|
+
* publicKeySpec: 'openssh',
|
|
95
|
+
* privateKeySpec: 'pkcs8',
|
|
96
|
+
* algorithm: 'ed25519',
|
|
97
|
+
* });
|
|
98
|
+
*
|
|
99
|
+
* @param integration Git integration configuration to create
|
|
100
|
+
* @param [optionals] Optional arguments; pass network call options overrides here.
|
|
101
|
+
* @returns promise that resolves to the created git integration
|
|
102
|
+
*/
|
|
103
|
+
export declare function createIntegration(integration: GitIntegrationCreateInView, optionals?: RoutingOptions): Promise<GitIntegrationReadOutView>;
|
|
104
|
+
/**
|
|
105
|
+
* Updates the git integration for the project.
|
|
106
|
+
* Base URL: PATCH `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/git/integration`
|
|
107
|
+
*
|
|
108
|
+
* @example
|
|
109
|
+
* import { gitAdapter } from 'epicenter-libs';
|
|
110
|
+
* const integration = await gitAdapter.updateIntegration({
|
|
111
|
+
* uri: 'git@github.com:myorg/newrepo.git',
|
|
112
|
+
* publicKeySpec: 'openssh',
|
|
113
|
+
* privateKeySpec: 'pkcs8',
|
|
114
|
+
* algorithm: 'ed25519',
|
|
115
|
+
* });
|
|
116
|
+
*
|
|
117
|
+
* @param integration Fields to update on the git integration
|
|
118
|
+
* @param [optionals] Optional arguments; pass network call options overrides here.
|
|
119
|
+
* @returns promise that resolves to the updated git integration
|
|
120
|
+
*/
|
|
121
|
+
export declare function updateIntegration(integration: GitIntegrationUpdateInView, optionals?: RoutingOptions): Promise<GitIntegrationReadOutView>;
|
|
122
|
+
/**
|
|
123
|
+
* Removes the git integration for the project.
|
|
124
|
+
* Base URL: DELETE `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/git/integration`
|
|
125
|
+
*
|
|
126
|
+
* @example
|
|
127
|
+
* import { gitAdapter } from 'epicenter-libs';
|
|
128
|
+
* await gitAdapter.removeIntegration();
|
|
129
|
+
*
|
|
130
|
+
* @param [optionals] Optional arguments; pass network call options overrides here.
|
|
131
|
+
* @returns promise that resolves when the integration is removed
|
|
132
|
+
*/
|
|
133
|
+
export declare function removeIntegration(optionals?: RoutingOptions): Promise<void>;
|
|
134
|
+
/**
|
|
135
|
+
* Pushes local commits to the remote git repository.
|
|
136
|
+
* Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/git/push`
|
|
137
|
+
*
|
|
138
|
+
* @example
|
|
139
|
+
* import { gitAdapter } from 'epicenter-libs';
|
|
140
|
+
* await gitAdapter.push({ message: 'Update simulation data' });
|
|
141
|
+
*
|
|
142
|
+
* @param optionals Arguments object; also accepts network call option overrides.
|
|
143
|
+
* @param optionals.message Commit message (required)
|
|
144
|
+
* @param [optionals.password] Password for authentication
|
|
145
|
+
* @param [optionals.force] Force-push, bypassing non-fast-forward checks
|
|
146
|
+
* @returns promise that resolves when the push is complete
|
|
147
|
+
*/
|
|
148
|
+
export declare function push(optionals: {
|
|
149
|
+
message: string;
|
|
150
|
+
password?: string | null;
|
|
151
|
+
force?: boolean | null;
|
|
152
|
+
} & RoutingOptions): Promise<void>;
|
|
153
|
+
/**
|
|
154
|
+
* Pulls changes from the remote git repository into the project.
|
|
155
|
+
* Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/git/pull`
|
|
156
|
+
*
|
|
157
|
+
* @example
|
|
158
|
+
* import { gitAdapter } from 'epicenter-libs';
|
|
159
|
+
* await gitAdapter.pull({ force: true, confirm: true });
|
|
160
|
+
*
|
|
161
|
+
* @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.
|
|
162
|
+
* @param [optionals.password] Password for authentication
|
|
163
|
+
* @param [optionals.force] Force the pull, overwriting local changes
|
|
164
|
+
* @param [optionals.confirm] Set the `X-Forio-Confirmation` header to confirm an overwrite
|
|
165
|
+
* @returns promise that resolves when the pull is complete
|
|
166
|
+
*/
|
|
167
|
+
export declare function pull(optionals?: {
|
|
168
|
+
password?: string | null;
|
|
169
|
+
force?: boolean | null;
|
|
170
|
+
confirm?: boolean | null;
|
|
171
|
+
} & RoutingOptions): Promise<void>;
|
|
@@ -23,6 +23,13 @@ import * as somebodyAdapter from './somebody';
|
|
|
23
23
|
import * as matchmakerAdapter from './matchmaker';
|
|
24
24
|
import * as dailyAdapter from './daily';
|
|
25
25
|
import * as walletAdapter from './wallet';
|
|
26
|
+
import * as pipelineAdapter from './pipeline';
|
|
27
|
+
import * as encyclopediaAdapter from './encyclopedia';
|
|
28
|
+
import * as fileAdapter from './file';
|
|
29
|
+
import * as registrationAdapter from './registration';
|
|
30
|
+
import * as docketAdapter from './docket';
|
|
26
31
|
import { default as cometdAdapter } from './cometd';
|
|
27
32
|
import { default as Channel } from './channel';
|
|
28
|
-
|
|
33
|
+
import * as gitAdapter from './git';
|
|
34
|
+
import * as powerpointAdapter from './powerpoint';
|
|
35
|
+
export { accountAdapter, adminAdapter, authAdapter, assetAdapter, chatAdapter, cometdAdapter, emailAdapter, episodeAdapter, groupAdapter, leaderboardAdapter, presenceAdapter, projectAdapter, recaptchaAdapter, runAdapter, timeAdapter, userAdapter, vaultAdapter, videoAdapter, vonageAdapter, worldAdapter, taskAdapter, consensusAdapter, somebodyAdapter, matchmakerAdapter, dailyAdapter, walletAdapter, pipelineAdapter, encyclopediaAdapter, fileAdapter, registrationAdapter, docketAdapter, Channel, gitAdapter, powerpointAdapter, };
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import type { Page, RoutingOptions } from '../utils/router';
|
|
2
|
+
export type PipelineExecutionStatus = 'RUNNING' | 'SUCCEEDED' | 'FAILED';
|
|
3
|
+
export interface PipelineAuditReadOutView {
|
|
4
|
+
status?: PipelineExecutionStatus | null;
|
|
5
|
+
started?: string | null;
|
|
6
|
+
finished?: string | null;
|
|
7
|
+
executionKey?: string | null;
|
|
8
|
+
accountShortName?: string | null;
|
|
9
|
+
projectShortName?: string | null;
|
|
10
|
+
configName?: string | null;
|
|
11
|
+
creator?: string | null;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Builds the NPM Docker images used by pipeline NPM operations.
|
|
15
|
+
* Requires `system` (admin) authorization.
|
|
16
|
+
* Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/pipeline/npm/images`
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* import { pipelineAdapter } from 'epicenter-libs';
|
|
20
|
+
* const built = await pipelineAdapter.buildImages();
|
|
21
|
+
*
|
|
22
|
+
* @param [optionals] Optional arguments; pass network call options overrides here.
|
|
23
|
+
* @returns promise that resolves to `true` when the images were built successfully
|
|
24
|
+
*/
|
|
25
|
+
export declare function buildImages(optionals?: RoutingOptions): Promise<boolean>;
|
|
26
|
+
/**
|
|
27
|
+
* Executes a stored pipeline configuration. The operations to run are read server-side from the
|
|
28
|
+
* named config file; only step inputs (such as credentials) are supplied here via `attributes`.
|
|
29
|
+
* The execution runs asynchronously — the returned audit record starts in its `RUNNING` state and
|
|
30
|
+
* is updated by the worker on completion (poll `getExecution` to observe progress).
|
|
31
|
+
* Base URL: POST `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/pipeline/{configName}`
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* import { pipelineAdapter } from 'epicenter-libs';
|
|
35
|
+
* // Pass the git credential the config's git step will consume, keyed by operation type
|
|
36
|
+
* const audit = await pipelineAdapter.execute('deploy', { git: 'my-git-token' });
|
|
37
|
+
*
|
|
38
|
+
* @param configName Name of the stored pipeline config to execute
|
|
39
|
+
* @param [attributes] Step inputs keyed by operation type (e.g. `{ git: '<token>' }`)
|
|
40
|
+
* @param [optionals] Optional arguments; pass network call options overrides here.
|
|
41
|
+
* @returns promise that resolves to the newly created audit record in its initial RUNNING state
|
|
42
|
+
*/
|
|
43
|
+
export declare function execute(configName: string, attributes?: Record<string, unknown>, optionals?: RoutingOptions): Promise<PipelineAuditReadOutView>;
|
|
44
|
+
/**
|
|
45
|
+
* Retrieves a single pipeline audit record by its execution key.
|
|
46
|
+
* Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/pipeline/{executionKey}`
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* import { pipelineAdapter } from 'epicenter-libs';
|
|
50
|
+
* const audit = await pipelineAdapter.getExecution('<executionKey>');
|
|
51
|
+
*
|
|
52
|
+
* @param executionKey Execution key of the audit record to retrieve
|
|
53
|
+
* @param [optionals] Optional arguments; pass network call options overrides here.
|
|
54
|
+
* @returns promise that resolves to the audit record
|
|
55
|
+
*/
|
|
56
|
+
export declare function getExecution(executionKey: string, optionals?: RoutingOptions): Promise<PipelineAuditReadOutView>;
|
|
57
|
+
/**
|
|
58
|
+
* Lists the audit history for a stored pipeline config.
|
|
59
|
+
* Base URL: GET `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/pipeline/with/{configName}`
|
|
60
|
+
*
|
|
61
|
+
* @example
|
|
62
|
+
* import { pipelineAdapter } from 'epicenter-libs';
|
|
63
|
+
* const page = await pipelineAdapter.listAudits('deploy', { first: 0, max: 20 });
|
|
64
|
+
*
|
|
65
|
+
* @param configName Name of the stored pipeline config
|
|
66
|
+
* @param [optionals] Optional arguments; pass network call options overrides here. Special arguments specific to this method are listed below if they exist.
|
|
67
|
+
* @param [optionals.first] Index of the first record to return (for pagination)
|
|
68
|
+
* @param [optionals.max] Maximum number of records to return (for pagination)
|
|
69
|
+
* @returns promise that resolves to a page of audit records
|
|
70
|
+
*/
|
|
71
|
+
export declare function listAudits(configName: string, optionals?: {
|
|
72
|
+
first?: number;
|
|
73
|
+
max?: number;
|
|
74
|
+
} & RoutingOptions): Promise<Page<PipelineAuditReadOutView>>;
|
|
75
|
+
/**
|
|
76
|
+
* Deletes a pipeline audit record by its execution key.
|
|
77
|
+
* Requires `system` (admin) authorization.
|
|
78
|
+
* Base URL: DELETE `https://forio.com/api/v3/{ACCOUNT}/{PROJECT}/pipeline/{executionKey}`
|
|
79
|
+
*
|
|
80
|
+
* @example
|
|
81
|
+
* import { pipelineAdapter } from 'epicenter-libs';
|
|
82
|
+
* await pipelineAdapter.deleteAudit('<executionKey>');
|
|
83
|
+
*
|
|
84
|
+
* @param executionKey Execution key of the audit record to delete
|
|
85
|
+
* @param [optionals] Optional arguments; pass network call options overrides here.
|
|
86
|
+
* @returns promise that resolves to `true` when the audit record was deleted
|
|
87
|
+
*/
|
|
88
|
+
export declare function deleteAudit(executionKey: string, optionals?: RoutingOptions): Promise<boolean>;
|