@useparagon/ocs-contracts 0.2.8
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/dist/globals.d.ts +47 -0
- package/dist/index.d.ts +1260 -0
- package/dist/pipeline.d.ts +1260 -0
- package/package.json +45 -0
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sandbox globals injected by the OCS isolated-vm runtime into connector hook
|
|
3
|
+
* code (pipelines, triggers, actions). These are ambient declarations only —
|
|
4
|
+
* not npm dependencies; they are available globally inside your hook files.
|
|
5
|
+
*
|
|
6
|
+
* Wire them into your connector's `tsconfig.json` via:
|
|
7
|
+
*
|
|
8
|
+
* { "compilerOptions": { "types": ["@useparagon-internal/ocs-contracts/globals"] } }
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
interface IntegrationRequestInput {
|
|
12
|
+
method?: string;
|
|
13
|
+
/** Path appended to `url` or the configured proxy base URL. */
|
|
14
|
+
path?: string;
|
|
15
|
+
/** Absolute URL used for direct HTTP requests. */
|
|
16
|
+
url?: string;
|
|
17
|
+
headers?: Record<string, string>;
|
|
18
|
+
params?: Record<string, string | number | boolean>;
|
|
19
|
+
body?: unknown;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
interface IntegrationRequestProxyEnvelope<TOutput = unknown> {
|
|
23
|
+
status: number;
|
|
24
|
+
headers: Record<string, unknown>;
|
|
25
|
+
output: TOutput;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
interface IntegrationRequestResponse<TOutput = unknown> {
|
|
29
|
+
status: number;
|
|
30
|
+
statusText: string;
|
|
31
|
+
ok: boolean;
|
|
32
|
+
headers: Record<string, string>;
|
|
33
|
+
json(): Promise<TOutput>;
|
|
34
|
+
text(): Promise<string>;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Perform an authenticated request against the connector's integration proxy
|
|
39
|
+
* (or an absolute URL). Injected globally inside connector hook code when the
|
|
40
|
+
* host has configured an integration/proxy handler; `undefined` when it is not
|
|
41
|
+
* available (e.g. local runs without proxy settings).
|
|
42
|
+
*/
|
|
43
|
+
declare const integrationRequest:
|
|
44
|
+
| (<TOutput = unknown>(
|
|
45
|
+
input: IntegrationRequestInput,
|
|
46
|
+
) => Promise<IntegrationRequestResponse<IntegrationRequestProxyEnvelope<TOutput>>>)
|
|
47
|
+
| undefined;
|