Skip to content

Commit b91b5fc

Browse files
committed
Rename @stripe/openapi → @stripe/sync-openapi; remove dead exports
1. Package naming convention: every package in the monorepo uses the @stripe/sync-* scope (sync-protocol, sync-engine, sync-source-stripe, etc). Rename to @stripe/sync-openapi for consistency. 2. Remove dead exports from resourceRegistry.ts that were never imported anywhere: StripeObject, CoreSyncObject, SyncObjectName (all just `string` aliases with no narrowing), CORE_SYNC_OBJECTS (redundant re-export of DEFAULT_SYNC_OBJECTS), SYNC_OBJECTS, and RESOURCE_TABLE_NAME_MAP (identity map of table→table). 3. Add missing cleanup line in e2e/connector-loading.test.sh for the openapi tarball — without this the cleanup() trap leaves a stale stripe-sync-openapi-*.tgz in the repo root. Committed-By-Agent: claude
1 parent 2c58fa2 commit b91b5fc

8 files changed

Lines changed: 17 additions & 26 deletions

File tree

e2e/connector-loading.test.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ TMPDIR_BASE=$(mktemp -d)
2424
cleanup() {
2525
rm -rf "$TMPDIR_BASE"
2626
rm -f "$REPO_ROOT"/stripe-sync-protocol-*.tgz
27+
rm -f "$REPO_ROOT"/stripe-sync-openapi-*.tgz
2728
rm -f "$REPO_ROOT"/stripe-sync-engine-*.tgz
2829
rm -f "$REPO_ROOT"/stripe-sync-source-stripe-*.tgz
2930
rm -f "$REPO_ROOT"/stripe-sync-destination-postgres-*.tgz
@@ -44,7 +45,7 @@ echo ""
4445
echo "--- Step 1: Packing packages ---"
4546

4647
PROTOCOL_TGZ=$(cd "$REPO_ROOT" && pnpm --filter @stripe/sync-protocol pack 2>/dev/null | tail -1)
47-
OPENAPI_TGZ=$(cd "$REPO_ROOT" && pnpm --filter @stripe/openapi pack 2>/dev/null | tail -1)
48+
OPENAPI_TGZ=$(cd "$REPO_ROOT" && pnpm --filter @stripe/sync-openapi pack 2>/dev/null | tail -1)
4849
ENGINE_TGZ=$(cd "$REPO_ROOT" && pnpm --filter @stripe/sync-engine pack 2>/dev/null | tail -1)
4950
SOURCE_TGZ=$(cd "$REPO_ROOT" && pnpm --filter @stripe/sync-source-stripe pack 2>/dev/null | tail -1)
5051
DEST_TGZ=$(cd "$REPO_ROOT" && pnpm --filter @stripe/sync-destination-postgres pack 2>/dev/null | tail -1)
@@ -85,7 +86,7 @@ cat > package.json <<EOF
8586
"pnpm": {
8687
"overrides": {
8788
"@stripe/sync-protocol": "$PROTOCOL_TGZ",
88-
"@stripe/openapi": "$OPENAPI_TGZ",
89+
"@stripe/sync-openapi": "$OPENAPI_TGZ",
8990
"@stripe/sync-engine": "$ENGINE_TGZ",
9091
"@stripe/sync-source-stripe": "$SOURCE_TGZ",
9192
"@stripe/sync-destination-postgres": "$DEST_TGZ",

packages/openapi/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "@stripe/openapi",
2+
"name": "@stripe/sync-openapi",
33
"version": "0.1.0",
44
"private": true,
55
"type": "module",

packages/source-stripe/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"src"
2828
],
2929
"dependencies": {
30-
"@stripe/openapi": "workspace:*",
30+
"@stripe/sync-openapi": "workspace:*",
3131
"@stripe/sync-protocol": "workspace:*",
3232
"stripe": "^17.7.0",
3333
"ws": "^8.18.0",

packages/source-stripe/src/catalog.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { CatalogMessage, Stream } from '@stripe/sync-protocol'
22
import type { ResourceConfig } from './types.js'
3-
import type { ParsedResourceTable } from '@stripe/openapi'
4-
import { parsedTableToJsonSchema } from '@stripe/openapi'
3+
import type { ParsedResourceTable } from '@stripe/sync-openapi'
4+
import { parsedTableToJsonSchema } from '@stripe/sync-openapi'
55

66
/** Derive a CatalogMessage from the existing resource registry (no json_schema). */
77
export function catalogFromRegistry(registry: Record<string, ResourceConfig>): CatalogMessage {

packages/source-stripe/src/index.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@ import Stripe from 'stripe'
88
import { z } from 'zod'
99
import { buildResourceRegistry } from './resourceRegistry.js'
1010
import { catalogFromRegistry, catalogFromOpenApi } from './catalog.js'
11-
import { resolveOpenApiSpec, SpecParser, OPENAPI_RESOURCE_TABLE_ALIASES } from '@stripe/openapi'
11+
import {
12+
resolveOpenApiSpec,
13+
SpecParser,
14+
OPENAPI_RESOURCE_TABLE_ALIASES,
15+
} from '@stripe/sync-openapi'
1216
import { processStripeEvent } from './process-event.js'
1317
import { processWebhookInput, createInputQueue, startWebhookServer } from './src-webhook.js'
1418
import { listApiBackfill } from './src-list-api.js'

packages/source-stripe/src/resourceRegistry.ts

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { ResourceConfig } from './types.js'
2-
import type { OpenApiSpec, NestedEndpoint } from '@stripe/openapi'
2+
import type { OpenApiSpec, NestedEndpoint } from '@stripe/sync-openapi'
33
import {
44
discoverListEndpoints,
55
discoverNestedEndpoints,
@@ -8,7 +8,7 @@ import {
88
buildRetrieveFn,
99
resolveTableName,
1010
OPENAPI_RESOURCE_TABLE_ALIASES,
11-
} from '@stripe/openapi'
11+
} from '@stripe/sync-openapi'
1212

1313
/**
1414
* The default set of table names synced when no explicit selection is made.
@@ -35,16 +35,6 @@ export const DEFAULT_SYNC_OBJECTS: readonly string[] = [
3535
'checkout_sessions',
3636
]
3737

38-
export type StripeObject = string
39-
40-
export const CORE_SYNC_OBJECTS = DEFAULT_SYNC_OBJECTS as readonly string[]
41-
42-
export type CoreSyncObject = string
43-
44-
export const SYNC_OBJECTS = ['all', 'customer_with_entitlements', ...DEFAULT_SYNC_OBJECTS] as const
45-
46-
export type SyncObjectName = string
47-
4838
export const REVALIDATE_ENTITIES = [
4939
...DEFAULT_SYNC_OBJECTS,
5040
'radar.early_fraud_warning',
@@ -53,10 +43,6 @@ export const REVALIDATE_ENTITIES = [
5343
] as const
5444
export type RevalidateEntityName = (typeof REVALIDATE_ENTITIES)[number]
5545

56-
export const RESOURCE_TABLE_NAME_MAP: Record<string, string> = Object.fromEntries(
57-
DEFAULT_SYNC_OBJECTS.map((t) => [t, t])
58-
)
59-
6046
/**
6147
* Build a ResourceConfig for every listable resource discovered in the OpenAPI spec.
6248
* All resources get list + retrieve functions derived dynamically from the spec paths.

packages/source-stripe/src/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type Stripe from 'stripe'
2-
import type { ListFn, RetrieveFn } from '@stripe/openapi'
2+
import type { ListFn, RetrieveFn } from '@stripe/sync-openapi'
33
import type { RevalidateEntityName } from './resourceRegistry.js'
44

55
/**

pnpm-lock.yaml

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)