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.15.5 to 0.15.6

dist/cjs/lib/api/graphql.d.ts

3

dist/cjs/lib/api/ci-greenlight.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.fetchCiGreenlightStatus = void 0;
exports.fetchCiGreenlightStatus = fetchCiGreenlightStatus;
async function fetchCiGreenlightStatus({ serviceBase, apiKey }, { runId, }, { fetch: localFetch }) {

@@ -51,3 +51,2 @@ try {

}
exports.fetchCiGreenlightStatus = fetchCiGreenlightStatus;
//# sourceMappingURL=ci-greenlight.js.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.postDeploySuccess = void 0;
exports.postDeploySuccess = postDeploySuccess;
async function postDeploySuccess({ apiKey, serviceBase }, { branch, commitUrl, deduplicationKey, deploymentType, deploymentUrl, hostingService, sha, variables, }, { fetch: localFetch }) {

@@ -85,3 +85,2 @@ try {

}
exports.postDeploySuccess = postDeploySuccess;
//# sourceMappingURL=deploy.js.map

@@ -1,6 +0,3 @@

export interface LogDriver {
error(message: string, error?: unknown): void;
info(message: string): void;
warn(message: string): void;
}
import { type LogDriver } from "@qawolf/ci-utils";
export { LogDriver };
export type FetchDriver = typeof fetch;

@@ -7,0 +4,0 @@ export type SdkDependencies = {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.attemptNotifyDeploy = void 0;
exports.attemptNotifyDeploy = attemptNotifyDeploy;
const deploy_1 = require("../../api/deploy");

@@ -53,3 +53,2 @@ const utils_1 = require("../../utils");

}
exports.attemptNotifyDeploy = attemptNotifyDeploy;
//# sourceMappingURL=attempt-deploy.js.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.pollCiGreenlightStatus = void 0;
exports.pollCiGreenlightStatus = pollCiGreenlightStatus;
const ci_greenlight_1 = require("../../api/ci-greenlight");

@@ -154,3 +154,2 @@ const utils_1 = require("../../utils");

}
exports.pollCiGreenlightStatus = pollCiGreenlightStatus;
//# sourceMappingURL=poll-ci-greenlight.js.map

@@ -10,7 +10,9 @@ import { type SdkDependencies } from "./dependencies";

}) => Promise<void>;
experimental_testPreview: (config: import("./domain/previewTesting/index.js").TestPreviewParams) => Promise<import("./domain/attempt-deploy").NotifyDeployStatus>;
experimental_testPreview: (config: import("./domain/legacy_previewTesting/index").TestPreviewParams) => Promise<import("./domain/attempt-deploy").NotifyDeployStatus>;
experimental_vcsBranchTesting: import("./domain/vcsBranchTesting").VCSBranchTestingSDK;
pollCiGreenlightStatus: (args_0: import("./domain/poll-ci-greenlight").PollCiGreenlightParams) => Promise<import("./domain/poll-ci-greenlight").PollCiGreenlightStatus>;
};
export type * from "./domain/poll-ci-greenlight.js";
export type * from "./domain/attempt-deploy.js";
export type * from "./domain/poll-ci-greenlight";
export type * from "./domain/attempt-deploy";
export * from "./domain/vcsBranchTesting/index";
//# sourceMappingURL=index.d.ts.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.makeQaWolfSdk = void 0;
exports.makeQaWolfSdk = makeQaWolfSdk;
const tslib_1 = require("tslib");
const fetch_1 = require("./defaults/fetch");
const log_1 = require("./defaults/log");
const serviceBase_1 = require("./defaults/serviceBase");
const attempt_deploy_1 = require("./domain/attempt-deploy");
const index_1 = require("./domain/legacy_previewTesting/index");
const poll_ci_greenlight_1 = require("./domain/poll-ci-greenlight");
const index_js_1 = require("./domain/previewTesting/index.js");
const default_js_1 = require("./log/default.js");
function makeQaWolfSdk({ apiKey, serviceBase = "https://app.qawolf.com/", }, { log = default_js_1.defaultLogDriver, fetch = globalThis.fetch, } = {}) {
const vcsBranchTesting_1 = require("./domain/vcsBranchTesting");
function makeQaWolfSdk({ apiKey, serviceBase = serviceBase_1.defaultServiceBase, }, { log = log_1.defaultLogDriver, fetch = fetch_1.defaultFetch, } = {}) {
if (typeof fetch !== "function") {

@@ -17,8 +21,9 @@ throw new Error(`QA Wolf CI-SDK requires fetch to be defined. Make sure you are using NodeJS 18+, OR pass a fetch polyfill to the makeQaWolfSdk function.

attemptNotifyDeploy: attempt_deploy_1.attemptNotifyDeploy.bind(null, deps, apiConfig),
experimental_removeEnvironment: index_js_1.removeEnvironment.bind(null, deps, apiConfig),
experimental_testPreview: index_js_1.testPreview.bind(null, deps, apiConfig),
experimental_removeEnvironment: index_1.removeEnvironment.bind(null, deps, apiConfig),
experimental_testPreview: index_1.testPreview.bind(null, deps, apiConfig),
experimental_vcsBranchTesting: (0, vcsBranchTesting_1.makeVCSBranchTestingSDK)(apiConfig, deps),
pollCiGreenlightStatus: poll_ci_greenlight_1.pollCiGreenlightStatus.bind(null, deps, apiConfig),
};
}
exports.makeQaWolfSdk = makeQaWolfSdk;
tslib_1.__exportStar(require("./domain/vcsBranchTesting/index"), exports);
//# sourceMappingURL=index.js.map

@@ -1,2 +0,2 @@

export declare function sleep(ms: number): Promise<unknown>;
export declare function sleep(ms: number): Promise<void>;
export declare function pluralize(count: number): "" | "s";

@@ -7,2 +7,3 @@ /**

export declare function assertType<Type>(_value: Type): void;
export declare function getBackoffMs(attemptNumber: number, minWaitMs?: number, maxWaitMs?: number): number;
//# sourceMappingURL=utils.d.ts.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.assertType = exports.pluralize = exports.sleep = void 0;
async function sleep(ms) {
exports.sleep = sleep;
exports.pluralize = pluralize;
exports.assertType = assertType;
exports.getBackoffMs = getBackoffMs;
function sleep(ms) {
return new Promise((resolve) => setTimeout(resolve, ms));
}
exports.sleep = sleep;
function pluralize(count) {
return count === 1 ? "" : "s";
}
exports.pluralize = pluralize;
/**

@@ -18,3 +19,5 @@ * Statically verify that provided value is assignable to a desired type

}
exports.assertType = assertType;
function getBackoffMs(attemptNumber, minWaitMs = 1000, maxWaitMs = 10000) {
return Math.min(maxWaitMs, minWaitMs * 1.2 ** attemptNumber);
}
//# sourceMappingURL=utils.js.map
import { type CiGreenlightStatusBase } from "../lib/api/ci-greenlight";
export declare function makeVCSBranchTestingSDKForTest({ apiKey }: {
apiKey: string;
}): {
fetch: import("jest-mock").Mock<() => Promise<Response>>;
sdk: import("../lib/sdk/index").VCSBranchTestingSDK;
};
export declare function makeQaWolfSdkForTest({ apiKey }: {

@@ -11,3 +17,4 @@ apiKey: string;

}) => Promise<void>;
experimental_testPreview: (config: import("../lib/sdk/domain/previewTesting").TestPreviewParams) => Promise<import("../lib/sdk/index").NotifyDeployStatus>;
experimental_testPreview: (config: import("../lib/sdk/domain/legacy_previewTesting").TestPreviewParams) => Promise<import("../lib/sdk/index").NotifyDeployStatus>;
experimental_vcsBranchTesting: import("../lib/sdk/index").VCSBranchTestingSDK;
pollCiGreenlightStatus: (args_0: import("../lib/sdk/index").PollCiGreenlightParams) => Promise<import("../lib/sdk/index").PollCiGreenlightStatus>;

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

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.buildCiGreenlightStatusBase = exports.buildResponse = exports.makeQaWolfSdkForTest = void 0;
exports.makeVCSBranchTestingSDKForTest = makeVCSBranchTestingSDKForTest;
exports.makeQaWolfSdkForTest = makeQaWolfSdkForTest;
exports.buildResponse = buildResponse;
exports.buildCiGreenlightStatusBase = buildCiGreenlightStatusBase;
const globals_1 = require("@jest/globals");
const vcsBranchTesting_1 = require("../lib/sdk/domain/vcsBranchTesting");
const index_1 = require("../lib/sdk/index");
const localDummyServiceBase = "http://localhost:80/";
const testLogger = {
error: console.log.bind(console),
info: console.log.bind(console),
warn: console.log.bind(console),
};
function makeVCSBranchTestingSDKForTest({ apiKey }) {
// Can be used for mocking fetch
const fetch = globals_1.jest.fn(() => Promise.resolve(buildResponse({})));
return {
fetch,
sdk: (0, vcsBranchTesting_1.makeVCSBranchTestingSDK)({
apiKey,
serviceBase: localDummyServiceBase,
}, {
fetch,
log: testLogger,
}),
};
}
function makeQaWolfSdkForTest({ apiKey }) {

@@ -17,11 +40,6 @@ // Can be used for mocking fetch

fetch,
log: {
error: console.log.bind(console),
info: console.log.bind(console),
warn: console.log.bind(console),
},
log: testLogger,
}),
};
}
exports.makeQaWolfSdkForTest = makeQaWolfSdkForTest;
function buildResponse(response, status = 200) {

@@ -35,3 +53,2 @@ return new Response(JSON.stringify(response), {

}
exports.buildResponse = buildResponse;
function buildCiGreenlightStatusBase() {

@@ -49,3 +66,2 @@ return {

}
exports.buildCiGreenlightStatusBase = buildCiGreenlightStatusBase;
//# sourceMappingURL=test-lib.js.map

@@ -1,6 +0,3 @@

export interface LogDriver {
error(message: string, error?: unknown): void;
info(message: string): void;
warn(message: string): void;
}
import { type LogDriver } from "@qawolf/ci-utils";
export { LogDriver };
export type FetchDriver = typeof fetch;

@@ -7,0 +4,0 @@ export type SdkDependencies = {

@@ -1,3 +0,3 @@

import { postDeploySuccess } from "../../api/deploy.js";
import { assertType } from "../../utils.js";
import { postDeploySuccess } from "../../api/deploy";
import { assertType } from "../../utils";
export async function attemptNotifyDeploy(deps, apiConfig, config) {

@@ -4,0 +4,0 @@ const { log } = deps;

@@ -1,3 +0,3 @@

import { fetchCiGreenlightStatus, } from "../../api/ci-greenlight.js";
import { assertType, pluralize, sleep } from "../../utils.js";
import { fetchCiGreenlightStatus, } from "../../api/ci-greenlight";
import { assertType, pluralize, sleep } from "../../utils";
// If you change these values, make sure you update the JSDoc

@@ -4,0 +4,0 @@ // comments in the PollConfig type.

@@ -10,7 +10,9 @@ import { type SdkDependencies } from "./dependencies";

}) => Promise<void>;
experimental_testPreview: (config: import("./domain/previewTesting/index.js").TestPreviewParams) => Promise<import("./domain/attempt-deploy").NotifyDeployStatus>;
experimental_testPreview: (config: import("./domain/legacy_previewTesting/index").TestPreviewParams) => Promise<import("./domain/attempt-deploy").NotifyDeployStatus>;
experimental_vcsBranchTesting: import("./domain/vcsBranchTesting").VCSBranchTestingSDK;
pollCiGreenlightStatus: (args_0: import("./domain/poll-ci-greenlight").PollCiGreenlightParams) => Promise<import("./domain/poll-ci-greenlight").PollCiGreenlightStatus>;
};
export type * from "./domain/poll-ci-greenlight.js";
export type * from "./domain/attempt-deploy.js";
export type * from "./domain/poll-ci-greenlight";
export type * from "./domain/attempt-deploy";
export * from "./domain/vcsBranchTesting/index";
//# sourceMappingURL=index.d.ts.map

@@ -1,6 +0,9 @@

import { attemptNotifyDeploy } from "./domain/attempt-deploy.js";
import { pollCiGreenlightStatus } from "./domain/poll-ci-greenlight.js";
import { removeEnvironment, testPreview, } from "./domain/previewTesting/index.js";
import { defaultLogDriver } from "./log/default.js";
export function makeQaWolfSdk({ apiKey, serviceBase = "https://app.qawolf.com/", }, { log = defaultLogDriver, fetch = globalThis.fetch, } = {}) {
import { defaultFetch } from "./defaults/fetch";
import { defaultLogDriver } from "./defaults/log";
import { defaultServiceBase } from "./defaults/serviceBase";
import { attemptNotifyDeploy } from "./domain/attempt-deploy";
import { removeEnvironment, testPreview, } from "./domain/legacy_previewTesting/index";
import { pollCiGreenlightStatus } from "./domain/poll-ci-greenlight";
import { makeVCSBranchTestingSDK } from "./domain/vcsBranchTesting";
export function makeQaWolfSdk({ apiKey, serviceBase = defaultServiceBase, }, { log = defaultLogDriver, fetch = defaultFetch, } = {}) {
if (typeof fetch !== "function") {

@@ -16,5 +19,7 @@ throw new Error(`QA Wolf CI-SDK requires fetch to be defined. Make sure you are using NodeJS 18+, OR pass a fetch polyfill to the makeQaWolfSdk function.

experimental_testPreview: testPreview.bind(null, deps, apiConfig),
experimental_vcsBranchTesting: makeVCSBranchTestingSDK(apiConfig, deps),
pollCiGreenlightStatus: pollCiGreenlightStatus.bind(null, deps, apiConfig),
};
}
export * from "./domain/vcsBranchTesting/index";
//# sourceMappingURL=index.js.map

@@ -1,2 +0,2 @@

export declare function sleep(ms: number): Promise<unknown>;
export declare function sleep(ms: number): Promise<void>;
export declare function pluralize(count: number): "" | "s";

@@ -7,2 +7,3 @@ /**

export declare function assertType<Type>(_value: Type): void;
export declare function getBackoffMs(attemptNumber: number, minWaitMs?: number, maxWaitMs?: number): number;
//# sourceMappingURL=utils.d.ts.map

@@ -1,2 +0,2 @@

export async function sleep(ms) {
export function sleep(ms) {
return new Promise((resolve) => setTimeout(resolve, ms));

@@ -13,2 +13,5 @@ }

}
export function getBackoffMs(attemptNumber, minWaitMs = 1000, maxWaitMs = 10000) {
return Math.min(maxWaitMs, minWaitMs * 1.2 ** attemptNumber);
}
//# sourceMappingURL=utils.js.map
import { type CiGreenlightStatusBase } from "../lib/api/ci-greenlight";
export declare function makeVCSBranchTestingSDKForTest({ apiKey }: {
apiKey: string;
}): {
fetch: import("jest-mock").Mock<() => Promise<Response>>;
sdk: import("../lib/sdk/index").VCSBranchTestingSDK;
};
export declare function makeQaWolfSdkForTest({ apiKey }: {

@@ -11,3 +17,4 @@ apiKey: string;

}) => Promise<void>;
experimental_testPreview: (config: import("../lib/sdk/domain/previewTesting").TestPreviewParams) => Promise<import("../lib/sdk/index").NotifyDeployStatus>;
experimental_testPreview: (config: import("../lib/sdk/domain/legacy_previewTesting").TestPreviewParams) => Promise<import("../lib/sdk/index").NotifyDeployStatus>;
experimental_vcsBranchTesting: import("../lib/sdk/index").VCSBranchTestingSDK;
pollCiGreenlightStatus: (args_0: import("../lib/sdk/index").PollCiGreenlightParams) => Promise<import("../lib/sdk/index").PollCiGreenlightStatus>;

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

import { jest } from "@jest/globals";
import { makeQaWolfSdk } from "../lib/sdk/index.js";
import { makeVCSBranchTestingSDK } from "../lib/sdk/domain/vcsBranchTesting";
import { makeQaWolfSdk } from "../lib/sdk/index";
const localDummyServiceBase = "http://localhost:80/";
const testLogger = {
error: console.log.bind(console),
info: console.log.bind(console),
warn: console.log.bind(console),
};
export function makeVCSBranchTestingSDKForTest({ apiKey }) {
// Can be used for mocking fetch
const fetch = jest.fn(() => Promise.resolve(buildResponse({})));
return {
fetch,
sdk: makeVCSBranchTestingSDK({
apiKey,
serviceBase: localDummyServiceBase,
}, {
fetch,
log: testLogger,
}),
};
}
export function makeQaWolfSdkForTest({ apiKey }) {

@@ -14,7 +34,3 @@ // Can be used for mocking fetch

fetch,
log: {
error: console.log.bind(console),
info: console.log.bind(console),
warn: console.log.bind(console),
},
log: testLogger,
}),

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

@@ -1,6 +0,3 @@

export interface LogDriver {
error(message: string, error?: unknown): void;
info(message: string): void;
warn(message: string): void;
}
import { type LogDriver } from "@qawolf/ci-utils";
export { LogDriver };
export type FetchDriver = typeof fetch;

@@ -7,0 +4,0 @@ export type SdkDependencies = {

@@ -10,7 +10,9 @@ import { type SdkDependencies } from "./dependencies";

}) => Promise<void>;
experimental_testPreview: (config: import("./domain/previewTesting/index.js").TestPreviewParams) => Promise<import("./domain/attempt-deploy").NotifyDeployStatus>;
experimental_testPreview: (config: import("./domain/legacy_previewTesting/index").TestPreviewParams) => Promise<import("./domain/attempt-deploy").NotifyDeployStatus>;
experimental_vcsBranchTesting: import("./domain/vcsBranchTesting").VCSBranchTestingSDK;
pollCiGreenlightStatus: (args_0: import("./domain/poll-ci-greenlight").PollCiGreenlightParams) => Promise<import("./domain/poll-ci-greenlight").PollCiGreenlightStatus>;
};
export type * from "./domain/poll-ci-greenlight.js";
export type * from "./domain/attempt-deploy.js";
export type * from "./domain/poll-ci-greenlight";
export type * from "./domain/attempt-deploy";
export * from "./domain/vcsBranchTesting/index";
//# sourceMappingURL=index.d.ts.map

@@ -1,2 +0,2 @@

export declare function sleep(ms: number): Promise<unknown>;
export declare function sleep(ms: number): Promise<void>;
export declare function pluralize(count: number): "" | "s";

@@ -7,2 +7,3 @@ /**

export declare function assertType<Type>(_value: Type): void;
export declare function getBackoffMs(attemptNumber: number, minWaitMs?: number, maxWaitMs?: number): number;
//# sourceMappingURL=utils.d.ts.map
import { type CiGreenlightStatusBase } from "../lib/api/ci-greenlight";
export declare function makeVCSBranchTestingSDKForTest({ apiKey }: {
apiKey: string;
}): {
fetch: import("jest-mock").Mock<() => Promise<Response>>;
sdk: import("../lib/sdk/index").VCSBranchTestingSDK;
};
export declare function makeQaWolfSdkForTest({ apiKey }: {

@@ -11,3 +17,4 @@ apiKey: string;

}) => Promise<void>;
experimental_testPreview: (config: import("../lib/sdk/domain/previewTesting").TestPreviewParams) => Promise<import("../lib/sdk/index").NotifyDeployStatus>;
experimental_testPreview: (config: import("../lib/sdk/domain/legacy_previewTesting").TestPreviewParams) => Promise<import("../lib/sdk/index").NotifyDeployStatus>;
experimental_vcsBranchTesting: import("../lib/sdk/index").VCSBranchTestingSDK;
pollCiGreenlightStatus: (args_0: import("../lib/sdk/index").PollCiGreenlightParams) => Promise<import("../lib/sdk/index").PollCiGreenlightStatus>;

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

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

@@ -31,2 +31,3 @@ "type": "commonjs",

"@jest/globals": "^29.7.0",
"@sinonjs/fake-timers": "^10.3.0",
"@tsconfig/strictest": "^2.0.5",

@@ -40,4 +41,6 @@ "jest": "^29.7.0",

"dependencies": {
"@qawolf/ci-utils": "^1.0.0",
"slugify": "^1.6.6",
"tslib": "^2.6.2"
}
}

@@ -9,3 +9,3 @@ # QAWolf CI SDK

This package provides a TypeScript (CSM and ESM compatible) SDK
to interact with the QAWolf Customer-facing API.
to interact with the QA Wolf Customer-facing API.

@@ -151,2 +151,9 @@ It exposes two functions associated with the two central endpoints, showcased in

## v0.15.6
- Add a new dependency, `@qawolf/ci-utils`, and move the `LogDriver` interface to it.
- Add new experimental features to the SDK in `experimental_vcsBranchTesting`. These
features are not available to customers nor documented yet, but will be advertised
in a near future.
## v0.15.5

@@ -153,0 +160,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

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