New:Microsoft Teams Notifications Are Now Available in Socket.Learn more
Get Started

@postman-cs/automation-core

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@postman-cs/automation-core

Shared runtime core for postman-actions: HTTP transport foundations, structured logging, context detection, and telemetry.

latest
Source
npmnpm
Version
1.8.1
Version published
Weekly downloads
171
-9.52%
Maintainers
1
Weekly downloads
 
Created
Source

@postman-cs/automation-core

Shared runtime foundations for the Postman Enterprise Automation Suite. The package owns the suite's HTTP error taxonomy, retry policy, access-token gateway client, structured logging, CI/repo context detection, secrets-resolver helpers, and fire-and-forget telemetry. Each action depends on this package and esbuild inlines it into the action's self-contained dist/.

Export surfaces

ModuleSurface
@postman-cs/automation-coreHTTP errors, retry helpers/predicates, gateway client, logging, context, secrets resolver, telemetry
@postman-cs/automation-core/cassettedev/test-only fail-closed record/replay transport with query/body matching and response-header replay

What it sends

A single completion event per action run, after team_id resolves. Payload is account/CI-level only — no secrets, no spec content, no repo or org names in clear, no personal data:

FieldSinceNotes
schema_versionv1wire contract version (currently 3)
action, action_version, outcome, tsv1which action ran and how it finished
team_idv1Postman team id, sent clear (legitimate-interest basis)
ci_providerv1detected CI system (11 named + other/unknown)
runner_kindv1hosted / self-hosted / unknown (where contractually known)
run_idv1CI run identifier
repo_idv1sha256(repo slug or url) — hashed, never clear
git_providerv2github / gitlab / bitbucket / azure-devops / unknown
org_idv2sha256(owner) — hashed VCS org/group/workspace
account_typev2service / user / unknown (from session consumerType)
event_triggerv3push / pull_request / schedule / manual / other / unknown (what kicked off the run)
runner_osv3linux / macos / windows / unknown
ref_kindv3default-branch / branch / tag / unknown — coarsened; the raw branch/tag name is never sent

The collector (postman-automation-events-worker, events.pm-cse.dev) accepts schema versions 1, 2, and 3, so already-released actions keep ingesting; fields a sender's schema version predates are defaulted to unknown (hashes to empty).

Usage

import { createTelemetryContext } from '@postman-cs/automation-core';

const telemetry = createTelemetryContext({ action: 'postman-bootstrap-action' });
telemetry.setTeamId(teamId);
telemetry.setAccountType(sessionIdentity?.consumerType); // service/user/unknown
telemetry.emitCompletion('success');

action_version resolves from the consuming action's esbuild --define:__ACTION_VERSION__ automatically (override via the actionVersion option). Opt out with POSTMAN_ACTIONS_TELEMETRY=off or DO_NOT_TRACK=1. Corporate proxies are honored via HTTPS_PROXY/HTTP_PROXY/NO_PROXY.

HTTP foundations

import {
  AccessTokenGatewayClient,
  HttpError,
  isRetryableGatewayFailure,
  retry
} from '@postman-cs/automation-core';

Safe reads use the shared superset predicate: statusless transport failures, HTTP 408, 429, every 5xx, and the gateway timeout/downstream markers ESOCKETTIMEDOUT, ETIMEDOUT, ECONNRESET, serverError, and downstream. Mutations remain single-shot unless a caller explicitly selects safe or rate-limit retry mode. Retry budgets, full-jitter rounding/base/cap, event hooks, request deadlines, auth refresh, inner-error mapping, and cold fallback are configurable on AccessTokenGatewayClient.

Cassette transport

import {
  createEmptyCassette,
  createRecordingFetch,
  createReplayFetch
} from '@postman-cs/automation-core/cassette';

Cassette v2 keys proxy and direct routes by method/path, canonical query, and a SHA-256 request-body digest without storing request bodies. Recording preserves response headers and redacts mint tokens. Replay fails on unknown keys and on exhausted response queues; a fixture must mark its final interaction repeatLast: true to repeat polling responses.

Develop

npm test        # vitest
npm run typecheck
npm run lint
npm run build    # tsc -> dist (JS + .d.ts)
npm run verify:package

Keywords

postman

FAQs

Package last updated on 26 Aug 2026

Related posts