Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@qawolf/ci-sdk

Package Overview
Dependencies
Maintainers
0
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@qawolf/ci-sdk - npm Package Compare versions

Comparing version 0.16.0 to 0.17.0

dist/cjs/lib/api/generate-signed-url-for-team-storage.d.ts

1

dist/cjs/lib/api/index.d.ts
export * from "./ci-greenlight.js";
export * from "./deploy.js";
export * from "./generate-signed-url-for-team-storage.js";
//# sourceMappingURL=index.d.ts.map

@@ -6,2 +6,3 @@ "use strict";

tslib_1.__exportStar(require("./deploy.js"), exports);
tslib_1.__exportStar(require("./generate-signed-url-for-team-storage.js"), exports);
//# sourceMappingURL=index.js.map

@@ -18,2 +18,8 @@ import { type SdkDependencies } from "./dependencies";

experimental_vcsBranchTesting: import("./domain/vcsBranchTesting").VCSBranchTestingSDK;
generateSignedUrlForTempTeamStorage: (config: import("../api").GenerateSignedUrlForTeamStorageConfig) => Promise<{
fileLocation?: string;
playgroundFileLocation?: string;
success: boolean;
uploadUrl?: string;
}>;
pollCiGreenlightStatus: (args_0: import("./domain/poll-ci-greenlight").PollCiGreenlightParams) => Promise<import("./domain/poll-ci-greenlight").PollCiGreenlightStatus>;

@@ -20,0 +26,0 @@ };

@@ -10,2 +10,3 @@ "use strict";

const attempt_deploy_1 = require("./domain/attempt-deploy");
const generate_signed_url_for_team_storage_1 = require("./domain/generate-signed-url-for-team-storage");
const index_1 = require("./domain/legacy_previewTesting/index");

@@ -36,2 +37,3 @@ const poll_ci_greenlight_1 = require("./domain/poll-ci-greenlight");

experimental_vcsBranchTesting: (0, vcsBranchTesting_1.makeVCSBranchTestingSDK)(apiConfig, deps),
generateSignedUrlForTempTeamStorage: generate_signed_url_for_team_storage_1.generateSignedUrlForTempTeamStorage.bind(null, deps, apiConfig),
pollCiGreenlightStatus: poll_ci_greenlight_1.pollCiGreenlightStatus.bind(null, deps, apiConfig),

@@ -38,0 +40,0 @@ };

@@ -19,2 +19,8 @@ import { type CiGreenlightStatusBase } from "../lib/api/ci-greenlight";

experimental_vcsBranchTesting: import("../lib/sdk/index").VCSBranchTestingSDK;
generateSignedUrlForTempTeamStorage: (config: import("../lib/api").GenerateSignedUrlForTeamStorageConfig) => Promise<{
fileLocation?: string;
playgroundFileLocation?: string;
success: boolean;
uploadUrl?: string;
}>;
pollCiGreenlightStatus: (args_0: import("../lib/sdk/index").PollCiGreenlightParams) => Promise<import("../lib/sdk/index").PollCiGreenlightStatus>;

@@ -21,0 +27,0 @@ };

export * from "./ci-greenlight.js";
export * from "./deploy.js";
export * from "./generate-signed-url-for-team-storage.js";
//# sourceMappingURL=index.d.ts.map
export * from "./ci-greenlight.js";
export * from "./deploy.js";
export * from "./generate-signed-url-for-team-storage.js";
//# sourceMappingURL=index.js.map

@@ -18,2 +18,8 @@ import { type SdkDependencies } from "./dependencies";

experimental_vcsBranchTesting: import("./domain/vcsBranchTesting").VCSBranchTestingSDK;
generateSignedUrlForTempTeamStorage: (config: import("../api").GenerateSignedUrlForTeamStorageConfig) => Promise<{
fileLocation?: string;
playgroundFileLocation?: string;
success: boolean;
uploadUrl?: string;
}>;
pollCiGreenlightStatus: (args_0: import("./domain/poll-ci-greenlight").PollCiGreenlightParams) => Promise<import("./domain/poll-ci-greenlight").PollCiGreenlightStatus>;

@@ -20,0 +26,0 @@ };

@@ -6,2 +6,3 @@ import { buildFetchWithTimeout } from "../utils";

import { attemptNotifyDeploy } from "./domain/attempt-deploy";
import { generateSignedUrlForTempTeamStorage } from "./domain/generate-signed-url-for-team-storage";
import { removeEnvironment, testPreview, } from "./domain/legacy_previewTesting/index";

@@ -32,2 +33,3 @@ import { pollCiGreenlightStatus } from "./domain/poll-ci-greenlight";

experimental_vcsBranchTesting: makeVCSBranchTestingSDK(apiConfig, deps),
generateSignedUrlForTempTeamStorage: generateSignedUrlForTempTeamStorage.bind(null, deps, apiConfig),
pollCiGreenlightStatus: pollCiGreenlightStatus.bind(null, deps, apiConfig),

