@superdurable/connector-ashby 0.0.0-stage → 0.1.0
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 +4 -2
- package/dex-connector.json +65 -0
- package/dist/chunk-6O5ADW6S.js +107 -0
- package/dist/connection-DrUeqnOI.d.ts +75 -0
- package/dist/index.d.ts +97 -0
- package/dist/index.js +224 -0
- package/dist/mock.d.ts +35 -0
- package/dist/mock.js +75 -0
- package/package.json +59 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Super Durable
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Ashby TypeScript connector
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Implements `getCandidate`, returning candidate ID, name, and creation/update timestamps. Go-recorded conformance checks exact requests, branches, retries, and outputs.
|
|
4
|
+
|
|
5
|
+
Create an Ashby API key with **Candidates read** permission under **Admin > API Keys** and save it as `api_key` in Dex Web Connections. Leave `baseUrl` blank for the default endpoint. See the [connection guide](../README.md) and [runnable example](examples/candidate-inspection/README.md). Live provider authorization remains unverified.
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
{
|
|
2
|
+
"connectorId": "ashby",
|
|
3
|
+
"releaseTag": "connectors/ashby/go/v0.1.0",
|
|
4
|
+
"package": {
|
|
5
|
+
"ecosystem": "npm",
|
|
6
|
+
"name": "@superdurable/connector-ashby",
|
|
7
|
+
"version": "0.1.0"
|
|
8
|
+
},
|
|
9
|
+
"factories": [
|
|
10
|
+
{
|
|
11
|
+
"name": "newGetCandidateStep",
|
|
12
|
+
"kind": "query",
|
|
13
|
+
"operationId": "getCandidate",
|
|
14
|
+
"inputType": "GetCandidateInput",
|
|
15
|
+
"description": "Read one candidate's ID, name, and creation/update timestamps.",
|
|
16
|
+
"fields": {
|
|
17
|
+
"stepType": "stepType",
|
|
18
|
+
"annotations": "annotations",
|
|
19
|
+
"connectionName": "connectionName",
|
|
20
|
+
"resultAttribute": "resultAttribute"
|
|
21
|
+
},
|
|
22
|
+
"branches": [
|
|
23
|
+
{
|
|
24
|
+
"id": "found",
|
|
25
|
+
"field": "found",
|
|
26
|
+
"optional": false
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"id": "notFound",
|
|
30
|
+
"field": "notFound",
|
|
31
|
+
"optional": true
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"id": "providerRejected",
|
|
35
|
+
"field": "providerRejected",
|
|
36
|
+
"optional": true
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"id": "invalidResponse",
|
|
40
|
+
"field": "invalidResponse",
|
|
41
|
+
"optional": true
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"id": "defect",
|
|
45
|
+
"field": "defect",
|
|
46
|
+
"optional": true
|
|
47
|
+
}
|
|
48
|
+
],
|
|
49
|
+
"inputSchema": {
|
|
50
|
+
"additionalProperties": false,
|
|
51
|
+
"description": "GetCandidateInput selects a candidate by its non-secret Ashby ID.",
|
|
52
|
+
"properties": {
|
|
53
|
+
"candidateId": {
|
|
54
|
+
"description": "CandidateID is the ID shown in Ashby Candidates or returned by the API.",
|
|
55
|
+
"type": "string"
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
"required": [
|
|
59
|
+
"candidateId"
|
|
60
|
+
],
|
|
61
|
+
"type": "object"
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
]
|
|
65
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
// src/generated/models.ts
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { SecretString } from "@superdurable/connectors-sdk";
|
|
4
|
+
var ConfigSchema = z.object({
|
|
5
|
+
"baseUrl": z.string().optional(),
|
|
6
|
+
"timeoutMs": z.number().int().optional(),
|
|
7
|
+
"maxResponseBytes": z.number().int().optional()
|
|
8
|
+
});
|
|
9
|
+
function decodeCredentials(value) {
|
|
10
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) throw new TypeError("credential fields are invalid");
|
|
11
|
+
const fields = value;
|
|
12
|
+
const allowed = /* @__PURE__ */ new Set(["api_key"]);
|
|
13
|
+
if (Object.keys(fields).some((key) => !allowed.has(key))) throw new TypeError("stored credential does not match the connector credential fields");
|
|
14
|
+
if (fields["api_key"] != null && !(typeof fields["api_key"] === "string")) throw new TypeError("credential api_key has an invalid type");
|
|
15
|
+
const credentials = {};
|
|
16
|
+
if (!fields["api_key"]) throw new TypeError("credential api_key is required");
|
|
17
|
+
credentials.apiKey = new SecretString(fields["api_key"] ?? "");
|
|
18
|
+
return credentials;
|
|
19
|
+
}
|
|
20
|
+
var GetCandidateInputSchema = z.strictObject({
|
|
21
|
+
"candidateId": z.string()
|
|
22
|
+
});
|
|
23
|
+
var CandidateProfileSchema = z.strictObject({
|
|
24
|
+
"id": z.string(),
|
|
25
|
+
"name": z.string(),
|
|
26
|
+
"createdAt": z.string(),
|
|
27
|
+
"updatedAt": z.string()
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
// src/generated/definitions.ts
|
|
31
|
+
var ConnectorID = "ashby";
|
|
32
|
+
var ProviderID = "ashby";
|
|
33
|
+
var GetCandidateBranch = {
|
|
34
|
+
Found: "found",
|
|
35
|
+
NotFound: "notFound",
|
|
36
|
+
ProviderRejected: "providerRejected",
|
|
37
|
+
InvalidResponse: "invalidResponse",
|
|
38
|
+
Defect: "defect"
|
|
39
|
+
};
|
|
40
|
+
var GetCandidateBranchFound = GetCandidateBranch.Found;
|
|
41
|
+
var GetCandidateBranchNotFound = GetCandidateBranch.NotFound;
|
|
42
|
+
var GetCandidateBranchProviderRejected = GetCandidateBranch.ProviderRejected;
|
|
43
|
+
var GetCandidateBranchInvalidResponse = GetCandidateBranch.InvalidResponse;
|
|
44
|
+
var GetCandidateBranchDefect = GetCandidateBranch.Defect;
|
|
45
|
+
var GetCandidateDefinition = {
|
|
46
|
+
operation: { connectorId: ConnectorID, operationId: "getCandidate" },
|
|
47
|
+
branches: [
|
|
48
|
+
{ id: "found", description: "Ashby returned the candidate." },
|
|
49
|
+
{ id: "notFound", description: "Ashby did not expose the candidate.", optional: true },
|
|
50
|
+
{ id: "providerRejected", description: "Ashby conclusively rejected the lookup.", optional: true },
|
|
51
|
+
{ id: "invalidResponse", description: "Ashby returned malformed or oversized JSON.", optional: true },
|
|
52
|
+
{ id: "defect", description: "Local input or connection credentials are invalid.", optional: true }
|
|
53
|
+
],
|
|
54
|
+
stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "async" }
|
|
55
|
+
};
|
|
56
|
+
var GetCandidateMetadata = { kind: "query", idempotency: "none", authorization: "required" };
|
|
57
|
+
|
|
58
|
+
// src/generated/connection.ts
|
|
59
|
+
import { ConnectionRefSchema } from "@superdurable/connectors-sdk";
|
|
60
|
+
var Connection = class {
|
|
61
|
+
/** Stable provider and connection name. */
|
|
62
|
+
reference;
|
|
63
|
+
/** Bound provider operations. */
|
|
64
|
+
operations;
|
|
65
|
+
/** Validate a reference and bind operations. */
|
|
66
|
+
constructor(reference, operations) {
|
|
67
|
+
this.reference = ConnectionRefSchema.parse(reference);
|
|
68
|
+
if (this.reference.provider !== ProviderID) throw new TypeError("connection provider differs from the manifest");
|
|
69
|
+
if (!operations) throw new TypeError("connector operations are required");
|
|
70
|
+
this.operations = operations;
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
function newConnection(client, reference) {
|
|
74
|
+
if (!client) throw new TypeError("connector client is required");
|
|
75
|
+
return new Connection(reference, client);
|
|
76
|
+
}
|
|
77
|
+
function newConnectionWithOperations(operations, reference) {
|
|
78
|
+
return new Connection(reference, operations);
|
|
79
|
+
}
|
|
80
|
+
function newProjectConnection(project, connectionName, createClient) {
|
|
81
|
+
if (!project) throw new TypeError("loaded project is required");
|
|
82
|
+
const reference = ConnectionRefSchema.parse({ provider: ProviderID, name: connectionName });
|
|
83
|
+
const selected = project.configuration.connections.find((entry) => entry.connectorId === ConnectorID && entry.connectionName === connectionName);
|
|
84
|
+
if (!selected || selected.provider !== ProviderID) throw new TypeError("project connection is not configured");
|
|
85
|
+
return newConnection(createClient(project, connectionName), reference);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export {
|
|
89
|
+
ConfigSchema,
|
|
90
|
+
decodeCredentials,
|
|
91
|
+
GetCandidateInputSchema,
|
|
92
|
+
CandidateProfileSchema,
|
|
93
|
+
ConnectorID,
|
|
94
|
+
ProviderID,
|
|
95
|
+
GetCandidateBranch,
|
|
96
|
+
GetCandidateBranchFound,
|
|
97
|
+
GetCandidateBranchNotFound,
|
|
98
|
+
GetCandidateBranchProviderRejected,
|
|
99
|
+
GetCandidateBranchInvalidResponse,
|
|
100
|
+
GetCandidateBranchDefect,
|
|
101
|
+
GetCandidateDefinition,
|
|
102
|
+
GetCandidateMetadata,
|
|
103
|
+
Connection,
|
|
104
|
+
newConnection,
|
|
105
|
+
newConnectionWithOperations,
|
|
106
|
+
newProjectConnection
|
|
107
|
+
};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { SecretString, CredentialProvider, Query, ConnectionRef } from '@superdurable/connectors-sdk';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
|
|
4
|
+
/** Connector configuration; omitted fields use manifest defaults. */
|
|
5
|
+
interface Config {
|
|
6
|
+
/** Ashby API root as an absolute HTTPS URL. Blank uses the displayed endpoint; override only for a trusted local test gateway. */
|
|
7
|
+
baseUrl?: string;
|
|
8
|
+
/** Maximum duration of one API request as a positive Go duration such as 15s. Blank uses the displayed default; increase for slow candidate reads. Runtime value in milliseconds. */
|
|
9
|
+
timeoutMs?: number;
|
|
10
|
+
/** Maximum complete candidate response in bytes as a positive integer. Blank uses the displayed default; increase for candidates with large metadata. */
|
|
11
|
+
maxResponseBytes?: number;
|
|
12
|
+
}
|
|
13
|
+
/** Runtime schema for manifest configuration. */
|
|
14
|
+
declare const ConfigSchema: z.ZodObject<{
|
|
15
|
+
baseUrl: z.ZodOptional<z.ZodString>;
|
|
16
|
+
timeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
17
|
+
maxResponseBytes: z.ZodOptional<z.ZodNumber>;
|
|
18
|
+
}, z.core.$strip>;
|
|
19
|
+
/** Private connector credentials resolved by the host. */
|
|
20
|
+
interface Credentials {
|
|
21
|
+
/** Secret Ashby API key from Admin > API Keys. Grant Candidates read permission; copy the complete opaque value once. Blank prevents calls. Dex uses it as the Basic username with an empty password. */
|
|
22
|
+
apiKey: SecretString;
|
|
23
|
+
}
|
|
24
|
+
/** Decode private credential fields for the connector. */
|
|
25
|
+
declare function decodeCredentials(value: unknown): Credentials;
|
|
26
|
+
/** Host-owned source of private connector credentials. */
|
|
27
|
+
type CredentialSource = CredentialProvider<Credentials>;
|
|
28
|
+
/** GetCandidateInput selects a candidate by its non-secret Ashby ID. */
|
|
29
|
+
interface GetCandidateInput {
|
|
30
|
+
/** CandidateID is the ID shown in Ashby Candidates or returned by the API. */
|
|
31
|
+
"candidateId": string;
|
|
32
|
+
}
|
|
33
|
+
/** CandidateProfile excludes email, phone, files, and custom fields. */
|
|
34
|
+
interface CandidateProfile {
|
|
35
|
+
/** ID is the Ashby candidate UUID. */
|
|
36
|
+
"id": string;
|
|
37
|
+
/** Name is the candidate display name. */
|
|
38
|
+
"name": string;
|
|
39
|
+
/** CreatedAt is Ashby's creation timestamp. */
|
|
40
|
+
"createdAt": string;
|
|
41
|
+
/** UpdatedAt is Ashby's update timestamp. */
|
|
42
|
+
"updatedAt": string;
|
|
43
|
+
}
|
|
44
|
+
/** Runtime validator for GetCandidateInput. */
|
|
45
|
+
declare const GetCandidateInputSchema: z.ZodObject<{
|
|
46
|
+
candidateId: z.ZodString;
|
|
47
|
+
}, z.core.$strict>;
|
|
48
|
+
/** Runtime validator for CandidateProfile. */
|
|
49
|
+
declare const CandidateProfileSchema: z.ZodObject<{
|
|
50
|
+
id: z.ZodString;
|
|
51
|
+
name: z.ZodString;
|
|
52
|
+
createdAt: z.ZodString;
|
|
53
|
+
updatedAt: z.ZodString;
|
|
54
|
+
}, z.core.$strict>;
|
|
55
|
+
|
|
56
|
+
/** Typed operations supplied by a client or mock. */
|
|
57
|
+
interface Operations {
|
|
58
|
+
/** Invoke getCandidate through this connection. */
|
|
59
|
+
getCandidate(): Query<GetCandidateInput, CandidateProfile>;
|
|
60
|
+
}
|
|
61
|
+
/** Named connector connection kept outside Flow state. */
|
|
62
|
+
declare class Connection<BoundOperations = Operations> {
|
|
63
|
+
/** Stable provider and connection name. */
|
|
64
|
+
readonly reference: ConnectionRef;
|
|
65
|
+
/** Bound provider operations. */
|
|
66
|
+
readonly operations: BoundOperations;
|
|
67
|
+
/** Validate a reference and bind operations. */
|
|
68
|
+
constructor(reference: ConnectionRef, operations: BoundOperations);
|
|
69
|
+
}
|
|
70
|
+
/** Bind a client to a named connection. */
|
|
71
|
+
declare function newConnection(client: Operations, reference: ConnectionRef): Connection;
|
|
72
|
+
/** Bind scripted operations to a named connection. */
|
|
73
|
+
declare function newConnectionWithOperations(operations: Operations, reference: ConnectionRef): Connection;
|
|
74
|
+
|
|
75
|
+
export { type CandidateProfile as C, type GetCandidateInput as G, type Operations as O, Connection as a, type Config as b, type Credentials as c, CandidateProfileSchema as d, ConfigSchema as e, type CredentialSource as f, GetCandidateInputSchema as g, decodeCredentials as h, newConnectionWithOperations as i, newConnection as n };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { G as GetCandidateInput, C as CandidateProfile, a as Connection, O as Operations, b as Config, c as Credentials } from './connection-DrUeqnOI.js';
|
|
2
|
+
export { d as CandidateProfileSchema, e as ConfigSchema, f as CredentialSource, g as GetCandidateInputSchema, h as decodeCredentials, n as newConnection, i as newConnectionWithOperations } from './connection-DrUeqnOI.js';
|
|
3
|
+
import { QueryDefinition, QueryStepConfig, Query, QueryResult, QueryStep, CredentialProvider, Call, QueryAttempt } from '@superdurable/connectors-sdk';
|
|
4
|
+
import { StepTarget } from '@superdurable/dex';
|
|
5
|
+
import { LoadedProject } from '@superdurable/connectors-sdk/projectconfig';
|
|
6
|
+
import { ProviderRequest, ProviderResponse } from '@superdurable/connectors-sdk/providerhttp';
|
|
7
|
+
import 'zod';
|
|
8
|
+
|
|
9
|
+
/** Stable connector identity. */
|
|
10
|
+
declare const ConnectorID = "ashby";
|
|
11
|
+
/** Provider identity for named connections. */
|
|
12
|
+
declare const ProviderID = "ashby";
|
|
13
|
+
/** Branch IDs for getCandidate. */
|
|
14
|
+
declare const GetCandidateBranch: {
|
|
15
|
+
readonly Found: "found";
|
|
16
|
+
readonly NotFound: "notFound";
|
|
17
|
+
readonly ProviderRejected: "providerRejected";
|
|
18
|
+
readonly InvalidResponse: "invalidResponse";
|
|
19
|
+
readonly Defect: "defect";
|
|
20
|
+
};
|
|
21
|
+
/** Ashby returned the candidate. */
|
|
22
|
+
declare const GetCandidateBranchFound: "found";
|
|
23
|
+
/** Ashby did not expose the candidate. */
|
|
24
|
+
declare const GetCandidateBranchNotFound: "notFound";
|
|
25
|
+
/** Ashby conclusively rejected the lookup. */
|
|
26
|
+
declare const GetCandidateBranchProviderRejected: "providerRejected";
|
|
27
|
+
/** Ashby returned malformed or oversized JSON. */
|
|
28
|
+
declare const GetCandidateBranchInvalidResponse: "invalidResponse";
|
|
29
|
+
/** Local input or connection credentials are invalid. */
|
|
30
|
+
declare const GetCandidateBranchDefect: "defect";
|
|
31
|
+
/** Manifest definition for getCandidate. */
|
|
32
|
+
declare const GetCandidateDefinition: QueryDefinition;
|
|
33
|
+
/** Manifest metadata for getCandidate. */
|
|
34
|
+
declare const GetCandidateMetadata: {
|
|
35
|
+
readonly kind: "query";
|
|
36
|
+
readonly idempotency: "none";
|
|
37
|
+
readonly authorization: "required";
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
/** Configuration for the getCandidate connector Step. */
|
|
41
|
+
interface GetCandidateStepConfig<StepInput, OperationInput = GetCandidateInput, OperationOutput = CandidateProfile> extends Omit<QueryStepConfig<StepInput, OperationInput, OperationOutput>, 'operation' | 'connection' | 'branches'> {
|
|
42
|
+
/** Named connection supplying this operation. */
|
|
43
|
+
connection: Connection<{
|
|
44
|
+
getCandidate(): Query<OperationInput, OperationOutput>;
|
|
45
|
+
}>;
|
|
46
|
+
/** Name matching the bound connection. */
|
|
47
|
+
connectionName: string;
|
|
48
|
+
/** Ashby returned the candidate. */
|
|
49
|
+
found: StepTarget<QueryResult<OperationOutput>>;
|
|
50
|
+
/** Ashby did not expose the candidate. */
|
|
51
|
+
notFound?: StepTarget<QueryResult<OperationOutput>>;
|
|
52
|
+
/** Ashby conclusively rejected the lookup. */
|
|
53
|
+
providerRejected?: StepTarget<QueryResult<OperationOutput>>;
|
|
54
|
+
/** Ashby returned malformed or oversized JSON. */
|
|
55
|
+
invalidResponse?: StepTarget<QueryResult<OperationOutput>>;
|
|
56
|
+
/** Local input or connection credentials are invalid. */
|
|
57
|
+
defect?: StepTarget<QueryResult<OperationOutput>>;
|
|
58
|
+
}
|
|
59
|
+
/** Build the getCandidate Step from a named connection. */
|
|
60
|
+
declare function newGetCandidateStep<StepInput, OperationInput = GetCandidateInput, OperationOutput = CandidateProfile>(configuration: GetCandidateStepConfig<StepInput, OperationInput, OperationOutput>): QueryStep<StepInput, OperationInput, OperationOutput>;
|
|
61
|
+
|
|
62
|
+
/** Open one named Ashby connection from Dex project configuration. */
|
|
63
|
+
declare function newProjectConnection(project: LoadedProject, connectionName: string): Connection<Operations>;
|
|
64
|
+
|
|
65
|
+
/** Injectable provider sender for tests and local applications. */
|
|
66
|
+
interface AshbyClientOptions {
|
|
67
|
+
/** Provider sender; omitted uses the SDK transport. */ send?: (request: ProviderRequest) => Promise<ProviderResponse>;
|
|
68
|
+
}
|
|
69
|
+
interface Exchange {
|
|
70
|
+
status: number;
|
|
71
|
+
body: Uint8Array;
|
|
72
|
+
retryAfterMs: number;
|
|
73
|
+
error?: 'credential' | 'request' | 'tooLarge';
|
|
74
|
+
}
|
|
75
|
+
/** Authenticated Ashby REST API client for candidate metadata. */
|
|
76
|
+
declare class AshbyClient {
|
|
77
|
+
private readonly credentials;
|
|
78
|
+
private readonly baseURL;
|
|
79
|
+
private readonly timeoutMs;
|
|
80
|
+
private readonly maxResponseBytes;
|
|
81
|
+
private readonly send;
|
|
82
|
+
/** Validate provider configuration without contacting Ashby. */
|
|
83
|
+
constructor(config: Config, credentials: CredentialProvider<Credentials>, options?: AshbyClientOptions);
|
|
84
|
+
/** Bind the getCandidate Query. */ getCandidate(): GetCandidateOperation;
|
|
85
|
+
/** Resolve the API key and send one bounded candidate lookup. */
|
|
86
|
+
get(call: Call, candidateID: string): Promise<Exchange>;
|
|
87
|
+
}
|
|
88
|
+
/** Read one candidate's ID, name, and timestamps. */
|
|
89
|
+
declare class GetCandidateOperation implements Query<GetCandidateInput, CandidateProfile> {
|
|
90
|
+
private readonly client;
|
|
91
|
+
/** Bind the provider client. */ constructor(client: AshbyClient);
|
|
92
|
+
/** Return the generated Query candidate. */ definition(): QueryDefinition;
|
|
93
|
+
/** Classify provider outcomes consistently with the Go implementation. */
|
|
94
|
+
invoke(call: Call, input: GetCandidateInput): Promise<QueryAttempt<CandidateProfile>>;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export { AshbyClient, type AshbyClientOptions, CandidateProfile, Config, Connection, ConnectorID, Credentials, GetCandidateBranch, GetCandidateBranchDefect, GetCandidateBranchFound, GetCandidateBranchInvalidResponse, GetCandidateBranchNotFound, GetCandidateBranchProviderRejected, GetCandidateDefinition, GetCandidateInput, GetCandidateMetadata, GetCandidateOperation, type GetCandidateStepConfig, ProviderID, newGetCandidateStep, newProjectConnection };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CandidateProfileSchema,
|
|
3
|
+
ConfigSchema,
|
|
4
|
+
Connection,
|
|
5
|
+
ConnectorID,
|
|
6
|
+
GetCandidateBranch,
|
|
7
|
+
GetCandidateBranchDefect,
|
|
8
|
+
GetCandidateBranchFound,
|
|
9
|
+
GetCandidateBranchInvalidResponse,
|
|
10
|
+
GetCandidateBranchNotFound,
|
|
11
|
+
GetCandidateBranchProviderRejected,
|
|
12
|
+
GetCandidateDefinition,
|
|
13
|
+
GetCandidateInputSchema,
|
|
14
|
+
GetCandidateMetadata,
|
|
15
|
+
ProviderID,
|
|
16
|
+
decodeCredentials,
|
|
17
|
+
newConnection,
|
|
18
|
+
newConnectionWithOperations,
|
|
19
|
+
newProjectConnection
|
|
20
|
+
} from "./chunk-6O5ADW6S.js";
|
|
21
|
+
|
|
22
|
+
// src/generated/steps.ts
|
|
23
|
+
import { goToBranch, newQueryStep } from "@superdurable/connectors-sdk";
|
|
24
|
+
function newGetCandidateStep(configuration) {
|
|
25
|
+
const { connection, connectionName, found, notFound, providerRejected, invalidResponse, defect, ...stepConfiguration } = configuration;
|
|
26
|
+
if (!connection || connection.reference.name !== connectionName) throw new TypeError("Step connection name differs from the bound connection");
|
|
27
|
+
return newQueryStep({ ...stepConfiguration, operation: connection.operations.getCandidate(), connection: connection.reference, branches: [
|
|
28
|
+
goToBranch("found", found),
|
|
29
|
+
...notFound ? [goToBranch("notFound", notFound)] : [],
|
|
30
|
+
...providerRejected ? [goToBranch("providerRejected", providerRejected)] : [],
|
|
31
|
+
...invalidResponse ? [goToBranch("invalidResponse", invalidResponse)] : [],
|
|
32
|
+
...defect ? [goToBranch("defect", defect)] : []
|
|
33
|
+
] });
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// src/project.ts
|
|
37
|
+
import { SecretString as SecretString2 } from "@superdurable/connectors-sdk";
|
|
38
|
+
import { z } from "zod";
|
|
39
|
+
|
|
40
|
+
// src/client.ts
|
|
41
|
+
import { SecretString, newQueryBranch, newQueryRetry } from "@superdurable/connectors-sdk";
|
|
42
|
+
import { BodyTooLargeError, isHeaderSafeCredential, parseRetryAfter, sendProviderRequest, validateBaseURL } from "@superdurable/connectors-sdk/providerhttp";
|
|
43
|
+
var defaultBaseURL = "https://api.ashbyhq.com";
|
|
44
|
+
var emptyCandidate = () => ({ id: "", name: "", createdAt: "", updatedAt: "" });
|
|
45
|
+
var AshbyClient = class {
|
|
46
|
+
/** Validate provider configuration without contacting Ashby. */
|
|
47
|
+
constructor(config, credentials, options = {}) {
|
|
48
|
+
this.credentials = credentials;
|
|
49
|
+
if (!config || !credentials) throw new TypeError("Ashby configuration and credentials are required");
|
|
50
|
+
this.baseURL = validateBaseURL(config.baseUrl || defaultBaseURL);
|
|
51
|
+
this.timeoutMs = config.timeoutMs || 15e3;
|
|
52
|
+
this.maxResponseBytes = config.maxResponseBytes || 1048576;
|
|
53
|
+
if (!Number.isSafeInteger(this.timeoutMs) || this.timeoutMs <= 0 || !Number.isSafeInteger(this.maxResponseBytes) || this.maxResponseBytes <= 0)
|
|
54
|
+
throw new TypeError("Ashby request limits must be positive integers");
|
|
55
|
+
this.send = options.send ?? sendProviderRequest;
|
|
56
|
+
}
|
|
57
|
+
credentials;
|
|
58
|
+
baseURL;
|
|
59
|
+
timeoutMs;
|
|
60
|
+
maxResponseBytes;
|
|
61
|
+
send;
|
|
62
|
+
/** Bind the getCandidate Query. */
|
|
63
|
+
getCandidate() {
|
|
64
|
+
return new GetCandidateOperation(this);
|
|
65
|
+
}
|
|
66
|
+
/** Resolve the API key and send one bounded candidate lookup. */
|
|
67
|
+
async get(call, candidateID) {
|
|
68
|
+
let apiKey;
|
|
69
|
+
try {
|
|
70
|
+
const credentials = await this.credentials.resolve(call, call.context.cancellationSignal);
|
|
71
|
+
apiKey = credentials.apiKey instanceof SecretString ? credentials.apiKey.reveal() : "";
|
|
72
|
+
} catch {
|
|
73
|
+
return emptyExchange("credential");
|
|
74
|
+
}
|
|
75
|
+
if (!apiKey || !isHeaderSafeCredential(apiKey) || apiKey.includes(":")) return emptyExchange("credential");
|
|
76
|
+
const request = {
|
|
77
|
+
url: `${this.baseURL}/candidate.info`,
|
|
78
|
+
method: "POST",
|
|
79
|
+
body: Buffer.from(JSON.stringify({ id: candidateID }), "utf8"),
|
|
80
|
+
headers: { Accept: "application/json; version=1", "Content-Type": "application/json", Authorization: `Basic ${Buffer.from(apiKey + ":").toString("base64")}` },
|
|
81
|
+
maxResponseBytes: this.maxResponseBytes,
|
|
82
|
+
timeoutMs: this.timeoutMs,
|
|
83
|
+
addressPolicy: this.baseURL.startsWith("https://") ? "publicHTTPS" : "privateNetworkHTTP",
|
|
84
|
+
signal: call.context.cancellationSignal
|
|
85
|
+
};
|
|
86
|
+
let response;
|
|
87
|
+
let isTooLarge = false;
|
|
88
|
+
try {
|
|
89
|
+
response = await this.send(request);
|
|
90
|
+
} catch (error) {
|
|
91
|
+
if (error instanceof BodyTooLargeError && error.status !== void 0) {
|
|
92
|
+
response = { status: error.status, headers: error.headers ?? {}, body: new Uint8Array() };
|
|
93
|
+
isTooLarge = true;
|
|
94
|
+
} else return emptyExchange("request");
|
|
95
|
+
}
|
|
96
|
+
const retryAfterMs = parseRetryAfter(header(response.headers, "retry-after"));
|
|
97
|
+
if (isTooLarge || response.body.length > this.maxResponseBytes)
|
|
98
|
+
return { status: response.status, body: new Uint8Array(), retryAfterMs, error: "tooLarge" };
|
|
99
|
+
return { status: response.status, body: response.body, retryAfterMs };
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
var GetCandidateOperation = class {
|
|
103
|
+
/** Bind the provider client. */
|
|
104
|
+
constructor(client) {
|
|
105
|
+
this.client = client;
|
|
106
|
+
}
|
|
107
|
+
client;
|
|
108
|
+
/** Return the generated Query candidate. */
|
|
109
|
+
definition() {
|
|
110
|
+
return GetCandidateDefinition;
|
|
111
|
+
}
|
|
112
|
+
/** Classify provider outcomes consistently with the Go implementation. */
|
|
113
|
+
async invoke(call, input) {
|
|
114
|
+
if (!isValidCandidateID(input?.candidateId))
|
|
115
|
+
return terminal("defect", "VALIDATION", "candidate ID must be a UUID");
|
|
116
|
+
const exchange = await this.client.get(call, input.candidateId);
|
|
117
|
+
if (exchange.error === "credential") return terminal("defect", "AUTHENTICATION", "Ashby credentials are unavailable or invalid");
|
|
118
|
+
if (exchange.error === "request") return retry("TRANSPORT", "Ashby request failed");
|
|
119
|
+
if (exchange.status === 429) return retry("RATE_LIMIT", "Ashby rate limited the request", exchange.retryAfterMs);
|
|
120
|
+
if (exchange.status === 408 || exchange.status >= 500) return retry("AVAILABILITY", "Ashby is temporarily unavailable", exchange.retryAfterMs);
|
|
121
|
+
if (exchange.status === 404) return terminal("notFound", "NOT_FOUND", "Ashby did not expose the candidate");
|
|
122
|
+
if (exchange.status !== 200) return terminal("providerRejected", "PROVIDER_REJECTION", `Ashby rejected HTTP ${exchange.status}`);
|
|
123
|
+
if (exchange.error === "tooLarge") return terminal("invalidResponse", "RESPONSE_TOO_LARGE", "Ashby response exceeded the configured limit");
|
|
124
|
+
const decoded = decodeCandidate(exchange.body, input.candidateId);
|
|
125
|
+
if (!decoded) return terminal("invalidResponse", "PROTOCOL", "Ashby returned invalid candidate JSON");
|
|
126
|
+
if ("errorCode" in decoded) return decoded.errorCode === "candidate_not_found" ? terminal("notFound", "NOT_FOUND", "Ashby did not expose the candidate") : terminal("providerRejected", "PROVIDER_REJECTION", "Ashby rejected the candidate lookup");
|
|
127
|
+
return newQueryBranch("found", decoded);
|
|
128
|
+
}
|
|
129
|
+
};
|
|
130
|
+
function isValidCandidateID(value) {
|
|
131
|
+
return typeof value === "string" && /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$/.test(value);
|
|
132
|
+
}
|
|
133
|
+
function emptyExchange(error) {
|
|
134
|
+
return { status: 0, body: new Uint8Array(), retryAfterMs: 0, error };
|
|
135
|
+
}
|
|
136
|
+
function failure(kind, message) {
|
|
137
|
+
return { provider: "ashby", operation: "getCandidate", kind, message };
|
|
138
|
+
}
|
|
139
|
+
function terminal(branch, kind, message) {
|
|
140
|
+
return newQueryBranch(branch, emptyCandidate(), {}, failure(kind, message));
|
|
141
|
+
}
|
|
142
|
+
function retry(kind, message, delay = 0) {
|
|
143
|
+
return newQueryRetry(failure(kind, message), delay);
|
|
144
|
+
}
|
|
145
|
+
function header(headers, name) {
|
|
146
|
+
const entry = Object.entries(headers).find(([key]) => key.toLowerCase() === name.toLowerCase())?.[1];
|
|
147
|
+
return Array.isArray(entry) ? entry[0] ?? "" : entry ?? "";
|
|
148
|
+
}
|
|
149
|
+
function isObject(value) {
|
|
150
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
151
|
+
}
|
|
152
|
+
function decodeCandidate(body, candidateID) {
|
|
153
|
+
let raw;
|
|
154
|
+
try {
|
|
155
|
+
raw = JSON.parse(Buffer.from(body).toString("utf8"));
|
|
156
|
+
} catch {
|
|
157
|
+
return void 0;
|
|
158
|
+
}
|
|
159
|
+
if (!isObject(raw) || typeof raw.success !== "boolean") return void 0;
|
|
160
|
+
if (!raw.success) return isObject(raw.errorInfo) && typeof raw.errorInfo.code === "string" && raw.errorInfo.code.trim() ? { errorCode: raw.errorInfo.code } : void 0;
|
|
161
|
+
if (!isObject(raw.results)) return void 0;
|
|
162
|
+
const data = raw.results;
|
|
163
|
+
if (typeof data.id !== "string" || data.id.toLowerCase() !== candidateID.toLowerCase() || typeof data.name !== "string" || !data.name.trim() || typeof data.createdAt !== "string" || !data.createdAt.trim() || typeof data.updatedAt !== "string" || !data.updatedAt.trim()) return void 0;
|
|
164
|
+
return { id: data.id, name: data.name, createdAt: data.createdAt, updatedAt: data.updatedAt };
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
// src/project.ts
|
|
168
|
+
function newProjectConnection2(project, connectionName) {
|
|
169
|
+
return newProjectConnection(project, connectionName, (loadedProject, name) => {
|
|
170
|
+
const selected = loadedProject.configuration.connections.find((entry) => entry.connectorId === "ashby" && entry.connectionName === name);
|
|
171
|
+
if (!selected) throw new TypeError("Ashby project connection is not configured");
|
|
172
|
+
const fields = z.strictObject({ baseUrl: z.string().optional(), timeout: z.union([z.string(), z.number().int()]).optional(), maxResponseBytes: z.number().int().optional() }).parse(selected.configuration);
|
|
173
|
+
const timeoutMs = typeof fields.timeout === "number" ? Math.ceil(fields.timeout / 1e6) : fields.timeout ? parseDurationMilliseconds(fields.timeout) : void 0;
|
|
174
|
+
const config = {
|
|
175
|
+
...fields.baseUrl ? { baseUrl: fields.baseUrl } : {},
|
|
176
|
+
...timeoutMs !== void 0 ? { timeoutMs } : {},
|
|
177
|
+
...fields.maxResponseBytes !== void 0 ? { maxResponseBytes: fields.maxResponseBytes } : {}
|
|
178
|
+
};
|
|
179
|
+
const credentials = {
|
|
180
|
+
async resolve(_call, signal) {
|
|
181
|
+
const privateFields = await loadedProject.resolveCredential("ashby", name, signal);
|
|
182
|
+
if (typeof privateFields.api_key !== "string") throw new TypeError("Ashby credentials are unavailable");
|
|
183
|
+
return { apiKey: new SecretString2(privateFields.api_key) };
|
|
184
|
+
}
|
|
185
|
+
};
|
|
186
|
+
return new AshbyClient(config, credentials);
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
function parseDurationMilliseconds(value) {
|
|
190
|
+
let remaining = value;
|
|
191
|
+
let milliseconds = 0;
|
|
192
|
+
const units = { ns: 1e-6, us: 1e-3, "\xB5s": 1e-3, ms: 1, s: 1e3, m: 6e4, h: 36e5 };
|
|
193
|
+
while (remaining) {
|
|
194
|
+
const part = /^(\d+(?:\.\d+)?)(ns|us|µs|ms|s|m|h)/.exec(remaining);
|
|
195
|
+
if (!part) throw new TypeError("Ashby timeout must be a positive Go duration");
|
|
196
|
+
milliseconds += Number(part[1]) * (units[part[2] ?? ""] ?? NaN);
|
|
197
|
+
remaining = remaining.slice(part[0].length);
|
|
198
|
+
}
|
|
199
|
+
if (!Number.isSafeInteger(milliseconds) || milliseconds <= 0) throw new TypeError("Ashby timeout must resolve to positive whole milliseconds");
|
|
200
|
+
return milliseconds;
|
|
201
|
+
}
|
|
202
|
+
export {
|
|
203
|
+
AshbyClient,
|
|
204
|
+
CandidateProfileSchema,
|
|
205
|
+
ConfigSchema,
|
|
206
|
+
Connection,
|
|
207
|
+
ConnectorID,
|
|
208
|
+
GetCandidateBranch,
|
|
209
|
+
GetCandidateBranchDefect,
|
|
210
|
+
GetCandidateBranchFound,
|
|
211
|
+
GetCandidateBranchInvalidResponse,
|
|
212
|
+
GetCandidateBranchNotFound,
|
|
213
|
+
GetCandidateBranchProviderRejected,
|
|
214
|
+
GetCandidateDefinition,
|
|
215
|
+
GetCandidateInputSchema,
|
|
216
|
+
GetCandidateMetadata,
|
|
217
|
+
GetCandidateOperation,
|
|
218
|
+
ProviderID,
|
|
219
|
+
decodeCredentials,
|
|
220
|
+
newConnection,
|
|
221
|
+
newConnectionWithOperations,
|
|
222
|
+
newGetCandidateStep,
|
|
223
|
+
newProjectConnection2 as newProjectConnection
|
|
224
|
+
};
|
package/dist/mock.d.ts
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { MockQuery, Case } from '@superdurable/connectors-sdk/connectormock';
|
|
2
|
+
import { Failure } from '@superdurable/connectors-sdk';
|
|
3
|
+
import { O as Operations, a as Connection, G as GetCandidateInput, C as CandidateProfile } from './connection-DrUeqnOI.js';
|
|
4
|
+
import 'zod';
|
|
5
|
+
|
|
6
|
+
/** Go zero value for GetCandidateInput in scripted cases. */
|
|
7
|
+
declare const emptyGetCandidateInput: GetCandidateInput;
|
|
8
|
+
/** Go zero value for CandidateProfile in scripted cases. */
|
|
9
|
+
declare const emptyCandidateProfile: CandidateProfile;
|
|
10
|
+
/** Script the found branch. */
|
|
11
|
+
declare function getCandidateFound(value: CandidateProfile, failure?: Failure): Case<CandidateProfile>;
|
|
12
|
+
/** Script the notFound branch. */
|
|
13
|
+
declare function getCandidateNotFound(value: CandidateProfile, failure?: Failure): Case<CandidateProfile>;
|
|
14
|
+
/** Script the providerRejected branch. */
|
|
15
|
+
declare function getCandidateProviderRejected(value: CandidateProfile, failure?: Failure): Case<CandidateProfile>;
|
|
16
|
+
/** Script the invalidResponse branch. */
|
|
17
|
+
declare function getCandidateInvalidResponse(value: CandidateProfile, failure?: Failure): Case<CandidateProfile>;
|
|
18
|
+
/** Script the defect branch. */
|
|
19
|
+
declare function getCandidateDefect(value: CandidateProfile, failure?: Failure): Case<CandidateProfile>;
|
|
20
|
+
/** Script a safe retry of getCandidate. */
|
|
21
|
+
declare function getCandidateRetry(failure: Failure, retryAfterMs?: number): Case<CandidateProfile>;
|
|
22
|
+
/** Manifest scenario foundDefault for getCandidate. */
|
|
23
|
+
declare function getCandidateFoundDefault(): Case<CandidateProfile>;
|
|
24
|
+
/** Default getCandidate scenario. */
|
|
25
|
+
declare function getCandidateDefault(): Case<CandidateProfile>;
|
|
26
|
+
/** Scripted operations and manifest defaults for this connector. */
|
|
27
|
+
declare class GeneratedMock implements Operations {
|
|
28
|
+
#private;
|
|
29
|
+
constructor(connectionName: string);
|
|
30
|
+
connection(): Connection;
|
|
31
|
+
getCandidate(): MockQuery<GetCandidateInput, CandidateProfile>;
|
|
32
|
+
assertNoFailures(): void;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export { GeneratedMock, GeneratedMock as Mock, emptyCandidateProfile, emptyGetCandidateInput, getCandidateDefault, getCandidateDefect, getCandidateFound, getCandidateFoundDefault, getCandidateInvalidResponse, getCandidateNotFound, getCandidateProviderRejected, getCandidateRetry };
|
package/dist/mock.js
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CandidateProfileSchema,
|
|
3
|
+
GetCandidateDefinition,
|
|
4
|
+
GetCandidateInputSchema,
|
|
5
|
+
ProviderID,
|
|
6
|
+
newConnectionWithOperations
|
|
7
|
+
} from "./chunk-6O5ADW6S.js";
|
|
8
|
+
|
|
9
|
+
// src/generated/mock.ts
|
|
10
|
+
import { branchCase, retryCase, newQuery } from "@superdurable/connectors-sdk/connectormock";
|
|
11
|
+
var emptyGetCandidateInput = GetCandidateInputSchema.parse({
|
|
12
|
+
"candidateId": ""
|
|
13
|
+
});
|
|
14
|
+
var emptyCandidateProfile = CandidateProfileSchema.parse({
|
|
15
|
+
"id": "",
|
|
16
|
+
"name": "",
|
|
17
|
+
"createdAt": "",
|
|
18
|
+
"updatedAt": ""
|
|
19
|
+
});
|
|
20
|
+
function getCandidateFound(value, failure) {
|
|
21
|
+
return branchCase("found", value, failure);
|
|
22
|
+
}
|
|
23
|
+
function getCandidateNotFound(value, failure) {
|
|
24
|
+
return branchCase("notFound", value, failure);
|
|
25
|
+
}
|
|
26
|
+
function getCandidateProviderRejected(value, failure) {
|
|
27
|
+
return branchCase("providerRejected", value, failure);
|
|
28
|
+
}
|
|
29
|
+
function getCandidateInvalidResponse(value, failure) {
|
|
30
|
+
return branchCase("invalidResponse", value, failure);
|
|
31
|
+
}
|
|
32
|
+
function getCandidateDefect(value, failure) {
|
|
33
|
+
return branchCase("defect", value, failure);
|
|
34
|
+
}
|
|
35
|
+
function getCandidateRetry(failure, retryAfterMs = 0) {
|
|
36
|
+
return retryCase(failure, retryAfterMs);
|
|
37
|
+
}
|
|
38
|
+
function getCandidateFoundDefault() {
|
|
39
|
+
const value = CandidateProfileSchema.parse({ "createdAt": "2024-01-15T10:30:00.000Z", "id": "e9ed20fd-d45f-4aad-8a00-a19bfba0083e", "name": "Example Candidate", "updatedAt": "2024-01-16T10:30:00.000Z" });
|
|
40
|
+
return branchCase("found", value);
|
|
41
|
+
}
|
|
42
|
+
function getCandidateDefault() {
|
|
43
|
+
return getCandidateFoundDefault();
|
|
44
|
+
}
|
|
45
|
+
var GeneratedMock = class {
|
|
46
|
+
#getCandidate;
|
|
47
|
+
#connection;
|
|
48
|
+
constructor(connectionName) {
|
|
49
|
+
this.#getCandidate = newQuery(GetCandidateDefinition).default(getCandidateDefault());
|
|
50
|
+
this.#connection = newConnectionWithOperations(this, { provider: ProviderID, name: connectionName });
|
|
51
|
+
}
|
|
52
|
+
connection() {
|
|
53
|
+
return this.#connection;
|
|
54
|
+
}
|
|
55
|
+
getCandidate() {
|
|
56
|
+
return this.#getCandidate;
|
|
57
|
+
}
|
|
58
|
+
assertNoFailures() {
|
|
59
|
+
this.#getCandidate.assertNoFailures();
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
export {
|
|
63
|
+
GeneratedMock,
|
|
64
|
+
GeneratedMock as Mock,
|
|
65
|
+
emptyCandidateProfile,
|
|
66
|
+
emptyGetCandidateInput,
|
|
67
|
+
getCandidateDefault,
|
|
68
|
+
getCandidateDefect,
|
|
69
|
+
getCandidateFound,
|
|
70
|
+
getCandidateFoundDefault,
|
|
71
|
+
getCandidateInvalidResponse,
|
|
72
|
+
getCandidateNotFound,
|
|
73
|
+
getCandidateProviderRejected,
|
|
74
|
+
getCandidateRetry
|
|
75
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,61 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@superdurable/connector-ashby",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"description": "
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"description": "Ashby connector for Dex TypeScript applications",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/superdurable/dex-connectors-library.git",
|
|
9
|
+
"directory": "connectors/ashby/typescript"
|
|
10
|
+
},
|
|
11
|
+
"type": "module",
|
|
12
|
+
"engines": {
|
|
13
|
+
"node": "^22.0.0 || ^24.0.0"
|
|
14
|
+
},
|
|
15
|
+
"module": "./dist/index.js",
|
|
16
|
+
"types": "./dist/index.d.ts",
|
|
17
|
+
"exports": {
|
|
18
|
+
".": {
|
|
19
|
+
"types": "./dist/index.d.ts",
|
|
20
|
+
"import": "./dist/index.js"
|
|
21
|
+
},
|
|
22
|
+
"./mock": {
|
|
23
|
+
"types": "./dist/mock.d.ts",
|
|
24
|
+
"import": "./dist/mock.js"
|
|
25
|
+
},
|
|
26
|
+
"./dex-connector.json": "./dex-connector.json"
|
|
27
|
+
},
|
|
28
|
+
"files": [
|
|
29
|
+
"dist",
|
|
30
|
+
"README.md",
|
|
31
|
+
"LICENSE",
|
|
32
|
+
"dex-connector.json"
|
|
33
|
+
],
|
|
34
|
+
"scripts": {
|
|
35
|
+
"prepack": "npm run build",
|
|
36
|
+
"build": "tsup src/index.ts src/mock.ts --format esm --dts --clean",
|
|
37
|
+
"typecheck": "tsc --noEmit",
|
|
38
|
+
"lint": "eslint src test examples",
|
|
39
|
+
"test": "vitest run --exclude test/integration/**",
|
|
40
|
+
"test:integration": "vitest run test/integration/*.integration.test.ts",
|
|
41
|
+
"example:worker": "tsx examples/candidate-inspection/worker.ts",
|
|
42
|
+
"example:start": "tsx examples/candidate-inspection/start.ts",
|
|
43
|
+
"check": "npm run typecheck && npm run lint && npm test && npm run build"
|
|
44
|
+
},
|
|
45
|
+
"dependencies": {
|
|
46
|
+
"@superdurable/connectors-sdk": "0.1.1",
|
|
47
|
+
"@superdurable/dex": ">=1.28.0",
|
|
48
|
+
"zod": "^4.1.0"
|
|
49
|
+
},
|
|
50
|
+
"devDependencies": {
|
|
51
|
+
"@eslint/js": "^9.0.0",
|
|
52
|
+
"@types/node": "^22.0.0",
|
|
53
|
+
"eslint": "^9.0.0",
|
|
54
|
+
"tsup": "^8.0.0",
|
|
55
|
+
"tsx": "^4.23.15",
|
|
56
|
+
"typescript": "^5.9.0",
|
|
57
|
+
"typescript-eslint": "^8.0.0",
|
|
58
|
+
"vitest": "^3.0.0",
|
|
59
|
+
"yaml": "^2.9.1"
|
|
60
|
+
}
|
|
61
|
+
}
|