jfrog-workers 0.4.0 → 0.6.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/dist/index.d.ts CHANGED
@@ -61,17 +61,15 @@ export interface PlatformClients {
61
61
  platformHttp: PlatformHttpClient;
62
62
  axios: Pick<AxiosInstance, 'get' | 'put' | 'post' | 'delete' | 'head' | 'patch' | 'request'>;
63
63
  }
64
+ export interface PlatformSecrets {
65
+ /**
66
+ * Retrieves a secret by its key
67
+ * @param {string} secretKey - The secret key
68
+ */
69
+ get(secretKey: string): string;
70
+ }
64
71
  export interface PlatformContext {
65
72
  platformToken: string;
66
73
  clients: PlatformClients;
67
- secrets: Record<string, string>;
74
+ secrets: PlatformSecrets;
68
75
  }
69
- export * from './event/commons';
70
- export * from './event/AFTER_CREATE';
71
- export * from './event/AFTER_BUILD_INFO_SAVE';
72
- export * from './event/AFTER_DOWNLOAD';
73
- export * from './event/AFTER_MOVE';
74
- export * from './event/AFTER_DOWNLOAD';
75
- export * from './event/BEFORE_DOWNLOAD';
76
- export * from './event/BEFORE_UPLOAD';
77
- export * from './event/AFTER_CREATE';
package/dist/index.js CHANGED
@@ -1,25 +1,2 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
2
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./event/commons"), exports);
18
- __exportStar(require("./event/AFTER_CREATE"), exports);
19
- __exportStar(require("./event/AFTER_BUILD_INFO_SAVE"), exports);
20
- __exportStar(require("./event/AFTER_DOWNLOAD"), exports);
21
- __exportStar(require("./event/AFTER_MOVE"), exports);
22
- __exportStar(require("./event/AFTER_DOWNLOAD"), exports);
23
- __exportStar(require("./event/BEFORE_DOWNLOAD"), exports);
24
- __exportStar(require("./event/BEFORE_UPLOAD"), exports);
25
- __exportStar(require("./event/AFTER_CREATE"), exports);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "jfrog-workers",
3
- "version": "0.4.0",
4
- "description": "JFrog workers interfaces and stubs",
3
+ "version": "0.6.0",
4
+ "description": "JFrog workers interfaces",
5
5
  "homepage": "https://github.com/jfrog/workers-sample",