@@ -34,0 +36,0 @@ };

@@ -19,2 +19,8 @@ import { type CiGreenlightStatusBase } from "../lib/api/ci-greenlight";

experimental_vcsBranchTesting: import("../lib/sdk/index").VCSBranchTestingSDK;
generateSignedUrlForTempTeamStorage: (config: import("../lib/api").GenerateSignedUrlForTeamStorageConfig) => Promise<{
fileLocation?: string;
playgroundFileLocation?: string;
success: boolean;
uploadUrl?: string;
}>;
pollCiGreenlightStatus: (args_0: import("../lib/sdk/index").PollCiGreenlightParams) => Promise<import("../lib/sdk/index").PollCiGreenlightStatus>;

@@ -21,0 +27,0 @@ };

export * from "./ci-greenlight.js";
export * from "./deploy.js";
export * from "./generate-signed-url-for-team-storage.js";
//# sourceMappingURL=index.d.ts.map

@@ -18,2 +18,8 @@ import { type SdkDependencies } from "./dependencies";

experimental_vcsBranchTesting: import("./domain/vcsBranchTesting").VCSBranchTestingSDK;
generateSignedUrlForTempTeamStorage: (config: import("../api").GenerateSignedUrlForTeamStorageConfig) => Promise<{
fileLocation?: string;
playgroundFileLocation?: string;
success: boolean;
uploadUrl?: string;
}>;
pollCiGreenlightStatus: (args_0: import("./domain/poll-ci-greenlight").PollCiGreenlightParams) => Promise<import("./domain/poll-ci-greenlight").PollCiGreenlightStatus>;

@@ -20,0 +26,0 @@ };

@@ -19,2 +19,8 @@ import { type CiGreenlightStatusBase } from "../lib/api/ci-greenlight";

experimental_vcsBranchTesting: import("../lib/sdk/index").VCSBranchTestingSDK;
generateSignedUrlForTempTeamStorage: (config: import("../lib/api").GenerateSignedUrlForTeamStorageConfig) => Promise<{
fileLocation?: string;
playgroundFileLocation?: string;
success: boolean;
uploadUrl?: string;
}>;
pollCiGreenlightStatus: (args_0: import("../lib/sdk/index").PollCiGreenlightParams) => Promise<import("../lib/sdk/index").PollCiGreenlightStatus>;

@@ -21,0 +27,0 @@ };

2

package.json
{
"name": "@qawolf/ci-sdk",
"version": "0.16.0",
"version": "0.17.0",
"description": "A simple SDK for interacting with QAWolf in CI scripts.",

@@ -5,0 +5,0 @@ "type": "commonjs",

@@ -88,2 +88,76 @@ # QAWolf CI SDK

## Example: Upload Run Input Artifacts
```ts
import { type DeployConfig, makeQaWolfSdk } from "@qawolf/ci-sdk";
import fs from "fs/promises";
import path from "path";
const { generateSignedUrlForTempTeamStorage, attemptNotifyDeploy } =
makeQaWolfSdk({
apiKey: "qawolf_xxxxx",
});
(async () => {
const playgroundFileLocation = await uploadRunArtifact("");
if (playgroundFileLocation) {
const deployConfig: DeployConfig = {
branch: undefined,
commitUrl: undefined,
deduplicationKey: undefined,
deploymentType: undefined,
deploymentUrl: undefined,
hostingService: undefined,
sha: undefined,
variables: {
RUN_INPUT_PATH: playgroundFileLocation,
},
};
const result = await attemptNotifyDeploy(deployConfig);
if (result.outcome !== "success") {
// Fail the job.
process.exit(1);
}
const runId = result.runId;
}
})();
async function uploadRunArtifact(filePath: string): Promise<string> {
const fileName = path.basename(filePath);
const signedUrlResponse = await generateSignedUrlForTempTeamStorage({
destinationFilePath: fileName,
});
if (
signedUrlResponse?.success &&
signedUrlResponse.playgroundFileLocation &&
signedUrlResponse.uploadUrl
) {
const fileBuffer = await fs.readFile(filePath);
const url = signedUrlResponse.uploadUrl;
try {
const response = await fetch(url, {
method: "PUT",
body: fileBuffer,
headers: {
"Content-Type": "application/octet-stream",
},
});
if (!response.ok) {
return "";
}
} catch (error) {
return "";
}
return signedUrlResponse.playgroundFileLocation;
}
return "";
}
```
<a name="vcs-branch-testing"></a>

@@ -306,2 +380,6 @@

## v0.17.0
- Add generateSignedUrlForTempTeamStorage function to be used in customer's CI pipeline.
## v0.16.0

@@ -308,0 +386,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc