@parmana/connector-sdk 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/README.md +117 -0
- package/dist/ConnectorFactory.d.ts +15 -0
- package/dist/ConnectorFactory.d.ts.map +1 -0
- package/dist/ConnectorFactory.js +2 -0
- package/dist/ConnectorFactory.js.map +1 -0
- package/dist/ConnectorMetadata.d.ts +34 -0
- package/dist/ConnectorMetadata.d.ts.map +1 -0
- package/dist/ConnectorMetadata.js +10 -0
- package/dist/ConnectorMetadata.js.map +1 -0
- package/dist/ConnectorTypes.d.ts +80 -0
- package/dist/ConnectorTypes.d.ts.map +1 -0
- package/dist/ConnectorTypes.js +17 -0
- package/dist/ConnectorTypes.js.map +1 -0
- package/dist/CredentialProvider.d.ts +70 -0
- package/dist/CredentialProvider.d.ts.map +1 -0
- package/dist/CredentialProvider.js +88 -0
- package/dist/CredentialProvider.js.map +1 -0
- package/dist/MockConnector.d.ts +29 -0
- package/dist/MockConnector.d.ts.map +1 -0
- package/dist/MockConnector.js +35 -0
- package/dist/MockConnector.js.map +1 -0
- package/dist/connectors/oracle/OracleConnector.d.ts +9 -0
- package/dist/connectors/oracle/OracleConnector.d.ts.map +1 -0
- package/dist/connectors/oracle/OracleConnector.js +15 -0
- package/dist/connectors/oracle/OracleConnector.js.map +1 -0
- package/dist/connectors/oracle/OracleMetadata.d.ts +9 -0
- package/dist/connectors/oracle/OracleMetadata.d.ts.map +1 -0
- package/dist/connectors/oracle/OracleMetadata.js +19 -0
- package/dist/connectors/oracle/OracleMetadata.js.map +1 -0
- package/dist/connectors/oracle/index.d.ts +6 -0
- package/dist/connectors/oracle/index.d.ts.map +1 -0
- package/dist/connectors/oracle/index.js +6 -0
- package/dist/connectors/oracle/index.js.map +1 -0
- package/dist/connectors/salesforce/SalesforceConnector.d.ts +9 -0
- package/dist/connectors/salesforce/SalesforceConnector.d.ts.map +1 -0
- package/dist/connectors/salesforce/SalesforceConnector.js +15 -0
- package/dist/connectors/salesforce/SalesforceConnector.js.map +1 -0
- package/dist/connectors/salesforce/SalesforceMetadata.d.ts +9 -0
- package/dist/connectors/salesforce/SalesforceMetadata.d.ts.map +1 -0
- package/dist/connectors/salesforce/SalesforceMetadata.js +19 -0
- package/dist/connectors/salesforce/SalesforceMetadata.js.map +1 -0
- package/dist/connectors/salesforce/index.d.ts +6 -0
- package/dist/connectors/salesforce/index.d.ts.map +1 -0
- package/dist/connectors/salesforce/index.js +6 -0
- package/dist/connectors/salesforce/index.js.map +1 -0
- package/dist/connectors/sap/SapConnector.d.ts +9 -0
- package/dist/connectors/sap/SapConnector.d.ts.map +1 -0
- package/dist/connectors/sap/SapConnector.js +15 -0
- package/dist/connectors/sap/SapConnector.js.map +1 -0
- package/dist/connectors/sap/SapMetadata.d.ts +9 -0
- package/dist/connectors/sap/SapMetadata.d.ts.map +1 -0
- package/dist/connectors/sap/SapMetadata.js +19 -0
- package/dist/connectors/sap/SapMetadata.js.map +1 -0
- package/dist/connectors/sap/index.d.ts +6 -0
- package/dist/connectors/sap/index.d.ts.map +1 -0
- package/dist/connectors/sap/index.js +6 -0
- package/dist/connectors/sap/index.js.map +1 -0
- package/dist/connectors/workday/WorkdayConnector.d.ts +9 -0
- package/dist/connectors/workday/WorkdayConnector.d.ts.map +1 -0
- package/dist/connectors/workday/WorkdayConnector.js +15 -0
- package/dist/connectors/workday/WorkdayConnector.js.map +1 -0
- package/dist/connectors/workday/WorkdayMetadata.d.ts +9 -0
- package/dist/connectors/workday/WorkdayMetadata.d.ts.map +1 -0
- package/dist/connectors/workday/WorkdayMetadata.js +19 -0
- package/dist/connectors/workday/WorkdayMetadata.js.map +1 -0
- package/dist/connectors/workday/index.d.ts +6 -0
- package/dist/connectors/workday/index.d.ts.map +1 -0
- package/dist/connectors/workday/index.js +6 -0
- package/dist/connectors/workday/index.js.map +1 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +25 -0
- package/dist/index.js.map +1 -0
- package/package.json +54 -0
package/README.md
ADDED
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
# @parmana/connector-sdk
|
|
2
|
+
|
|
3
|
+
Contracts and reference implementations for building a Connector for [Parmana](https://github.com/pavancharak/parmana), the authorization layer for AI execution.
|
|
4
|
+
|
|
5
|
+
A Connector is the last hop in Parmana's pipeline: it receives an already-authorized, already-verified request and carries it out against a real system (an API, a database, anything). A Connector never evaluates policy, never authorizes execution, and never resolves its own credentials — it only executes, using a credential Parmana has already resolved for it.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install @parmana/connector-sdk
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## The contract
|
|
14
|
+
|
|
15
|
+
Every Connector implements one interface:
|
|
16
|
+
|
|
17
|
+
```typescript
|
|
18
|
+
import type {
|
|
19
|
+
Connector,
|
|
20
|
+
ConnectorRequest,
|
|
21
|
+
ConnectorExecutionContext,
|
|
22
|
+
ConnectorResponse,
|
|
23
|
+
} from "@parmana/connector-sdk";
|
|
24
|
+
|
|
25
|
+
class MyConnector implements Connector {
|
|
26
|
+
readonly connectorId = "my-service";
|
|
27
|
+
readonly capabilities = connectorCapabilities(["my-service:do-thing"]);
|
|
28
|
+
|
|
29
|
+
async execute(
|
|
30
|
+
request: ConnectorRequest,
|
|
31
|
+
context: ConnectorExecutionContext,
|
|
32
|
+
): Promise<ConnectorResponse> {
|
|
33
|
+
// request.parameters is exactly what was authorized -- never re-derive it.
|
|
34
|
+
// context.credential is an opaque, already-resolved CredentialHandle.
|
|
35
|
+
// context.timeoutMs is how long you have.
|
|
36
|
+
return { success: true, metadata: {} };
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
`capabilities` must be namespaced verbs (`"namespace:verb"`, e.g. `"crm:update-contact"`), validated eagerly by `connectorCapabilities()` so a malformed capability fails at construction, not mid-execution.
|
|
42
|
+
|
|
43
|
+
## One reference implementation, for testing
|
|
44
|
+
|
|
45
|
+
`MockConnector` gives you scripted responses or failure injection, and records every request
|
|
46
|
+
it receives, so you can test your own Connector's callers without standing up a real endpoint:
|
|
47
|
+
|
|
48
|
+
```typescript
|
|
49
|
+
import { MockConnector, connectorCapabilities } from "@parmana/connector-sdk";
|
|
50
|
+
|
|
51
|
+
const connector = new MockConnector({
|
|
52
|
+
connectorId: "billing",
|
|
53
|
+
capabilities: connectorCapabilities(["billing:issue-refund"]),
|
|
54
|
+
script: { respond: () => ({ success: true, metadata: { refundId: "r_1" } }) },
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
await connector.execute(request, context);
|
|
58
|
+
connector.invocations; // every request it received, for assertions
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
This package intentionally ships no HTTP-calling reference implementation — only the contract
|
|
62
|
+
and the hermetic mock above. A REST-shaped connector is usually this simple to write directly
|
|
63
|
+
against the contract:
|
|
64
|
+
|
|
65
|
+
```typescript
|
|
66
|
+
import type {
|
|
67
|
+
Connector,
|
|
68
|
+
ConnectorRequest,
|
|
69
|
+
ConnectorExecutionContext,
|
|
70
|
+
ConnectorResponse,
|
|
71
|
+
} from "@parmana/connector-sdk";
|
|
72
|
+
import { connectorCapabilities } from "@parmana/connector-sdk";
|
|
73
|
+
|
|
74
|
+
class BillingConnector implements Connector {
|
|
75
|
+
readonly connectorId = "billing";
|
|
76
|
+
readonly capabilities = connectorCapabilities(["billing:issue-refund"]);
|
|
77
|
+
|
|
78
|
+
constructor(private readonly baseUrl: string) {}
|
|
79
|
+
|
|
80
|
+
async execute(
|
|
81
|
+
request: ConnectorRequest,
|
|
82
|
+
context: ConnectorExecutionContext,
|
|
83
|
+
): Promise<ConnectorResponse> {
|
|
84
|
+
const token = context.credential.value; // shape is whatever your CredentialProvider resolved
|
|
85
|
+
const controller = new AbortController();
|
|
86
|
+
const timer = setTimeout(() => controller.abort(), context.timeoutMs);
|
|
87
|
+
|
|
88
|
+
try {
|
|
89
|
+
const response = await fetch(`${this.baseUrl}/${request.action}`, {
|
|
90
|
+
method: "POST",
|
|
91
|
+
headers: {
|
|
92
|
+
Authorization: `Bearer ${token}`,
|
|
93
|
+
"Content-Type": "application/json",
|
|
94
|
+
},
|
|
95
|
+
body: JSON.stringify(request.parameters),
|
|
96
|
+
signal: controller.signal,
|
|
97
|
+
});
|
|
98
|
+
if (!response.ok) throw new Error(`HTTP ${response.status}`);
|
|
99
|
+
return { success: true, metadata: await response.json() };
|
|
100
|
+
} finally {
|
|
101
|
+
clearTimeout(timer);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
## Four worked examples
|
|
108
|
+
|
|
109
|
+
`src/connectors/{oracle,salesforce,sap,workday}` are deterministic `MockConnector`s shaped like a real enterprise integration — each declares one realistic capability and nothing else. They are explicit mocks, not real integrations; read them as a template for structuring your own connector's capability and metadata, not as something to call in production.
|
|
110
|
+
|
|
111
|
+
## Credentials
|
|
112
|
+
|
|
113
|
+
A Connector never resolves its own credentials. `CredentialProvider` is the seam Parmana's Execution Gateway uses upstream of a Connector — `EnvironmentCredentialProvider` (reads a mapped env var) and `StaticCredentialProvider` (in-memory, for tests) are the two provided implementations.
|
|
114
|
+
|
|
115
|
+
## Full reference
|
|
116
|
+
|
|
117
|
+
See the [Connector SDK reference](https://docs.parmanasystems.com/reference/connector-sdk) and the [Connector Development Guide](https://docs.parmanasystems.com/integrations/connector-development-guide).
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Connector } from "./ConnectorTypes.js";
|
|
2
|
+
/**
|
|
3
|
+
* Constructs a Connector from configuration.
|
|
4
|
+
*
|
|
5
|
+
* Future connectors (Stripe, GitHub, Salesforce, SAP, ServiceNow, Workday,
|
|
6
|
+
* Slack, Jira, Database — all [FUTURE]) implement this interface. No
|
|
7
|
+
* concrete enterprise factory is implemented in this milestone; only the
|
|
8
|
+
* seam is defined so those connectors have a single, consistent
|
|
9
|
+
* construction contract to target.
|
|
10
|
+
*/
|
|
11
|
+
export interface ConnectorFactory<TConfig = unknown> {
|
|
12
|
+
readonly connectorType: string;
|
|
13
|
+
create(config: TConfig): Connector;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=ConnectorFactory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConnectorFactory.d.ts","sourceRoot":"","sources":["../src/ConnectorFactory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAErD;;;;;;;;GAQG;AACH,MAAM,WAAW,gBAAgB,CAAC,OAAO,GAAG,OAAO;IACjD,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,MAAM,CAAC,MAAM,EAAE,OAAO,GAAG,SAAS,CAAC;CACpC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConnectorFactory.js","sourceRoot":"","sources":["../src/ConnectorFactory.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Semantic connector version.
|
|
3
|
+
*/
|
|
4
|
+
export interface ConnectorVersion {
|
|
5
|
+
readonly major: number;
|
|
6
|
+
readonly minor: number;
|
|
7
|
+
readonly patch: number;
|
|
8
|
+
}
|
|
9
|
+
export declare function formatConnectorVersion(version: ConnectorVersion): string;
|
|
10
|
+
export declare function connectorVersionsEqual(a: ConnectorVersion, b: ConnectorVersion): boolean;
|
|
11
|
+
export type ConnectorHealthStatus = "healthy" | "degraded" | "unavailable";
|
|
12
|
+
/**
|
|
13
|
+
* Point-in-time connector health.
|
|
14
|
+
*
|
|
15
|
+
* Purely descriptive/self-reported by the connector author at registration
|
|
16
|
+
* time in this milestone — there is no background health-check poller.
|
|
17
|
+
*/
|
|
18
|
+
export interface ConnectorHealth {
|
|
19
|
+
readonly status: ConnectorHealthStatus;
|
|
20
|
+
readonly checkedAt: string;
|
|
21
|
+
readonly reason?: string;
|
|
22
|
+
}
|
|
23
|
+
export declare function healthyNow(): ConnectorHealth;
|
|
24
|
+
/**
|
|
25
|
+
* Descriptive metadata about a registered connector.
|
|
26
|
+
*/
|
|
27
|
+
export interface ConnectorMetadata {
|
|
28
|
+
readonly connectorId: string;
|
|
29
|
+
readonly displayName: string;
|
|
30
|
+
readonly version: ConnectorVersion;
|
|
31
|
+
readonly health: ConnectorHealth;
|
|
32
|
+
readonly description?: string;
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=ConnectorMetadata.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConnectorMetadata.d.ts","sourceRoot":"","sources":["../src/ConnectorMetadata.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,gBAAgB,GAAG,MAAM,CAExE;AAED,wBAAgB,sBAAsB,CACpC,CAAC,EAAE,gBAAgB,EACnB,CAAC,EAAE,gBAAgB,GAClB,OAAO,CAET;AAED,MAAM,MAAM,qBAAqB,GAAG,SAAS,GAAG,UAAU,GAAG,aAAa,CAAC;AAE3E;;;;;GAKG;AACH,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,MAAM,EAAE,qBAAqB,CAAC;IACvC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,wBAAgB,UAAU,IAAI,eAAe,CAE5C;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,OAAO,EAAE,gBAAgB,CAAC;IACnC,QAAQ,CAAC,MAAM,EAAE,eAAe,CAAC;IACjC,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;CAC/B"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export function formatConnectorVersion(version) {
|
|
2
|
+
return `${version.major}.${version.minor}.${version.patch}`;
|
|
3
|
+
}
|
|
4
|
+
export function connectorVersionsEqual(a, b) {
|
|
5
|
+
return a.major === b.major && a.minor === b.minor && a.patch === b.patch;
|
|
6
|
+
}
|
|
7
|
+
export function healthyNow() {
|
|
8
|
+
return { status: "healthy", checkedAt: new Date().toISOString() };
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=ConnectorMetadata.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConnectorMetadata.js","sourceRoot":"","sources":["../src/ConnectorMetadata.ts"],"names":[],"mappings":"AASA,MAAM,UAAU,sBAAsB,CAAC,OAAyB;IAC9D,OAAO,GAAG,OAAO,CAAC,KAAK,IAAI,OAAO,CAAC,KAAK,IAAI,OAAO,CAAC,KAAK,EAAE,CAAC;AAC9D,CAAC;AAED,MAAM,UAAU,sBAAsB,CACpC,CAAmB,EACnB,CAAmB;IAEnB,OAAO,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,KAAK,CAAC;AAC3E,CAAC;AAgBD,MAAM,UAAU,UAAU;IACxB,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,EAAE,CAAC;AACpE,CAAC"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import type { CredentialHandle } from "./CredentialProvider.js";
|
|
2
|
+
/**
|
|
3
|
+
* Namespaced verb capability, e.g. "http:get", "crm:read", "payments:refund".
|
|
4
|
+
*
|
|
5
|
+
* By convention in this SDK, ExecutableContent.action IS the capability
|
|
6
|
+
* string — this is what execution-control's DefaultConnectorPolicy already
|
|
7
|
+
* checks (`connector.capabilities.includes(request.executableContent.action)`).
|
|
8
|
+
* Namespacing is enforced by isNamespacedCapability, not by a new type.
|
|
9
|
+
*/
|
|
10
|
+
export type ConnectorCapability = string;
|
|
11
|
+
export declare function isNamespacedCapability(value: string): boolean;
|
|
12
|
+
/**
|
|
13
|
+
* A connector's declared, namespaced capabilities.
|
|
14
|
+
*
|
|
15
|
+
* Validates namespacing eagerly so a malformed capability (e.g. a bare
|
|
16
|
+
* action instead of a namespaced verb) fails at connector construction
|
|
17
|
+
* time, not at execution time.
|
|
18
|
+
*/
|
|
19
|
+
export interface ConnectorCapabilities {
|
|
20
|
+
readonly declared: readonly ConnectorCapability[];
|
|
21
|
+
includes(capability: ConnectorCapability): boolean;
|
|
22
|
+
}
|
|
23
|
+
export declare function connectorCapabilities(declared: readonly ConnectorCapability[]): ConnectorCapabilities;
|
|
24
|
+
/**
|
|
25
|
+
* Request handed to a Connector by SdkConnectorExecutor.
|
|
26
|
+
*
|
|
27
|
+
* Derived, field for field, from the Gateway-verified ExecutableContent —
|
|
28
|
+
* never re-derived or re-interpreted. Connectors receive exactly the
|
|
29
|
+
* authorized operation, resource, and parameters.
|
|
30
|
+
*/
|
|
31
|
+
export interface ConnectorRequest {
|
|
32
|
+
readonly capability: ConnectorCapability;
|
|
33
|
+
readonly businessTransactionId: string;
|
|
34
|
+
readonly action: string;
|
|
35
|
+
readonly target: string;
|
|
36
|
+
readonly parameters: Readonly<Record<string, unknown>>;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Deterministic result returned by a Connector.
|
|
40
|
+
*
|
|
41
|
+
* `metadata` is connector-specific evidence merged into ConnectorEvidence's
|
|
42
|
+
* responseSummary (subject to redaction — see ConnectorEvidence.ts). It must
|
|
43
|
+
* never contain credential material.
|
|
44
|
+
*/
|
|
45
|
+
export interface ConnectorResponse {
|
|
46
|
+
readonly success: boolean;
|
|
47
|
+
readonly metadata?: Readonly<Record<string, unknown>>;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Execution context supplied to a Connector alongside a ConnectorRequest.
|
|
51
|
+
*
|
|
52
|
+
* `credential` is an opaque, already-resolved CredentialHandle — credential
|
|
53
|
+
* resolution has already happened inside the Execution Gateway by the time a
|
|
54
|
+
* Connector sees this context. Connectors never resolve credentials
|
|
55
|
+
* themselves.
|
|
56
|
+
*/
|
|
57
|
+
export interface ConnectorExecutionContext {
|
|
58
|
+
readonly credential: CredentialHandle;
|
|
59
|
+
readonly timeoutMs: number;
|
|
60
|
+
readonly requestedAt: Date;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Canonical Connector contract for the Connector SDK.
|
|
64
|
+
*
|
|
65
|
+
* Connectors NEVER evaluate policy, authorize execution, interpret AI
|
|
66
|
+
* output, perform business decisions, or resolve credentials. They ONLY
|
|
67
|
+
* validate requests, execute operations using an already-resolved
|
|
68
|
+
* credential, and return a deterministic response.
|
|
69
|
+
*
|
|
70
|
+
* A Connector never receives a request directly from the Runtime or AI —
|
|
71
|
+
* only from SdkConnectorExecutor, itself only reachable through
|
|
72
|
+
* execution-control's SecureConnector, itself only reachable through the
|
|
73
|
+
* Execution Gateway.
|
|
74
|
+
*/
|
|
75
|
+
export interface Connector {
|
|
76
|
+
readonly connectorId: string;
|
|
77
|
+
readonly capabilities: ConnectorCapabilities;
|
|
78
|
+
execute(request: ConnectorRequest, context: ConnectorExecutionContext): Promise<ConnectorResponse>;
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=ConnectorTypes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConnectorTypes.d.ts","sourceRoot":"","sources":["../src/ConnectorTypes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAEhE;;;;;;;GAOG;AACH,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAC;AAKzC,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAE7D;AAED;;;;;;GAMG;AACH,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,QAAQ,EAAE,SAAS,mBAAmB,EAAE,CAAC;IAClD,QAAQ,CAAC,UAAU,EAAE,mBAAmB,GAAG,OAAO,CAAC;CACpD;AAED,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,SAAS,mBAAmB,EAAE,GACvC,qBAAqB,CAcvB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,UAAU,EAAE,mBAAmB,CAAC;IACzC,QAAQ,CAAC,qBAAqB,EAAE,MAAM,CAAC;IACvC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CACxD;AAED;;;;;;GAMG;AACH,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CACvD;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,yBAAyB;IACxC,QAAQ,CAAC,UAAU,EAAE,gBAAgB,CAAC;IACtC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,WAAW,EAAE,IAAI,CAAC;CAC5B;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,YAAY,EAAE,qBAAqB,CAAC;IAC7C,OAAO,CACL,OAAO,EAAE,gBAAgB,EACzB,OAAO,EAAE,yBAAyB,GACjC,OAAO,CAAC,iBAAiB,CAAC,CAAC;CAC/B"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
const NAMESPACED_CAPABILITY_PATTERN = /^[a-z][a-z0-9]*(?:[-_][a-z0-9]+)*:[a-z][a-z0-9]*(?:[-_][a-z0-9]+)*$/;
|
|
2
|
+
export function isNamespacedCapability(value) {
|
|
3
|
+
return NAMESPACED_CAPABILITY_PATTERN.test(value);
|
|
4
|
+
}
|
|
5
|
+
export function connectorCapabilities(declared) {
|
|
6
|
+
for (const capability of declared) {
|
|
7
|
+
if (!isNamespacedCapability(capability)) {
|
|
8
|
+
throw new Error(`Connector capability must be a namespaced verb (e.g. "http:get"): "${capability}".`);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
const frozen = Object.freeze([...declared]);
|
|
12
|
+
return Object.freeze({
|
|
13
|
+
declared: frozen,
|
|
14
|
+
includes: (capability) => frozen.includes(capability),
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=ConnectorTypes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConnectorTypes.js","sourceRoot":"","sources":["../src/ConnectorTypes.ts"],"names":[],"mappings":"AAYA,MAAM,6BAA6B,GACjC,qEAAqE,CAAC;AAExE,MAAM,UAAU,sBAAsB,CAAC,KAAa;IAClD,OAAO,6BAA6B,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AACnD,CAAC;AAcD,MAAM,UAAU,qBAAqB,CACnC,QAAwC;IAExC,KAAK,MAAM,UAAU,IAAI,QAAQ,EAAE,CAAC;QAClC,IAAI,CAAC,sBAAsB,CAAC,UAAU,CAAC,EAAE,CAAC;YACxC,MAAM,IAAI,KAAK,CACb,sEAAsE,UAAU,IAAI,CACrF,CAAC;QACJ,CAAC;IACH,CAAC;IACD,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC;IAC5C,OAAO,MAAM,CAAC,MAAM,CAAC;QACnB,QAAQ,EAAE,MAAM;QAChB,QAAQ,EAAE,CAAC,UAA+B,EAAW,EAAE,CACrD,MAAM,CAAC,QAAQ,CAAC,UAAU,CAAC;KAC9B,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Credential resolution seam.
|
|
3
|
+
*
|
|
4
|
+
* Credential resolution happens exclusively inside the Execution Gateway
|
|
5
|
+
* (via a CredentialVault backed by one of these providers). Connectors never
|
|
6
|
+
* resolve, retrieve, discover, or store credentials themselves — they only
|
|
7
|
+
* ever receive an opaque, already-resolved CredentialHandle.
|
|
8
|
+
*
|
|
9
|
+
* This file defines the interface seam for future providers (HashiCorp
|
|
10
|
+
* Vault, AWS Secrets Manager, Azure Key Vault, Google Secret Manager). Only
|
|
11
|
+
* the seam is defined here; no cloud SDK integration is implemented.
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* Opaque credential material resolved by a CredentialProvider.
|
|
15
|
+
*
|
|
16
|
+
* `value` is never logged, never included in ConnectorEvidence, and never
|
|
17
|
+
* serialized into an Execution Trust Record. It exists only to be read,
|
|
18
|
+
* ephemerally, by a Connector's own execution call (e.g. an HTTP header).
|
|
19
|
+
*/
|
|
20
|
+
export interface CredentialHandle {
|
|
21
|
+
readonly providerId: string;
|
|
22
|
+
readonly credentialId: string;
|
|
23
|
+
readonly value: unknown;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Marks a CredentialHandle as having been produced by a CredentialProvider,
|
|
27
|
+
* as opposed to a raw value supplied directly by a caller. SdkConnectorExecutor
|
|
28
|
+
* rejects any credential that is not branded this way, closing the "raw
|
|
29
|
+
* credential supplied" gap the Gateway must fail closed on.
|
|
30
|
+
*/
|
|
31
|
+
export declare function brandCredentialHandle(handle: CredentialHandle): CredentialHandle;
|
|
32
|
+
export declare function isCredentialHandle(value: unknown): value is CredentialHandle;
|
|
33
|
+
/**
|
|
34
|
+
* Resolves opaque credential material for a connector.
|
|
35
|
+
*
|
|
36
|
+
* Implementations MUST NOT throw errors that embed the resolved secret
|
|
37
|
+
* value — only identifiers (connectorId, providerId, credentialId) may
|
|
38
|
+
* appear in error messages.
|
|
39
|
+
*/
|
|
40
|
+
export interface CredentialProvider {
|
|
41
|
+
readonly providerId: string;
|
|
42
|
+
resolve(connectorId: string): Promise<CredentialHandle>;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Resolves credentials from process environment variables.
|
|
46
|
+
*
|
|
47
|
+
* [FUTURE]: HashiCorp Vault, AWS Secrets Manager, Azure Key Vault, and
|
|
48
|
+
* Google Secret Manager providers will implement the same CredentialProvider
|
|
49
|
+
* interface. None are implemented in this milestone.
|
|
50
|
+
*/
|
|
51
|
+
export declare class EnvironmentCredentialProvider implements CredentialProvider {
|
|
52
|
+
private readonly connectorEnvironmentVariable;
|
|
53
|
+
private readonly environment;
|
|
54
|
+
readonly providerId = "environment";
|
|
55
|
+
constructor(connectorEnvironmentVariable: Readonly<Record<string, string>>, environment?: Readonly<Record<string, string | undefined>>);
|
|
56
|
+
resolve(connectorId: string): Promise<CredentialHandle>;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Resolves credentials from an in-memory map.
|
|
60
|
+
*
|
|
61
|
+
* Intended for hermetic tests and local development only.
|
|
62
|
+
*/
|
|
63
|
+
export declare class StaticCredentialProvider implements CredentialProvider {
|
|
64
|
+
readonly providerId = "static";
|
|
65
|
+
private readonly credentials;
|
|
66
|
+
constructor(entries?: Readonly<Record<string, unknown>>);
|
|
67
|
+
set(connectorId: string, value: unknown): void;
|
|
68
|
+
resolve(connectorId: string): Promise<CredentialHandle>;
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=CredentialProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CredentialProvider.d.ts","sourceRoot":"","sources":["../src/CredentialProvider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAMH;;;;;;GAMG;AACH,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;CACzB;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,gBAAgB,GACvB,gBAAgB,CAIlB;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,gBAAgB,CAG5E;AAED;;;;;;GAMG;AACH,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,OAAO,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;CACzD;AAED;;;;;;GAMG;AACH,qBAAa,6BAA8B,YAAW,kBAAkB;IAIpE,OAAO,CAAC,QAAQ,CAAC,4BAA4B;IAG7C,OAAO,CAAC,QAAQ,CAAC,WAAW;IAN9B,QAAQ,CAAC,UAAU,iBAAiB;gBAGjB,4BAA4B,EAAE,QAAQ,CACrD,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CACvB,EACgB,WAAW,GAAE,QAAQ,CACpC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CACrB;IAGX,OAAO,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC;CAmB9D;AAED;;;;GAIG;AACH,qBAAa,wBAAyB,YAAW,kBAAkB;IACjE,QAAQ,CAAC,UAAU,YAAY;IAE/B,OAAO,CAAC,QAAQ,CAAC,WAAW,CAA8B;gBAE9C,OAAO,GAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAM;IAM3D,GAAG,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI;IAIxC,OAAO,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC;CAY9D"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Credential resolution seam.
|
|
3
|
+
*
|
|
4
|
+
* Credential resolution happens exclusively inside the Execution Gateway
|
|
5
|
+
* (via a CredentialVault backed by one of these providers). Connectors never
|
|
6
|
+
* resolve, retrieve, discover, or store credentials themselves — they only
|
|
7
|
+
* ever receive an opaque, already-resolved CredentialHandle.
|
|
8
|
+
*
|
|
9
|
+
* This file defines the interface seam for future providers (HashiCorp
|
|
10
|
+
* Vault, AWS Secrets Manager, Azure Key Vault, Google Secret Manager). Only
|
|
11
|
+
* the seam is defined here; no cloud SDK integration is implemented.
|
|
12
|
+
*/
|
|
13
|
+
const CREDENTIAL_HANDLE_BRAND = Symbol("parmana.connector-sdk.credential-handle");
|
|
14
|
+
/**
|
|
15
|
+
* Marks a CredentialHandle as having been produced by a CredentialProvider,
|
|
16
|
+
* as opposed to a raw value supplied directly by a caller. SdkConnectorExecutor
|
|
17
|
+
* rejects any credential that is not branded this way, closing the "raw
|
|
18
|
+
* credential supplied" gap the Gateway must fail closed on.
|
|
19
|
+
*/
|
|
20
|
+
export function brandCredentialHandle(handle) {
|
|
21
|
+
const branded = { ...handle };
|
|
22
|
+
branded[CREDENTIAL_HANDLE_BRAND] = true;
|
|
23
|
+
return Object.freeze(branded);
|
|
24
|
+
}
|
|
25
|
+
export function isCredentialHandle(value) {
|
|
26
|
+
if (typeof value !== "object" || value === null)
|
|
27
|
+
return false;
|
|
28
|
+
return value[CREDENTIAL_HANDLE_BRAND] === true;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Resolves credentials from process environment variables.
|
|
32
|
+
*
|
|
33
|
+
* [FUTURE]: HashiCorp Vault, AWS Secrets Manager, Azure Key Vault, and
|
|
34
|
+
* Google Secret Manager providers will implement the same CredentialProvider
|
|
35
|
+
* interface. None are implemented in this milestone.
|
|
36
|
+
*/
|
|
37
|
+
export class EnvironmentCredentialProvider {
|
|
38
|
+
connectorEnvironmentVariable;
|
|
39
|
+
environment;
|
|
40
|
+
providerId = "environment";
|
|
41
|
+
constructor(connectorEnvironmentVariable, environment = process.env) {
|
|
42
|
+
this.connectorEnvironmentVariable = connectorEnvironmentVariable;
|
|
43
|
+
this.environment = environment;
|
|
44
|
+
}
|
|
45
|
+
async resolve(connectorId) {
|
|
46
|
+
const variableName = this.connectorEnvironmentVariable[connectorId];
|
|
47
|
+
if (variableName === undefined) {
|
|
48
|
+
throw new Error(`No environment credential mapping configured for connector: ${connectorId}.`);
|
|
49
|
+
}
|
|
50
|
+
const value = this.environment[variableName];
|
|
51
|
+
if (value === undefined) {
|
|
52
|
+
throw new Error(`Environment variable "${variableName}" for connector "${connectorId}" is not set.`);
|
|
53
|
+
}
|
|
54
|
+
return brandCredentialHandle({
|
|
55
|
+
providerId: this.providerId,
|
|
56
|
+
credentialId: variableName,
|
|
57
|
+
value: Object.freeze({ token: value }),
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Resolves credentials from an in-memory map.
|
|
63
|
+
*
|
|
64
|
+
* Intended for hermetic tests and local development only.
|
|
65
|
+
*/
|
|
66
|
+
export class StaticCredentialProvider {
|
|
67
|
+
providerId = "static";
|
|
68
|
+
credentials = new Map();
|
|
69
|
+
constructor(entries = {}) {
|
|
70
|
+
for (const [connectorId, value] of Object.entries(entries)) {
|
|
71
|
+
this.credentials.set(connectorId, value);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
set(connectorId, value) {
|
|
75
|
+
this.credentials.set(connectorId, value);
|
|
76
|
+
}
|
|
77
|
+
async resolve(connectorId) {
|
|
78
|
+
if (!this.credentials.has(connectorId)) {
|
|
79
|
+
throw new Error(`No static credential configured for connector: ${connectorId}.`);
|
|
80
|
+
}
|
|
81
|
+
return brandCredentialHandle({
|
|
82
|
+
providerId: this.providerId,
|
|
83
|
+
credentialId: connectorId,
|
|
84
|
+
value: this.credentials.get(connectorId),
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
//# sourceMappingURL=CredentialProvider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CredentialProvider.js","sourceRoot":"","sources":["../src/CredentialProvider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,MAAM,uBAAuB,GAAG,MAAM,CACpC,yCAAyC,CAC1C,CAAC;AAeF;;;;;GAKG;AACH,MAAM,UAAU,qBAAqB,CACnC,MAAwB;IAExB,MAAM,OAAO,GAAG,EAAE,GAAG,MAAM,EAAgD,CAAC;IAC5E,OAAO,CAAC,uBAAuB,CAAC,GAAG,IAAI,CAAC;IACxC,OAAO,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;AAChC,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,KAAc;IAC/C,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,KAAK,CAAC;IAC9D,OAAQ,KAAiC,CAAC,uBAAuB,CAAC,KAAK,IAAI,CAAC;AAC9E,CAAC;AAcD;;;;;;GAMG;AACH,MAAM,OAAO,6BAA6B;IAIrB;IAGA;IANV,UAAU,GAAG,aAAa,CAAC;IAEpC,YACmB,4BAEhB,EACgB,cAEb,OAAO,CAAC,GAAG;QALE,iCAA4B,GAA5B,4BAA4B,CAE5C;QACgB,gBAAW,GAAX,WAAW,CAEb;IACd,CAAC;IAEJ,KAAK,CAAC,OAAO,CAAC,WAAmB;QAC/B,MAAM,YAAY,GAAG,IAAI,CAAC,4BAA4B,CAAC,WAAW,CAAC,CAAC;QACpE,IAAI,YAAY,KAAK,SAAS,EAAE,CAAC;YAC/B,MAAM,IAAI,KAAK,CACb,+DAA+D,WAAW,GAAG,CAC9E,CAAC;QACJ,CAAC;QACD,MAAM,KAAK,GAAG,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC;QAC7C,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACxB,MAAM,IAAI,KAAK,CACb,yBAAyB,YAAY,oBAAoB,WAAW,eAAe,CACpF,CAAC;QACJ,CAAC;QACD,OAAO,qBAAqB,CAAC;YAC3B,UAAU,EAAE,IAAI,CAAC,UAAU;YAC3B,YAAY,EAAE,YAAY;YAC1B,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;SACvC,CAAC,CAAC;IACL,CAAC;CACF;AAED;;;;GAIG;AACH,MAAM,OAAO,wBAAwB;IAC1B,UAAU,GAAG,QAAQ,CAAC;IAEd,WAAW,GAAG,IAAI,GAAG,EAAmB,CAAC;IAE1D,YAAY,UAA6C,EAAE;QACzD,KAAK,MAAM,CAAC,WAAW,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;YAC3D,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;QAC3C,CAAC;IACH,CAAC;IAED,GAAG,CAAC,WAAmB,EAAE,KAAc;QACrC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;IAC3C,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,WAAmB;QAC/B,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE,CAAC;YACvC,MAAM,IAAI,KAAK,CACb,kDAAkD,WAAW,GAAG,CACjE,CAAC;QACJ,CAAC;QACD,OAAO,qBAAqB,CAAC;YAC3B,UAAU,EAAE,IAAI,CAAC,UAAU;YAC3B,YAAY,EAAE,WAAW;YACzB,KAAK,EAAE,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,WAAW,CAAC;SACzC,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { Connector, ConnectorCapabilities, ConnectorExecutionContext, ConnectorRequest, ConnectorResponse } from "./ConnectorTypes.js";
|
|
2
|
+
export interface MockConnectorScript {
|
|
3
|
+
/** Returns a scripted response for the given request. */
|
|
4
|
+
respond?(request: ConnectorRequest, context: ConnectorExecutionContext): ConnectorResponse | Promise<ConnectorResponse>;
|
|
5
|
+
/** When set, execution rejects with this error instead of responding. */
|
|
6
|
+
failWith?: Error;
|
|
7
|
+
}
|
|
8
|
+
export interface MockConnectorOptions {
|
|
9
|
+
readonly connectorId: string;
|
|
10
|
+
readonly capabilities: ConnectorCapabilities;
|
|
11
|
+
readonly script?: MockConnectorScript;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Scripted, in-memory Connector for hermetic tests.
|
|
15
|
+
*
|
|
16
|
+
* Supports capability declarations, scripted responses, and failure
|
|
17
|
+
* injection. Records every request it receives so tests can assert on
|
|
18
|
+
* exactly what a connector was asked to execute.
|
|
19
|
+
*/
|
|
20
|
+
export declare class MockConnector implements Connector {
|
|
21
|
+
private readonly options;
|
|
22
|
+
readonly connectorId: string;
|
|
23
|
+
readonly capabilities: ConnectorCapabilities;
|
|
24
|
+
private readonly calls;
|
|
25
|
+
constructor(options: MockConnectorOptions);
|
|
26
|
+
get invocations(): readonly ConnectorRequest[];
|
|
27
|
+
execute(request: ConnectorRequest, context: ConnectorExecutionContext): Promise<ConnectorResponse>;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=MockConnector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MockConnector.d.ts","sourceRoot":"","sources":["../src/MockConnector.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,SAAS,EACT,qBAAqB,EACrB,yBAAyB,EACzB,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,qBAAqB,CAAC;AAE7B,MAAM,WAAW,mBAAmB;IAClC,yDAAyD;IACzD,OAAO,CAAC,CACN,OAAO,EAAE,gBAAgB,EACzB,OAAO,EAAE,yBAAyB,GACjC,iBAAiB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAElD,yEAAyE;IACzE,QAAQ,CAAC,EAAE,KAAK,CAAC;CAClB;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,YAAY,EAAE,qBAAqB,CAAC;IAC7C,QAAQ,CAAC,MAAM,CAAC,EAAE,mBAAmB,CAAC;CACvC;AAED;;;;;;GAMG;AACH,qBAAa,aAAc,YAAW,SAAS;IAMjC,OAAO,CAAC,QAAQ,CAAC,OAAO;IALpC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,YAAY,EAAE,qBAAqB,CAAC;IAE7C,OAAO,CAAC,QAAQ,CAAC,KAAK,CAA0B;gBAEnB,OAAO,EAAE,oBAAoB;IAK1D,IAAI,WAAW,IAAI,SAAS,gBAAgB,EAAE,CAE7C;IAEK,OAAO,CACX,OAAO,EAAE,gBAAgB,EACzB,OAAO,EAAE,yBAAyB,GACjC,OAAO,CAAC,iBAAiB,CAAC;CAiB9B"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Scripted, in-memory Connector for hermetic tests.
|
|
3
|
+
*
|
|
4
|
+
* Supports capability declarations, scripted responses, and failure
|
|
5
|
+
* injection. Records every request it receives so tests can assert on
|
|
6
|
+
* exactly what a connector was asked to execute.
|
|
7
|
+
*/
|
|
8
|
+
export class MockConnector {
|
|
9
|
+
options;
|
|
10
|
+
connectorId;
|
|
11
|
+
capabilities;
|
|
12
|
+
calls = [];
|
|
13
|
+
constructor(options) {
|
|
14
|
+
this.options = options;
|
|
15
|
+
this.connectorId = options.connectorId;
|
|
16
|
+
this.capabilities = options.capabilities;
|
|
17
|
+
}
|
|
18
|
+
get invocations() {
|
|
19
|
+
return [...this.calls];
|
|
20
|
+
}
|
|
21
|
+
async execute(request, context) {
|
|
22
|
+
if (!this.capabilities.includes(request.capability)) {
|
|
23
|
+
throw new Error(`MockConnector "${this.connectorId}" does not declare capability "${request.capability}".`);
|
|
24
|
+
}
|
|
25
|
+
this.calls.push(request);
|
|
26
|
+
if (this.options.script?.failWith !== undefined) {
|
|
27
|
+
throw this.options.script.failWith;
|
|
28
|
+
}
|
|
29
|
+
if (this.options.script?.respond !== undefined) {
|
|
30
|
+
return this.options.script.respond(request, context);
|
|
31
|
+
}
|
|
32
|
+
return { success: true, metadata: {} };
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=MockConnector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MockConnector.js","sourceRoot":"","sources":["../src/MockConnector.ts"],"names":[],"mappings":"AAyBA;;;;;;GAMG;AACH,MAAM,OAAO,aAAa;IAMK;IALpB,WAAW,CAAS;IACpB,YAAY,CAAwB;IAE5B,KAAK,GAAuB,EAAE,CAAC;IAEhD,YAA6B,OAA6B;QAA7B,YAAO,GAAP,OAAO,CAAsB;QACxD,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;QACvC,IAAI,CAAC,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC;IAC3C,CAAC;IAED,IAAI,WAAW;QACb,OAAO,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC;IACzB,CAAC;IAED,KAAK,CAAC,OAAO,CACX,OAAyB,EACzB,OAAkC;QAElC,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC;YACpD,MAAM,IAAI,KAAK,CACb,kBAAkB,IAAI,CAAC,WAAW,kCAAkC,OAAO,CAAC,UAAU,IAAI,CAC3F,CAAC;QACJ,CAAC;QAED,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAEzB,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,QAAQ,KAAK,SAAS,EAAE,CAAC;YAChD,MAAM,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC;QACrC,CAAC;QACD,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,OAAO,KAAK,SAAS,EAAE,CAAC;YAC/C,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACvD,CAAC;QACD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC;IACzC,CAAC;CACF"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { MockConnector } from "../../MockConnector.js";
|
|
2
|
+
/**
|
|
3
|
+
* Mock Oracle connector.
|
|
4
|
+
*
|
|
5
|
+
* Deterministic, in-memory connector used until the
|
|
6
|
+
* real enterprise connector is implemented.
|
|
7
|
+
*/
|
|
8
|
+
export declare function createOracleConnector(): MockConnector;
|
|
9
|
+
//# sourceMappingURL=OracleConnector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OracleConnector.d.ts","sourceRoot":"","sources":["../../../src/connectors/oracle/OracleConnector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAIvD;;;;;GAKG;AACH,wBAAgB,qBAAqB,IAAI,aAAa,CAMrD"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { MockConnector } from "../../MockConnector.js";
|
|
2
|
+
import { connectorCapabilities } from "../../ConnectorTypes.js";
|
|
3
|
+
/**
|
|
4
|
+
* Mock Oracle connector.
|
|
5
|
+
*
|
|
6
|
+
* Deterministic, in-memory connector used until the
|
|
7
|
+
* real enterprise connector is implemented.
|
|
8
|
+
*/
|
|
9
|
+
export function createOracleConnector() {
|
|
10
|
+
return new MockConnector({
|
|
11
|
+
connectorId: "oracle",
|
|
12
|
+
capabilities: connectorCapabilities(["oracle:create-purchase-order"]),
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=OracleConnector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OracleConnector.js","sourceRoot":"","sources":["../../../src/connectors/oracle/OracleConnector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAEhE;;;;;GAKG;AACH,MAAM,UAAU,qBAAqB;IACnC,OAAO,IAAI,aAAa,CAAC;QACvB,WAAW,EAAE,QAAQ;QAErB,YAAY,EAAE,qBAAqB,CAAC,CAAC,8BAA8B,CAAC,CAAC;KACtE,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ConnectorMetadata } from "../../ConnectorMetadata.js";
|
|
2
|
+
/**
|
|
3
|
+
* Metadata describing the Oracle connector.
|
|
4
|
+
*
|
|
5
|
+
* This metadata is consumed by the SDK executor and
|
|
6
|
+
* ultimately becomes part of the execution evidence.
|
|
7
|
+
*/
|
|
8
|
+
export declare const OracleMetadata: ConnectorMetadata;
|
|
9
|
+
//# sourceMappingURL=OracleMetadata.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OracleMetadata.d.ts","sourceRoot":"","sources":["../../../src/connectors/oracle/OracleMetadata.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAIpE;;;;;GAKG;AACH,eAAO,MAAM,cAAc,EAAE,iBAc3B,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { healthyNow } from "../../ConnectorMetadata.js";
|
|
2
|
+
/**
|
|
3
|
+
* Metadata describing the Oracle connector.
|
|
4
|
+
*
|
|
5
|
+
* This metadata is consumed by the SDK executor and
|
|
6
|
+
* ultimately becomes part of the execution evidence.
|
|
7
|
+
*/
|
|
8
|
+
export const OracleMetadata = Object.freeze({
|
|
9
|
+
connectorId: "oracle",
|
|
10
|
+
displayName: "Oracle",
|
|
11
|
+
version: Object.freeze({
|
|
12
|
+
major: 1,
|
|
13
|
+
minor: 0,
|
|
14
|
+
patch: 0,
|
|
15
|
+
}),
|
|
16
|
+
health: healthyNow(),
|
|
17
|
+
description: "Mock connector for Oracle purchase order execution.",
|
|
18
|
+
});
|
|
19
|
+
//# sourceMappingURL=OracleMetadata.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OracleMetadata.js","sourceRoot":"","sources":["../../../src/connectors/oracle/OracleMetadata.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAExD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,cAAc,GAAsB,MAAM,CAAC,MAAM,CAAC;IAC7D,WAAW,EAAE,QAAQ;IAErB,WAAW,EAAE,QAAQ;IAErB,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC;QACrB,KAAK,EAAE,CAAC;QACR,KAAK,EAAE,CAAC;QACR,KAAK,EAAE,CAAC;KACT,CAAC;IAEF,MAAM,EAAE,UAAU,EAAE;IAEpB,WAAW,EAAE,qDAAqD;CACnE,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/connectors/oracle/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAE7D,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/connectors/oracle/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAE7D,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { MockConnector } from "../../MockConnector.js";
|
|
2
|
+
/**
|
|
3
|
+
* Mock Salesforce connector.
|
|
4
|
+
*
|
|
5
|
+
* Deterministic, in-memory connector used until the
|
|
6
|
+
* real enterprise connector is implemented.
|
|
7
|
+
*/
|
|
8
|
+
export declare function createSalesforceConnector(): MockConnector;
|
|
9
|
+
//# sourceMappingURL=SalesforceConnector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SalesforceConnector.d.ts","sourceRoot":"","sources":["../../../src/connectors/salesforce/SalesforceConnector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAIvD;;;;;GAKG;AACH,wBAAgB,yBAAyB,IAAI,aAAa,CAMzD"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { MockConnector } from "../../MockConnector.js";
|
|
2
|
+
import { connectorCapabilities } from "../../ConnectorTypes.js";
|
|
3
|
+
/**
|
|
4
|
+
* Mock Salesforce connector.
|
|
5
|
+
*
|
|
6
|
+
* Deterministic, in-memory connector used until the
|
|
7
|
+
* real enterprise connector is implemented.
|
|
8
|
+
*/
|
|
9
|
+
export function createSalesforceConnector() {
|
|
10
|
+
return new MockConnector({
|
|
11
|
+
connectorId: "salesforce",
|
|
12
|
+
capabilities: connectorCapabilities(["salesforce:update-opportunity"]),
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=SalesforceConnector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SalesforceConnector.js","sourceRoot":"","sources":["../../../src/connectors/salesforce/SalesforceConnector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAEhE;;;;;GAKG;AACH,MAAM,UAAU,yBAAyB;IACvC,OAAO,IAAI,aAAa,CAAC;QACvB,WAAW,EAAE,YAAY;QAEzB,YAAY,EAAE,qBAAqB,CAAC,CAAC,+BAA+B,CAAC,CAAC;KACvE,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ConnectorMetadata } from "../../ConnectorMetadata.js";
|
|
2
|
+
/**
|
|
3
|
+
* Metadata describing the Salesforce connector.
|
|
4
|
+
*
|
|
5
|
+
* This metadata is consumed by the SDK executor and
|
|
6
|
+
* ultimately becomes part of the execution evidence.
|
|
7
|
+
*/
|
|
8
|
+
export declare const SalesforceMetadata: ConnectorMetadata;
|
|
9
|
+
//# sourceMappingURL=SalesforceMetadata.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SalesforceMetadata.d.ts","sourceRoot":"","sources":["../../../src/connectors/salesforce/SalesforceMetadata.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAIpE;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,EAAE,iBAc/B,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { healthyNow } from "../../ConnectorMetadata.js";
|
|
2
|
+
/**
|
|
3
|
+
* Metadata describing the Salesforce connector.
|
|
4
|
+
*
|
|
5
|
+
* This metadata is consumed by the SDK executor and
|
|
6
|
+
* ultimately becomes part of the execution evidence.
|
|
7
|
+
*/
|
|
8
|
+
export const SalesforceMetadata = Object.freeze({
|
|
9
|
+
connectorId: "salesforce",
|
|
10
|
+
displayName: "Salesforce",
|
|
11
|
+
version: Object.freeze({
|
|
12
|
+
major: 1,
|
|
13
|
+
minor: 0,
|
|
14
|
+
patch: 0,
|
|
15
|
+
}),
|
|
16
|
+
health: healthyNow(),
|
|
17
|
+
description: "Mock connector for Salesforce opportunity execution.",
|
|
18
|
+
});
|
|
19
|
+
//# sourceMappingURL=SalesforceMetadata.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SalesforceMetadata.js","sourceRoot":"","sources":["../../../src/connectors/salesforce/SalesforceMetadata.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAExD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAsB,MAAM,CAAC,MAAM,CAAC;IACjE,WAAW,EAAE,YAAY;IAEzB,WAAW,EAAE,YAAY;IAEzB,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC;QACrB,KAAK,EAAE,CAAC;QACR,KAAK,EAAE,CAAC;QACR,KAAK,EAAE,CAAC;KACT,CAAC;IAEF,MAAM,EAAE,UAAU,EAAE;IAEpB,WAAW,EAAE,sDAAsD;CACpE,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/connectors/salesforce/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AAErE,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/connectors/salesforce/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AAErE,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { MockConnector } from "../../MockConnector.js";
|
|
2
|
+
/**
|
|
3
|
+
* Mock SAP connector.
|
|
4
|
+
*
|
|
5
|
+
* Deterministic, in-memory connector used until the
|
|
6
|
+
* real enterprise connector is implemented.
|
|
7
|
+
*/
|
|
8
|
+
export declare function createSapConnector(): MockConnector;
|
|
9
|
+
//# sourceMappingURL=SapConnector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SapConnector.d.ts","sourceRoot":"","sources":["../../../src/connectors/sap/SapConnector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAIvD;;;;;GAKG;AACH,wBAAgB,kBAAkB,IAAI,aAAa,CAMlD"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { MockConnector } from "../../MockConnector.js";
|
|
2
|
+
import { connectorCapabilities } from "../../ConnectorTypes.js";
|
|
3
|
+
/**
|
|
4
|
+
* Mock SAP connector.
|
|
5
|
+
*
|
|
6
|
+
* Deterministic, in-memory connector used until the
|
|
7
|
+
* real enterprise connector is implemented.
|
|
8
|
+
*/
|
|
9
|
+
export function createSapConnector() {
|
|
10
|
+
return new MockConnector({
|
|
11
|
+
connectorId: "sap",
|
|
12
|
+
capabilities: connectorCapabilities(["sap:post-invoice"]),
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=SapConnector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SapConnector.js","sourceRoot":"","sources":["../../../src/connectors/sap/SapConnector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAEhE;;;;;GAKG;AACH,MAAM,UAAU,kBAAkB;IAChC,OAAO,IAAI,aAAa,CAAC;QACvB,WAAW,EAAE,KAAK;QAElB,YAAY,EAAE,qBAAqB,CAAC,CAAC,kBAAkB,CAAC,CAAC;KAC1D,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ConnectorMetadata } from "../../ConnectorMetadata.js";
|
|
2
|
+
/**
|
|
3
|
+
* Metadata describing the SAP connector.
|
|
4
|
+
*
|
|
5
|
+
* This metadata is consumed by the SDK executor and
|
|
6
|
+
* ultimately becomes part of the execution evidence.
|
|
7
|
+
*/
|
|
8
|
+
export declare const SapMetadata: ConnectorMetadata;
|
|
9
|
+
//# sourceMappingURL=SapMetadata.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SapMetadata.d.ts","sourceRoot":"","sources":["../../../src/connectors/sap/SapMetadata.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAIpE;;;;;GAKG;AACH,eAAO,MAAM,WAAW,EAAE,iBAcxB,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { healthyNow } from "../../ConnectorMetadata.js";
|
|
2
|
+
/**
|
|
3
|
+
* Metadata describing the SAP connector.
|
|
4
|
+
*
|
|
5
|
+
* This metadata is consumed by the SDK executor and
|
|
6
|
+
* ultimately becomes part of the execution evidence.
|
|
7
|
+
*/
|
|
8
|
+
export const SapMetadata = Object.freeze({
|
|
9
|
+
connectorId: "sap",
|
|
10
|
+
displayName: "SAP",
|
|
11
|
+
version: Object.freeze({
|
|
12
|
+
major: 1,
|
|
13
|
+
minor: 0,
|
|
14
|
+
patch: 0,
|
|
15
|
+
}),
|
|
16
|
+
health: healthyNow(),
|
|
17
|
+
description: "Mock connector for SAP invoice execution.",
|
|
18
|
+
});
|
|
19
|
+
//# sourceMappingURL=SapMetadata.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SapMetadata.js","sourceRoot":"","sources":["../../../src/connectors/sap/SapMetadata.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAExD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,WAAW,GAAsB,MAAM,CAAC,MAAM,CAAC;IAC1D,WAAW,EAAE,KAAK;IAElB,WAAW,EAAE,KAAK;IAElB,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC;QACrB,KAAK,EAAE,CAAC;QACR,KAAK,EAAE,CAAC;QACR,KAAK,EAAE,CAAC;KACT,CAAC;IAEF,MAAM,EAAE,UAAU,EAAE;IAEpB,WAAW,EAAE,2CAA2C;CACzD,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/connectors/sap/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAEvD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/connectors/sap/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAEvD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { MockConnector } from "../../MockConnector.js";
|
|
2
|
+
/**
|
|
3
|
+
* Mock Workday connector.
|
|
4
|
+
*
|
|
5
|
+
* Deterministic, in-memory connector used until the
|
|
6
|
+
* real enterprise connector is implemented.
|
|
7
|
+
*/
|
|
8
|
+
export declare function createWorkdayConnector(): MockConnector;
|
|
9
|
+
//# sourceMappingURL=WorkdayConnector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WorkdayConnector.d.ts","sourceRoot":"","sources":["../../../src/connectors/workday/WorkdayConnector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAIvD;;;;;GAKG;AACH,wBAAgB,sBAAsB,IAAI,aAAa,CAMtD"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { MockConnector } from "../../MockConnector.js";
|
|
2
|
+
import { connectorCapabilities } from "../../ConnectorTypes.js";
|
|
3
|
+
/**
|
|
4
|
+
* Mock Workday connector.
|
|
5
|
+
*
|
|
6
|
+
* Deterministic, in-memory connector used until the
|
|
7
|
+
* real enterprise connector is implemented.
|
|
8
|
+
*/
|
|
9
|
+
export function createWorkdayConnector() {
|
|
10
|
+
return new MockConnector({
|
|
11
|
+
connectorId: "workday",
|
|
12
|
+
capabilities: connectorCapabilities(["workday:submit-expense-report"]),
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=WorkdayConnector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WorkdayConnector.js","sourceRoot":"","sources":["../../../src/connectors/workday/WorkdayConnector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAEhE;;;;;GAKG;AACH,MAAM,UAAU,sBAAsB;IACpC,OAAO,IAAI,aAAa,CAAC;QACvB,WAAW,EAAE,SAAS;QAEtB,YAAY,EAAE,qBAAqB,CAAC,CAAC,+BAA+B,CAAC,CAAC;KACvE,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ConnectorMetadata } from "../../ConnectorMetadata.js";
|
|
2
|
+
/**
|
|
3
|
+
* Metadata describing the Workday connector.
|
|
4
|
+
*
|
|
5
|
+
* This metadata is consumed by the SDK executor and
|
|
6
|
+
* ultimately becomes part of the execution evidence.
|
|
7
|
+
*/
|
|
8
|
+
export declare const WorkdayMetadata: ConnectorMetadata;
|
|
9
|
+
//# sourceMappingURL=WorkdayMetadata.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WorkdayMetadata.d.ts","sourceRoot":"","sources":["../../../src/connectors/workday/WorkdayMetadata.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAIpE;;;;;GAKG;AACH,eAAO,MAAM,eAAe,EAAE,iBAc5B,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { healthyNow } from "../../ConnectorMetadata.js";
|
|
2
|
+
/**
|
|
3
|
+
* Metadata describing the Workday connector.
|
|
4
|
+
*
|
|
5
|
+
* This metadata is consumed by the SDK executor and
|
|
6
|
+
* ultimately becomes part of the execution evidence.
|
|
7
|
+
*/
|
|
8
|
+
export const WorkdayMetadata = Object.freeze({
|
|
9
|
+
connectorId: "workday",
|
|
10
|
+
displayName: "Workday",
|
|
11
|
+
version: Object.freeze({
|
|
12
|
+
major: 1,
|
|
13
|
+
minor: 0,
|
|
14
|
+
patch: 0,
|
|
15
|
+
}),
|
|
16
|
+
health: healthyNow(),
|
|
17
|
+
description: "Mock connector for Workday expense report execution.",
|
|
18
|
+
});
|
|
19
|
+
//# sourceMappingURL=WorkdayMetadata.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WorkdayMetadata.js","sourceRoot":"","sources":["../../../src/connectors/workday/WorkdayMetadata.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAExD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,eAAe,GAAsB,MAAM,CAAC,MAAM,CAAC;IAC9D,WAAW,EAAE,SAAS;IAEtB,WAAW,EAAE,SAAS;IAEtB,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC;QACrB,KAAK,EAAE,CAAC;QACR,KAAK,EAAE,CAAC;QACR,KAAK,EAAE,CAAC;KACT,CAAC;IAEF,MAAM,EAAE,UAAU,EAAE;IAEpB,WAAW,EAAE,sDAAsD;CACpE,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/connectors/workday/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAE/D,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/connectors/workday/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAE/D,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @parmana/connector-sdk
|
|
3
|
+
*
|
|
4
|
+
* Canonical public API.
|
|
5
|
+
*
|
|
6
|
+
* Connector authoring contracts: capability definitions, schemas, DTOs,
|
|
7
|
+
* metadata, and the Connector/CredentialProvider interfaces. Passive by
|
|
8
|
+
* design — this package describes capabilities, it does not execute them.
|
|
9
|
+
* Production execution (registration, credential-backed dispatch, the
|
|
10
|
+
* concrete Connector implementations) is owned by @parmana/execution-gateway
|
|
11
|
+
* (Phase 1C).
|
|
12
|
+
*/
|
|
13
|
+
export * from "./ConnectorTypes.js";
|
|
14
|
+
export * from "./ConnectorMetadata.js";
|
|
15
|
+
export * from "./ConnectorFactory.js";
|
|
16
|
+
export * from "./CredentialProvider.js";
|
|
17
|
+
export * from "./MockConnector.js";
|
|
18
|
+
export * from "./connectors/oracle/index.js";
|
|
19
|
+
export * from "./connectors/salesforce/index.js";
|
|
20
|
+
export * from "./connectors/sap/index.js";
|
|
21
|
+
export * from "./connectors/workday/index.js";
|
|
22
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,oBAAoB,CAAC;AAKnC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,kCAAkC,CAAC;AACjD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,+BAA+B,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @parmana/connector-sdk
|
|
3
|
+
*
|
|
4
|
+
* Canonical public API.
|
|
5
|
+
*
|
|
6
|
+
* Connector authoring contracts: capability definitions, schemas, DTOs,
|
|
7
|
+
* metadata, and the Connector/CredentialProvider interfaces. Passive by
|
|
8
|
+
* design — this package describes capabilities, it does not execute them.
|
|
9
|
+
* Production execution (registration, credential-backed dispatch, the
|
|
10
|
+
* concrete Connector implementations) is owned by @parmana/execution-gateway
|
|
11
|
+
* (Phase 1C).
|
|
12
|
+
*/
|
|
13
|
+
export * from "./ConnectorTypes.js";
|
|
14
|
+
export * from "./ConnectorMetadata.js";
|
|
15
|
+
export * from "./ConnectorFactory.js";
|
|
16
|
+
export * from "./CredentialProvider.js";
|
|
17
|
+
export * from "./MockConnector.js";
|
|
18
|
+
// Four enterprise-named reference mocks: deterministic MockConnector
|
|
19
|
+
// instances shaped like a real integration, not real integrations. See
|
|
20
|
+
// each connector's own Metadata export for what capability it declares.
|
|
21
|
+
export * from "./connectors/oracle/index.js";
|
|
22
|
+
export * from "./connectors/salesforce/index.js";
|
|
23
|
+
export * from "./connectors/sap/index.js";
|
|
24
|
+
export * from "./connectors/workday/index.js";
|
|
25
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,oBAAoB,CAAC;AAEnC,qEAAqE;AACrE,uEAAuE;AACvE,wEAAwE;AACxE,cAAc,8BAA8B,CAAC;AAC7C,cAAc,kCAAkC,CAAC;AACjD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,+BAA+B,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@parmana/connector-sdk",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"private": false,
|
|
5
|
+
"description": "Connector authoring contracts and reference implementations for Parmana, the authorization layer for AI execution",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/index.js"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist/**/*.js",
|
|
17
|
+
"dist/**/*.js.map",
|
|
18
|
+
"dist/**/*.d.ts",
|
|
19
|
+
"dist/**/*.d.ts.map",
|
|
20
|
+
"README.md"
|
|
21
|
+
],
|
|
22
|
+
"scripts": {
|
|
23
|
+
"build": "tsc -p tsconfig.json",
|
|
24
|
+
"typecheck": "tsc --noEmit -p tsconfig.json",
|
|
25
|
+
"test": "vitest run"
|
|
26
|
+
},
|
|
27
|
+
"keywords": [
|
|
28
|
+
"parmana",
|
|
29
|
+
"ai",
|
|
30
|
+
"governance",
|
|
31
|
+
"authorization",
|
|
32
|
+
"connector",
|
|
33
|
+
"integration",
|
|
34
|
+
"agentic-ai",
|
|
35
|
+
"sdk"
|
|
36
|
+
],
|
|
37
|
+
"repository": {
|
|
38
|
+
"type": "git",
|
|
39
|
+
"url": "https://github.com/pavancharak/parmana.git"
|
|
40
|
+
},
|
|
41
|
+
"bugs": {
|
|
42
|
+
"url": "https://github.com/pavancharak/parmana/issues"
|
|
43
|
+
},
|
|
44
|
+
"homepage": "https://github.com/pavancharak/parmana",
|
|
45
|
+
"devDependencies": {
|
|
46
|
+
"@types/node": "^24.0.0",
|
|
47
|
+
"typescript": "^5.9.0",
|
|
48
|
+
"vitest": "^4.1.11"
|
|
49
|
+
},
|
|
50
|
+
"engines": {
|
|
51
|
+
"node": ">=22"
|
|
52
|
+
},
|
|
53
|
+
"license": "SEE LICENSE IN LICENSE"
|
|
54
|
+
}
|