6
6
  "contributors": [
7
7
  {
@@ -18,7 +18,8 @@
18
18
  "author": "JFrog",
19
19
  "license": "Apache-2.0",
20
20
  "scripts": {
21
- "build": "tsc"
21
+ "clean": "rm -rf dist",
22
+ "build": "npm run clean && tsc"
22
23
  },
23
24
  "exports": {
24
25
  ".": {
@@ -1,55 +0,0 @@
1
- import { Status } from './commons';
2
- export interface AfterBuildInfoSaveRequest {
3
- /** Various immutable build run details */
4
- build: DetailedBuildRun | undefined;
5
- }
6
- export interface DetailedBuildRun {
7
- name: string;
8
- number: string;
9
- started: string;
10
- buildAgent: string;
11
- agent: string;
12
- durationMillis: number;
13
- principal: string;
14
- artifactoryPrincipal: string;
15
- url: string;
16
- parentName: string;
17
- parentNumber: string;
18
- buildRepo: string;
19
- modules: Module[];
20
- releaseStatus: string;
21
- promotionStatuses: PromotionStatus[];
22
- }
23
- export interface Module {
24
- id: string;
25
- artifacts: Artifact[];
26
- dependencies: Dependency[];
27
- }
28
- export interface Artifact {
29
- name: string;
30
- type: string;
31
- sha1: string;
32
- sha256: string;
33
- md5: string;
34
- remotePath: string;
35
- properties: string;
36
- }
37
- export interface Dependency {
38
- id: string;
39
- scopes: string;
40
- requestedBy: string;
41
- }
42
- export interface PromotionStatus {
43
- status: string;
44
- comment: string;
45
- repository: string;
46
- timestamp: string;
47
- user: string;
48
- ciUser: string;
49
- }
50
- export interface AfterBuildInfoSaveResponse {
51
- /** Message to print to the log, in case of an error it will be printed as a warning */
52
- message: string;
53
- /** Indicates whether worker execution succeeded or failed */
54
- executionStatus: Status;
55
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,17 +0,0 @@
1
- import { Header, UploadMetadata, Status, UserContext } from './commons';
2
- export interface AfterCreateRequest {
3
- /** Various immutable upload metadata */
4
- metadata: UploadMetadata | undefined;
5
- /** The immutable request headers */
6
- headers: {
7
- [key: string]: Header;
8
- };
9
- /** The user context which sends the request */
10
- userContext: UserContext | undefined;
11
- }
12
- export interface AfterCreateResponse {
13
- /** Message to print to the log, in case of an error it will be printed as a warning */
14
- message: string;
15
- /** Indicates whether worker execution succeeded or failed */
16
- executionStatus?: Status;
17
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,17 +0,0 @@
1
- import { Header, DownloadMetadata, Status, UserContext } from './commons';
2
- export interface AfterDownloadRequest {
3
- /** Various immutable download metadata */
4
- metadata: DownloadMetadata | undefined;
5
- /** The immutable request headers */
6
- headers: {
7
- [key: string]: Header;
8
- };
9
- /** The user context which sends the request */
10
- userContext: UserContext | undefined;
11
- }
12
- export interface AfterDownloadResponse {
13
- /** Message to print to the log, in case of an error it will be printed as a warning */
14
- message: string;
15
- /** Indicates whether worker execution succeeded or failed */
16
- executionStatus?: Status;
17
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,19 +0,0 @@
1
- import { ArtifactProperties, UploadMetadata, RepoPath, Status, UserContext } from './commons';
2
- export interface AfterMoveRequest {
3
- /** Various immutable upload metadata */
4
- metadata: UploadMetadata | undefined;
5
- /** The immutable target repository path */
6
- targetRepoPath: RepoPath | undefined;
7
- /** The user context which sends the request */
8
- userContext: UserContext | undefined;
9
- /** The moved artifacts properties */
10
- artifactProperties: {
11
- [key: string]: ArtifactProperties;
12
- };
13
- }
14
- export interface AfterMoveResponse {
15
- /** Message to print to the log, in case of an error it will be printed as a warning */
16
- message: string;
17
- /** Indicates whether worker execution succeeded or failed */
18
- executionStatus?: Status;
19
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,28 +0,0 @@
1
- import { Header, DownloadMetadata, RepoPath, Status, UserContext } from './commons';
2
- export interface BeforeDownloadRequest {
3
- /** Various immutable download metadata */
4
- metadata: DownloadMetadata | undefined;
5
- /** The immutable request headers */
6
- headers: {
7
- [key: string]: Header;
8
- };
9
- /** The user context which sends the request */
10
- userContext: UserContext | undefined;
11
- /** The response repoPath */
12
- repoPath: RepoPath | undefined;
13
- }
14
- export interface BeforeDownloadResponse {
15
- /** The instruction of how to proceed */
16
- status: DownloadStatus;
17
- /** Message to print to the log, in case of an error it will be printed as a warning */
18
- message: string;
19
- /** Indicates whether worker execution succeeded or failed */
20
- executionStatus?: Status;
21
- }
22
- export declare enum DownloadStatus {
23
- DOWNLOAD_UNSPECIFIED = 0,
24
- DOWNLOAD_PROCEED = 1,
25
- DOWNLOAD_STOP = 2,
26
- DOWNLOAD_WARN = 3,
27
- UNRECOGNIZED = -1
28
- }
@@ -1,11 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DownloadStatus = void 0;
4
- var DownloadStatus;
5
- (function (DownloadStatus) {
6
- DownloadStatus[DownloadStatus["DOWNLOAD_UNSPECIFIED"] = 0] = "DOWNLOAD_UNSPECIFIED";
7
- DownloadStatus[DownloadStatus["DOWNLOAD_PROCEED"] = 1] = "DOWNLOAD_PROCEED";
8
- DownloadStatus[DownloadStatus["DOWNLOAD_STOP"] = 2] = "DOWNLOAD_STOP";
9
- DownloadStatus[DownloadStatus["DOWNLOAD_WARN"] = 3] = "DOWNLOAD_WARN";
10
- DownloadStatus[DownloadStatus["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
11
- })(DownloadStatus || (exports.DownloadStatus = DownloadStatus = {}));
@@ -1,31 +0,0 @@
1
- import { Header, RepoPath, Status, UserContext, ArtifactProperties, UploadMetadata } from './commons';
2
- export interface BeforeUploadRequest {
3
- /** Various immutable upload metadata */
4
- metadata: UploadMetadata | undefined;
5
- /** The immutable request headers */
6
- headers: {
7
- [key: string]: Header;
8
- };
9
- /** The user context which sends the request */
10
- userContext: UserContext | undefined;
11
- /** The properties of the request */
12
- artifactProperties: {
13
- [key: string]: ArtifactProperties;
14
- };
15
- }
16
- export interface BeforeUploadResponse {
17
- /** The instruction of how to proceed */
18
- status: UploadStatus;
19
- /** Message to print to the log, in case of an error it will be printed as a warning */
20
- message: string;
21
- /** The modified repo path from the worker */
22
- modifiedRepoPath: RepoPath | undefined;
23
- /** Indicates whether worker execution succeeded or failed */
24
- executionStatus?: Status;
25
- }
26
- export declare enum UploadStatus {
27
- UPLOAD_UNSPECIFIED = 0,
28
- UPLOAD_PROCEED = 1,
29
- UPLOAD_STOP = 2,
30
- UPLOAD_WARN = 3
31
- }
@@ -1,10 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.UploadStatus = void 0;
4
- var UploadStatus;
5
- (function (UploadStatus) {
6
- UploadStatus[UploadStatus["UPLOAD_UNSPECIFIED"] = 0] = "UPLOAD_UNSPECIFIED";
7
- UploadStatus[UploadStatus["UPLOAD_PROCEED"] = 1] = "UPLOAD_PROCEED";
8
- UploadStatus[UploadStatus["UPLOAD_STOP"] = 2] = "UPLOAD_STOP";
9
- UploadStatus[UploadStatus["UPLOAD_WARN"] = 3] = "UPLOAD_WARN";
10
- })(UploadStatus || (exports.UploadStatus = UploadStatus = {}));
@@ -1,96 +0,0 @@
1
- export interface Header {
2
- value: string[];
3
- }
4
- export interface UserContext {
5
- /** The username or subject */
6
- id: string;
7
- /** Is the context an accessToken */
8
- isToken: boolean;
9
- /** The realm of the user */
10
- realm: string;
11
- }
12
- export interface RepoPath {
13
- /** The repo key */
14
- key: string;
15
- /** The path itself */
16
- path: string;
17
- /** The key:path combination */
18
- id: string;
19
- /** Is the path the root */
20
- isRoot: boolean;
21
- /** Is the path a folder */
22
- isFolder: boolean;
23
- }
24
- export declare enum RepoType {
25
- REPO_TYPE_UNSPECIFIED = 0,
26
- REPO_TYPE_LOCAL = 1,
27
- REPO_TYPE_REMOTE = 2,
28
- REPO_TYPE_FEDERATED = 3,
29
- UNRECOGNIZED = -1
30
- }
31
- export declare enum Status {
32
- STATUS_UNSPECIFIED = 0,
33
- STATUS_SUCCESS = 4,
34
- STATUS_FAIL = 2,
35
- UNRECOGNIZED = -1
36
- }
37
- export interface ArtifactProperties {
38
- /** The property values */
39
- value: string[];
40
- }
41
- export interface DownloadMetadata {
42
- /** The repoPath object of the request */
43
- repoPath: RepoPath | undefined;
44
- /** The original repo path in case a virtual repo is involved */
45
- originalRepoPath: RepoPath | undefined;
46
- /** The file name from path */
47
- name: string;
48
- /** Is it a head request */
49
- headOnly: boolean;
50
- /** Is it a checksum request */
51
- checksum: boolean;
52
- /** Is it a recursive request */
53
- recursive: boolean;
54
- /** When a modification has occurred */
55
- modificationTime: number;
56
- /** Is it a directory request */
57
- directoryRequest: boolean;
58
- /** Is it a metadata request */
59
- metadata: boolean;
60
- /** Last modification time that occurred */
61
- lastModified: number;
62
- /** If a modification happened since the last modification time */
63
- ifModifiedSince: number;
64
- /** The url that points to artifactory */
65
- servletContextUrl: string;
66
- /** The request URI */
67
- uri: string;
68
- /** The client address */
69
- clientAddress: string;
70
- /** The resource path of the requested zip */
71
- zipResourcePath: string;
72
- /** Is the request a zip resource request */
73
- zipResourceRequest: boolean;
74
- /** should replace the head request with get */
75
- replaceHeadRequestWithGet: boolean;
76
- /** Repository type */
77
- repoType: RepoType;
78
- }
79
- export interface UploadMetadata {
80
- /** The repoPath object of the request */
81
- repoPath: RepoPath | undefined;
82
- /** The deploy request content length */
83
- contentLength: number;
84
- /** Last modification time that occurred */
85
- lastModified: number;
86
- /** Is the request trusting the server checksums */
87
- trustServerChecksums: boolean;
88
- /** The url that points to artifactory */
89
- servletContextUrl: string;
90
- /** Is it a request that skips jar indexing */
91
- skipJarIndexing: boolean;
92
- /** Is redirect disabled on this request */
93
- disableRedirect: boolean;
94
- /** Repository type */
95
- repoType: RepoType;
96
- }
@@ -1,18 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Status = exports.RepoType = void 0;
4
- var RepoType;
5
- (function (RepoType) {
6
- RepoType[RepoType["REPO_TYPE_UNSPECIFIED"] = 0] = "REPO_TYPE_UNSPECIFIED";
7
- RepoType[RepoType["REPO_TYPE_LOCAL"] = 1] = "REPO_TYPE_LOCAL";
8
- RepoType[RepoType["REPO_TYPE_REMOTE"] = 2] = "REPO_TYPE_REMOTE";
9
- RepoType[RepoType["REPO_TYPE_FEDERATED"] = 3] = "REPO_TYPE_FEDERATED";
10
- RepoType[RepoType["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
11
- })(RepoType || (exports.RepoType = RepoType = {}));
12
- var Status;
13
- (function (Status) {
14
- Status[Status["STATUS_UNSPECIFIED"] = 0] = "STATUS_UNSPECIFIED";
15
- Status[Status["STATUS_SUCCESS"] = 4] = "STATUS_SUCCESS";
16
- Status[Status["STATUS_FAIL"] = 2] = "STATUS_FAIL";
17
- Status[Status["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
18
- })(Status || (exports.Status = Status = {}));