@superdurable/connectors-sdk 0.0.0-stage → 0.1.1
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/LICENSE +21 -0
- package/README.md +264 -2
- package/dist/chunk-2IDXFKMY.js +251 -0
- package/dist/chunk-2NBM7P4T.js +42 -0
- package/dist/chunk-KD5DYYSU.js +93 -0
- package/dist/chunk-SOXYPIMO.js +179 -0
- package/dist/connectormock/index.d.ts +181 -0
- package/dist/connectormock/index.js +350 -0
- package/dist/credentials-vrvW0d4j.d.ts +445 -0
- package/dist/index.d.ts +81 -0
- package/dist/index.js +376 -0
- package/dist/oauthtoken/index.d.ts +90 -0
- package/dist/oauthtoken/index.js +236 -0
- package/dist/operation-Ca8rfacf.d.ts +34 -0
- package/dist/projectconfig/index.d.ts +569 -0
- package/dist/projectconfig/index.js +1433 -0
- package/dist/providerhttp/index.d.ts +57 -0
- package/dist/providerhttp/index.js +26 -0
- package/dist/singledispatch/index.d.ts +72 -0
- package/dist/singledispatch/index.js +178 -0
- package/package.json +73 -4
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import http from 'node:http';
|
|
2
|
+
|
|
3
|
+
/** Maximum body retained while extracting safe provider error tokens. */
|
|
4
|
+
declare const MaxErrorBodyBytes: number;
|
|
5
|
+
/** Maximum Retry-After delay, in milliseconds. */
|
|
6
|
+
declare const MaxRetryAfterDelayMs: number;
|
|
7
|
+
/** Response exceeded its caller-owned safety limit. */
|
|
8
|
+
declare class BodyTooLargeError extends Error {
|
|
9
|
+
/** HTTP status available when a response body was being read. */ readonly status: number | undefined;
|
|
10
|
+
/** HTTP headers available when a response body was being read. */ readonly headers: http.IncomingHttpHeaders | undefined;
|
|
11
|
+
constructor(status?: number, headers?: http.IncomingHttpHeaders);
|
|
12
|
+
}
|
|
13
|
+
/** Address policy refused a request before transmission. */
|
|
14
|
+
declare class AddressRefusal extends Error {
|
|
15
|
+
readonly reason: string;
|
|
16
|
+
/** Name a nonsecret network policy reason. */
|
|
17
|
+
constructor(reason: string);
|
|
18
|
+
}
|
|
19
|
+
/** Sanitized transport failure with positive evidence about dispatch. */
|
|
20
|
+
declare class ProviderTransportError extends Error {
|
|
21
|
+
readonly isProvablyNotSent: boolean;
|
|
22
|
+
/** True only when the request failed before a usable connection could send HTTP bytes. */
|
|
23
|
+
constructor(isProvablyNotSent: boolean);
|
|
24
|
+
}
|
|
25
|
+
/** Public-only HTTPS or explicitly owned private-network HTTP. */
|
|
26
|
+
type AddressPolicy = 'publicHTTPS' | 'privateNetworkHTTP';
|
|
27
|
+
/** One bounded provider request; response bodies and URL values never enter errors. */
|
|
28
|
+
interface ProviderRequest {
|
|
29
|
+
/** Absolute provider URL. */ url: string;
|
|
30
|
+
/** HTTP method. */ method: string;
|
|
31
|
+
/** Request headers, including provider credentials when needed. */ headers?: Record<string, string>;
|
|
32
|
+
/** Caller-encoded request body. */ body?: Uint8Array;
|
|
33
|
+
/** Maximum response body size in bytes. */ maxResponseBytes: number;
|
|
34
|
+
/** Network policy checked against all resolved addresses. */ addressPolicy: AddressPolicy;
|
|
35
|
+
/** Request deadline in milliseconds. */ timeoutMs?: number;
|
|
36
|
+
/** Caller cancellation. */ signal?: AbortSignal;
|
|
37
|
+
}
|
|
38
|
+
/** Bounded response; redirects remain visible as 3xx responses. */
|
|
39
|
+
interface ProviderResponse {
|
|
40
|
+
/** Numeric HTTP status. */ status: number;
|
|
41
|
+
/** Response headers. */ headers: http.IncomingHttpHeaders;
|
|
42
|
+
/** Bounded response bytes. */ body: Uint8Array;
|
|
43
|
+
}
|
|
44
|
+
/** Parse RFC 9110 delay-seconds or an HTTP-date, capped at one hour. */
|
|
45
|
+
declare function parseRetryAfter(value: string, now?: Date): number;
|
|
46
|
+
/** Validate a provider base URL without echoing input; returns original URL without trailing slashes, unlike Go's parsed rendering. WHATWG numeric loopback shorthands are accepted. */
|
|
47
|
+
declare function validateBaseURL(value: string): string;
|
|
48
|
+
/** Check whether a credential fits one HTTP header without alteration. */
|
|
49
|
+
declare function isHeaderSafeCredential(value: string): boolean;
|
|
50
|
+
/** Read a stream to at most maxBytes. A negative limit throws; Go clamps it to zero. */
|
|
51
|
+
declare function readBoundedBody(body: AsyncIterable<Uint8Array>, maxBytes: number): Promise<Uint8Array>;
|
|
52
|
+
/** Return safe tokens at ordered JSON pointers. Numeric lexemes may normalize through JavaScript Number. */
|
|
53
|
+
declare function readErrorTokens(body: Uint8Array, pointers: readonly string[]): string[];
|
|
54
|
+
/** Send once using pinned, policy-checked DNS results and no redirect replay. */
|
|
55
|
+
declare function sendProviderRequest(request: ProviderRequest): Promise<ProviderResponse>;
|
|
56
|
+
|
|
57
|
+
export { type AddressPolicy, AddressRefusal, BodyTooLargeError, MaxErrorBodyBytes, MaxRetryAfterDelayMs, type ProviderRequest, type ProviderResponse, ProviderTransportError, isHeaderSafeCredential, parseRetryAfter, readBoundedBody, readErrorTokens, sendProviderRequest, validateBaseURL };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AddressRefusal,
|
|
3
|
+
BodyTooLargeError,
|
|
4
|
+
MaxErrorBodyBytes,
|
|
5
|
+
MaxRetryAfterDelayMs,
|
|
6
|
+
ProviderTransportError,
|
|
7
|
+
isHeaderSafeCredential,
|
|
8
|
+
parseRetryAfter,
|
|
9
|
+
readBoundedBody,
|
|
10
|
+
readErrorTokens,
|
|
11
|
+
sendProviderRequest,
|
|
12
|
+
validateBaseURL
|
|
13
|
+
} from "../chunk-2IDXFKMY.js";
|
|
14
|
+
export {
|
|
15
|
+
AddressRefusal,
|
|
16
|
+
BodyTooLargeError,
|
|
17
|
+
MaxErrorBodyBytes,
|
|
18
|
+
MaxRetryAfterDelayMs,
|
|
19
|
+
ProviderTransportError,
|
|
20
|
+
isHeaderSafeCredential,
|
|
21
|
+
parseRetryAfter,
|
|
22
|
+
readBoundedBody,
|
|
23
|
+
readErrorTokens,
|
|
24
|
+
sendProviderRequest,
|
|
25
|
+
validateBaseURL
|
|
26
|
+
};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { C as Call, a as CallID } from '../credentials-vrvW0d4j.js';
|
|
3
|
+
import '@superdurable/dex';
|
|
4
|
+
|
|
5
|
+
/** The current attempt has no permission to send another provider write. */
|
|
6
|
+
declare class DispatchNotAllowedError extends Error {
|
|
7
|
+
constructor();
|
|
8
|
+
}
|
|
9
|
+
/** The provider request cannot fit within the protected attempt budget. */
|
|
10
|
+
declare class InsufficientTimeError extends Error {
|
|
11
|
+
constructor();
|
|
12
|
+
}
|
|
13
|
+
/** A claim heartbeat failed before any provider request was sent. */
|
|
14
|
+
declare class CheckpointError extends Error {
|
|
15
|
+
constructor();
|
|
16
|
+
}
|
|
17
|
+
/** Sets the fraction of the initial attempt budget available to Dispatch. */
|
|
18
|
+
interface FenceOptions {
|
|
19
|
+
/** Positive fraction up to 5/6; default is 7/12. */ writeWindowFraction?: number;
|
|
20
|
+
}
|
|
21
|
+
/** One-attempt fence for a non-idempotent provider write. Construct once per Step attempt. */
|
|
22
|
+
declare class Fence {
|
|
23
|
+
#private;
|
|
24
|
+
/** Capture the smaller of the configured Execute timeout and the public Dex attempt deadline. */
|
|
25
|
+
constructor(call: Call, executeTimeoutMs: number, options?: FenceOptions);
|
|
26
|
+
/** Decide before resolving credentials or performing any provider lookup. */
|
|
27
|
+
decide(): Decision;
|
|
28
|
+
/** Record the claim before sending once; repeat it during a long request. */
|
|
29
|
+
dispatch<Result>(send: (signal: AbortSignal) => Promise<Result> | Result): Promise<Result>;
|
|
30
|
+
/** Checkpoint a pre-send Retry, permanently forbidding Dispatch in this attempt. */
|
|
31
|
+
recordNotSent(): Promise<void>;
|
|
32
|
+
/** Checkpoint positive evidence that the prior request was not processed. */
|
|
33
|
+
recordCanResend(): Promise<void>;
|
|
34
|
+
/** Checkpoint an accepted provider resource for read-back after a lost response. */
|
|
35
|
+
recordProviderId(providerId: string): Promise<void>;
|
|
36
|
+
}
|
|
37
|
+
/** Construct one fence for the current Dex Step attempt. */
|
|
38
|
+
declare function newFence(call: Call, executeTimeoutMs: number, options?: FenceOptions): Fence;
|
|
39
|
+
|
|
40
|
+
/** Last known write state of one Dex Execute attempt. */
|
|
41
|
+
declare const MarkerStateSchema: z.ZodEnum<{
|
|
42
|
+
notSent: "notSent";
|
|
43
|
+
claimed: "claimed";
|
|
44
|
+
canResend: "canResend";
|
|
45
|
+
}>;
|
|
46
|
+
/** Last known write state of one Dex Execute attempt. */
|
|
47
|
+
type MarkerState = z.infer<typeof MarkerStateSchema>;
|
|
48
|
+
/** Secret-free heartbeat marker shared with the Go single-dispatch fence. */
|
|
49
|
+
declare const MarkerSchema: z.ZodObject<{
|
|
50
|
+
callId: z.ZodUUID;
|
|
51
|
+
attempt: z.ZodNumber;
|
|
52
|
+
state: z.ZodEnum<{
|
|
53
|
+
notSent: "notSent";
|
|
54
|
+
claimed: "claimed";
|
|
55
|
+
canResend: "canResend";
|
|
56
|
+
}>;
|
|
57
|
+
providerId: z.ZodOptional<z.ZodString>;
|
|
58
|
+
}, z.core.$strict>;
|
|
59
|
+
/** Secret-free heartbeat checkpoint for one call and attempt. */
|
|
60
|
+
type Marker = z.infer<typeof MarkerSchema>;
|
|
61
|
+
/** Action allowed before credentials or provider lookups. */
|
|
62
|
+
type DecisionKind = 'sendAllowed' | 'readBackRequired' | 'failClosed';
|
|
63
|
+
/** Decision from the most recent heartbeat checkpoint. */
|
|
64
|
+
interface Decision {
|
|
65
|
+
/** Allowed action. */ kind: DecisionKind;
|
|
66
|
+
/** Prior valid checkpoint, when available. */ marker?: Marker;
|
|
67
|
+
/** Safe reason for an unreadable or invalid checkpoint. */ error?: Error;
|
|
68
|
+
}
|
|
69
|
+
/** Decide whether this attempt may dispatch from a prior heartbeat value. */
|
|
70
|
+
declare function decideDispatch(callId: CallID, attempt: number, lastHeartbeat: unknown, readError?: Error): Decision;
|
|
71
|
+
|
|
72
|
+
export { CheckpointError, type Decision, type DecisionKind, DispatchNotAllowedError, Fence, type FenceOptions, InsufficientTimeError, type Marker, MarkerSchema, type MarkerState, MarkerStateSchema, decideDispatch, newFence };
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CallIDSchema
|
|
3
|
+
} from "../chunk-SOXYPIMO.js";
|
|
4
|
+
|
|
5
|
+
// src/singledispatch/index.ts
|
|
6
|
+
import { z } from "zod";
|
|
7
|
+
|
|
8
|
+
// src/singledispatch/fence.ts
|
|
9
|
+
var DispatchNotAllowedError = class extends Error {
|
|
10
|
+
constructor() {
|
|
11
|
+
super("single dispatch is not allowed for this attempt");
|
|
12
|
+
this.name = "DispatchNotAllowedError";
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
var InsufficientTimeError = class extends Error {
|
|
16
|
+
constructor() {
|
|
17
|
+
super("insufficient attempt time for single dispatch");
|
|
18
|
+
this.name = "InsufficientTimeError";
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
var CheckpointError = class extends Error {
|
|
22
|
+
constructor() {
|
|
23
|
+
super("single-dispatch checkpoint could not be recorded");
|
|
24
|
+
this.name = "CheckpointError";
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
var Fence = class {
|
|
28
|
+
#context;
|
|
29
|
+
#call;
|
|
30
|
+
#writeDeadline;
|
|
31
|
+
#minimumRequestTime;
|
|
32
|
+
#decision;
|
|
33
|
+
#hasDispatched = false;
|
|
34
|
+
#hasSendFinished = false;
|
|
35
|
+
#hasPreSendRetry = false;
|
|
36
|
+
#hasTerminalRecordPending = false;
|
|
37
|
+
#marker;
|
|
38
|
+
/** Capture the smaller of the configured Execute timeout and the public Dex attempt deadline. */
|
|
39
|
+
constructor(call, executeTimeoutMs, options = {}) {
|
|
40
|
+
if (!call?.context || !CallIDSchema.safeParse(call.id).success || !Number.isSafeInteger(call.context.attempt) || call.context.attempt < 1 || !Number.isFinite(executeTimeoutMs) || executeTimeoutMs <= 0) throw new TypeError("single dispatch requires a call, positive attempt, and Execute timeout");
|
|
41
|
+
const fraction = options.writeWindowFraction ?? 7 / 12;
|
|
42
|
+
if (!Number.isFinite(fraction) || fraction <= 0 || fraction > 5 / 6) throw new RangeError("single-dispatch write window must be within (0, 5/6]");
|
|
43
|
+
this.#call = call;
|
|
44
|
+
this.#context = call.context;
|
|
45
|
+
const now = Date.now();
|
|
46
|
+
const remaining = this.#context.deadline ? this.#context.deadline.getTime() - now : executeTimeoutMs;
|
|
47
|
+
const budget = Math.max(0, Math.min(executeTimeoutMs, remaining));
|
|
48
|
+
this.#writeDeadline = now + budget * fraction;
|
|
49
|
+
this.#minimumRequestTime = budget / 10;
|
|
50
|
+
}
|
|
51
|
+
/** Decide before resolving credentials or performing any provider lookup. */
|
|
52
|
+
decide() {
|
|
53
|
+
if (this.#decision) return this.#decision;
|
|
54
|
+
let last;
|
|
55
|
+
try {
|
|
56
|
+
if (this.#context.hasLastHeartbeatValue()) {
|
|
57
|
+
last = this.#context.getLastHeartbeatValue();
|
|
58
|
+
if (last === void 0 || last === null) {
|
|
59
|
+
this.#decision = { kind: "failClosed", error: new TypeError("invalid single-dispatch checkpoint") };
|
|
60
|
+
return this.#decision;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
} catch (error) {
|
|
64
|
+
this.#decision = decideDispatch(this.#call.id, this.#context.attempt, void 0, error instanceof Error ? error : new Error("heartbeat checkpoint is unreadable"));
|
|
65
|
+
return this.#decision;
|
|
66
|
+
}
|
|
67
|
+
this.#decision = decideDispatch(this.#call.id, this.#context.attempt, last);
|
|
68
|
+
return this.#decision;
|
|
69
|
+
}
|
|
70
|
+
/** Record the claim before sending once; repeat it during a long request. */
|
|
71
|
+
async dispatch(send) {
|
|
72
|
+
if (this.#decision?.kind !== "sendAllowed" || this.#hasDispatched || this.#hasPreSendRetry || typeof send !== "function") throw new DispatchNotAllowedError();
|
|
73
|
+
if (this.#minimumRequestTime <= 0 || this.#writeDeadline - Date.now() < this.#minimumRequestTime) {
|
|
74
|
+
try {
|
|
75
|
+
await this.recordNotSent();
|
|
76
|
+
} catch (error) {
|
|
77
|
+
throw new AggregateError([new InsufficientTimeError(), error], "single dispatch has insufficient time and checkpoint failed");
|
|
78
|
+
}
|
|
79
|
+
throw new InsufficientTimeError();
|
|
80
|
+
}
|
|
81
|
+
this.#hasDispatched = true;
|
|
82
|
+
const claim = { callId: this.#call.id, attempt: this.#context.attempt, state: "claimed" };
|
|
83
|
+
try {
|
|
84
|
+
await this.#record(claim);
|
|
85
|
+
} catch {
|
|
86
|
+
this.#hasPreSendRetry = true;
|
|
87
|
+
try {
|
|
88
|
+
await this.#context.recordHeartbeat({ callId: this.#call.id, attempt: this.#context.attempt, state: "notSent" });
|
|
89
|
+
} catch {
|
|
90
|
+
}
|
|
91
|
+
throw new CheckpointError();
|
|
92
|
+
}
|
|
93
|
+
const requestController = new AbortController();
|
|
94
|
+
const onCancel = () => requestController.abort(this.#context.cancellationSignal.reason);
|
|
95
|
+
if (this.#context.cancellationSignal.aborted) onCancel();
|
|
96
|
+
else this.#context.cancellationSignal.addEventListener("abort", onCancel, { once: true });
|
|
97
|
+
const timeout = setTimeout(() => requestController.abort(new InsufficientTimeError()), Math.max(0, this.#writeDeadline - Date.now()));
|
|
98
|
+
let pendingHeartbeat = Promise.resolve();
|
|
99
|
+
const ticker = setInterval(() => {
|
|
100
|
+
if (this.#marker?.state !== "claimed" || this.#marker.providerId) return;
|
|
101
|
+
pendingHeartbeat = pendingHeartbeat.then(async () => {
|
|
102
|
+
if (this.#marker?.state === "claimed" && !this.#marker.providerId) {
|
|
103
|
+
try {
|
|
104
|
+
await this.#context.recordHeartbeat(claim);
|
|
105
|
+
} catch {
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
}, 5e3);
|
|
110
|
+
try {
|
|
111
|
+
return await send(requestController.signal);
|
|
112
|
+
} finally {
|
|
113
|
+
clearInterval(ticker);
|
|
114
|
+
clearTimeout(timeout);
|
|
115
|
+
this.#context.cancellationSignal.removeEventListener("abort", onCancel);
|
|
116
|
+
await pendingHeartbeat;
|
|
117
|
+
this.#hasSendFinished = true;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
/** Checkpoint a pre-send Retry, permanently forbidding Dispatch in this attempt. */
|
|
121
|
+
async recordNotSent() {
|
|
122
|
+
if (this.#decision?.kind !== "sendAllowed" || this.#hasDispatched || this.#hasPreSendRetry) throw new DispatchNotAllowedError();
|
|
123
|
+
this.#hasPreSendRetry = true;
|
|
124
|
+
await this.#record({ callId: this.#call.id, attempt: this.#context.attempt, state: "notSent" });
|
|
125
|
+
}
|
|
126
|
+
/** Checkpoint positive evidence that the prior request was not processed. */
|
|
127
|
+
async recordCanResend() {
|
|
128
|
+
if (!this.#hasSendFinished || this.#hasTerminalRecordPending || this.#marker?.state !== "claimed" || this.#marker.providerId) throw new DispatchNotAllowedError();
|
|
129
|
+
this.#hasTerminalRecordPending = true;
|
|
130
|
+
try {
|
|
131
|
+
await this.#record({ callId: this.#call.id, attempt: this.#context.attempt, state: "canResend" });
|
|
132
|
+
} finally {
|
|
133
|
+
this.#hasTerminalRecordPending = false;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
/** Checkpoint an accepted provider resource for read-back after a lost response. */
|
|
137
|
+
async recordProviderId(providerId) {
|
|
138
|
+
if (!this.#hasSendFinished || this.#hasTerminalRecordPending || this.#marker?.state !== "claimed" || !providerId) throw new DispatchNotAllowedError();
|
|
139
|
+
this.#hasTerminalRecordPending = true;
|
|
140
|
+
try {
|
|
141
|
+
await this.#record({ callId: this.#call.id, attempt: this.#context.attempt, state: "claimed", providerId });
|
|
142
|
+
} finally {
|
|
143
|
+
this.#hasTerminalRecordPending = false;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
async #record(marker) {
|
|
147
|
+
await this.#context.recordHeartbeat(marker);
|
|
148
|
+
this.#marker = marker;
|
|
149
|
+
}
|
|
150
|
+
};
|
|
151
|
+
function newFence(call, executeTimeoutMs, options) {
|
|
152
|
+
return new Fence(call, executeTimeoutMs, options);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
// src/singledispatch/index.ts
|
|
156
|
+
var MarkerStateSchema = z.enum(["notSent", "claimed", "canResend"]);
|
|
157
|
+
var MarkerSchema = z.strictObject({ callId: CallIDSchema, attempt: z.number().int().positive(), state: MarkerStateSchema, providerId: z.string().min(1).optional() });
|
|
158
|
+
function decideDispatch(callId, attempt, lastHeartbeat, readError) {
|
|
159
|
+
if (!CallIDSchema.safeParse(callId).success || !Number.isSafeInteger(attempt) || attempt < 1) return { kind: "failClosed", error: new TypeError("single dispatch requires a call and positive attempt") };
|
|
160
|
+
if (readError) return { kind: "failClosed", error: readError };
|
|
161
|
+
if (lastHeartbeat === void 0 || lastHeartbeat === null) return { kind: attempt === 1 ? "sendAllowed" : "readBackRequired" };
|
|
162
|
+
const parsed = MarkerSchema.safeParse(lastHeartbeat);
|
|
163
|
+
if (!parsed.success) return { kind: "failClosed", error: new TypeError("invalid single-dispatch checkpoint") };
|
|
164
|
+
const marker = parsed.data;
|
|
165
|
+
if (marker.callId !== callId) return { kind: "failClosed", error: new TypeError("foreign single-dispatch checkpoint") };
|
|
166
|
+
if (marker.attempt === attempt - 1 && (marker.state === "notSent" || marker.state === "canResend") && !marker.providerId) return { kind: "sendAllowed", marker };
|
|
167
|
+
return { kind: "readBackRequired", marker };
|
|
168
|
+
}
|
|
169
|
+
export {
|
|
170
|
+
CheckpointError,
|
|
171
|
+
DispatchNotAllowedError,
|
|
172
|
+
Fence,
|
|
173
|
+
InsufficientTimeError,
|
|
174
|
+
MarkerSchema,
|
|
175
|
+
MarkerStateSchema,
|
|
176
|
+
decideDispatch,
|
|
177
|
+
newFence
|
|
178
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,75 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@superdurable/connectors-sdk",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "Provider-neutral TypeScript contracts for Dex connectors",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git+https://github.com/superdurable/dex-connectors-library.git",
|
|
8
|
+
"directory": "sdkts"
|
|
9
|
+
},
|
|
10
|
+
"type": "module",
|
|
11
|
+
"engines": {
|
|
12
|
+
"node": "^22.0.0 || ^24.0.0"
|
|
13
|
+
},
|
|
14
|
+
"publishConfig": {
|
|
15
|
+
"access": "public",
|
|
16
|
+
"registry": "https://registry.npmjs.org"
|
|
17
|
+
},
|
|
18
|
+
"module": "./dist/index.js",
|
|
19
|
+
"types": "./dist/index.d.ts",
|
|
20
|
+
"exports": {
|
|
21
|
+
".": {
|
|
22
|
+
"types": "./dist/index.d.ts",
|
|
23
|
+
"import": "./dist/index.js"
|
|
24
|
+
},
|
|
25
|
+
"./providerhttp": {
|
|
26
|
+
"types": "./dist/providerhttp/index.d.ts",
|
|
27
|
+
"import": "./dist/providerhttp/index.js"
|
|
28
|
+
},
|
|
29
|
+
"./projectconfig": {
|
|
30
|
+
"types": "./dist/projectconfig/index.d.ts",
|
|
31
|
+
"import": "./dist/projectconfig/index.js"
|
|
32
|
+
},
|
|
33
|
+
"./connectormock": {
|
|
34
|
+
"types": "./dist/connectormock/index.d.ts",
|
|
35
|
+
"import": "./dist/connectormock/index.js"
|
|
36
|
+
},
|
|
37
|
+
"./oauthtoken": {
|
|
38
|
+
"types": "./dist/oauthtoken/index.d.ts",
|
|
39
|
+
"import": "./dist/oauthtoken/index.js"
|
|
40
|
+
},
|
|
41
|
+
"./singledispatch": {
|
|
42
|
+
"types": "./dist/singledispatch/index.d.ts",
|
|
43
|
+
"import": "./dist/singledispatch/index.js"
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
"files": [
|
|
47
|
+
"dist",
|
|
48
|
+
"README.md",
|
|
49
|
+
"LICENSE"
|
|
50
|
+
],
|
|
51
|
+
"scripts": {
|
|
52
|
+
"prepack": "npm run build",
|
|
53
|
+
"build": "tsup src/index.ts src/providerhttp/index.ts src/projectconfig/index.ts src/connectormock/index.ts src/oauthtoken/index.ts src/singledispatch/index.ts --format esm --dts --clean",
|
|
54
|
+
"typecheck": "tsc --noEmit",
|
|
55
|
+
"lint": "eslint src test",
|
|
56
|
+
"test": "vitest run",
|
|
57
|
+
"test:package": "node test/pack_smoke.mjs",
|
|
58
|
+
"test:integration": "npm run build && node test/integ/step_flows.mjs",
|
|
59
|
+
"check": "npm run typecheck && npm run lint && npm test && npm run build && npm run test:package"
|
|
60
|
+
},
|
|
61
|
+
"dependencies": {
|
|
62
|
+
"@aws-sdk/client-s3": "^3.900.0",
|
|
63
|
+
"@superdurable/dex": ">=1.28.0",
|
|
64
|
+
"zod": "^4.1.0"
|
|
65
|
+
},
|
|
66
|
+
"devDependencies": {
|
|
67
|
+
"@eslint/js": "^9.0.0",
|
|
68
|
+
"@types/node": "^22.0.0",
|
|
69
|
+
"eslint": "^9.0.0",
|
|
70
|
+
"tsup": "^8.0.0",
|
|
71
|
+
"typescript": "^5.9.0",
|
|
72
|
+
"typescript-eslint": "^8.0.0",
|
|
73
|
+
"vitest": "^3.0.0"
|
|
74
|
+
}
|
|
75
|
+
}
|