@stigmer/sdk 0.0.36
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 +190 -0
- package/README.md +199 -0
- package/config.d.ts +40 -0
- package/config.d.ts.map +1 -0
- package/config.js +17 -0
- package/config.js.map +1 -0
- package/errors.d.ts +77 -0
- package/errors.d.ts.map +1 -0
- package/errors.js +163 -0
- package/errors.js.map +1 -0
- package/gen/agent.d.ts +56 -0
- package/gen/agent.d.ts.map +1 -0
- package/gen/agent.js +113 -0
- package/gen/agent.js.map +1 -0
- package/gen/agentexecution.d.ts +68 -0
- package/gen/agentexecution.d.ts.map +1 -0
- package/gen/agentexecution.js +197 -0
- package/gen/agentexecution.js.map +1 -0
- package/gen/agentinstance.d.ts +26 -0
- package/gen/agentinstance.d.ts.map +1 -0
- package/gen/agentinstance.js +92 -0
- package/gen/agentinstance.js.map +1 -0
- package/gen/apikey.d.ts +25 -0
- package/gen/apikey.d.ts.map +1 -0
- package/gen/apikey.js +85 -0
- package/gen/apikey.js.map +1 -0
- package/gen/client.d.ts +76 -0
- package/gen/client.d.ts.map +1 -0
- package/gen/client.js +77 -0
- package/gen/client.js.map +1 -0
- package/gen/environment.d.ts +23 -0
- package/gen/environment.d.ts.map +1 -0
- package/gen/environment.js +86 -0
- package/gen/environment.js.map +1 -0
- package/gen/errors.d.ts +15 -0
- package/gen/errors.d.ts.map +1 -0
- package/gen/errors.js +52 -0
- package/gen/errors.js.map +1 -0
- package/gen/executioncontext.d.ts +24 -0
- package/gen/executioncontext.d.ts.map +1 -0
- package/gen/executioncontext.js +87 -0
- package/gen/executioncontext.js.map +1 -0
- package/gen/iampolicy.d.ts +34 -0
- package/gen/iampolicy.d.ts.map +1 -0
- package/gen/iampolicy.js +107 -0
- package/gen/iampolicy.js.map +1 -0
- package/gen/identityaccount.d.ts +35 -0
- package/gen/identityaccount.d.ts.map +1 -0
- package/gen/identityaccount.js +113 -0
- package/gen/identityaccount.js.map +1 -0
- package/gen/identityprovider.d.ts +27 -0
- package/gen/identityprovider.d.ts.map +1 -0
- package/gen/identityprovider.js +90 -0
- package/gen/identityprovider.js.map +1 -0
- package/gen/mcpserver.d.ts +50 -0
- package/gen/mcpserver.d.ts.map +1 -0
- package/gen/mcpserver.js +124 -0
- package/gen/mcpserver.js.map +1 -0
- package/gen/organization.d.ts +31 -0
- package/gen/organization.d.ts.map +1 -0
- package/gen/organization.js +102 -0
- package/gen/organization.js.map +1 -0
- package/gen/project.d.ts +24 -0
- package/gen/project.d.ts.map +1 -0
- package/gen/project.js +84 -0
- package/gen/project.js.map +1 -0
- package/gen/session.d.ts +49 -0
- package/gen/session.d.ts.map +1 -0
- package/gen/session.js +94 -0
- package/gen/session.js.map +1 -0
- package/gen/skill.d.ts +26 -0
- package/gen/skill.d.ts.map +1 -0
- package/gen/skill.js +101 -0
- package/gen/skill.js.map +1 -0
- package/gen/types.d.ts +43 -0
- package/gen/types.d.ts.map +1 -0
- package/gen/types.js +3 -0
- package/gen/types.js.map +1 -0
- package/gen/workflow.d.ts +51 -0
- package/gen/workflow.d.ts.map +1 -0
- package/gen/workflow.js +85 -0
- package/gen/workflow.js.map +1 -0
- package/gen/workflowexecution.d.ts +37 -0
- package/gen/workflowexecution.d.ts.map +1 -0
- package/gen/workflowexecution.js +161 -0
- package/gen/workflowexecution.js.map +1 -0
- package/gen/workflowinstance.d.ts +26 -0
- package/gen/workflowinstance.d.ts.map +1 -0
- package/gen/workflowinstance.js +92 -0
- package/gen/workflowinstance.js.map +1 -0
- package/index.d.ts +23 -0
- package/index.d.ts.map +1 -0
- package/index.js +26 -0
- package/index.js.map +1 -0
- package/internal/interceptors.d.ts +25 -0
- package/internal/interceptors.d.ts.map +1 -0
- package/internal/interceptors.js +75 -0
- package/internal/interceptors.js.map +1 -0
- package/package.json +40 -0
- package/search.d.ts +41 -0
- package/search.d.ts.map +1 -0
- package/search.js +45 -0
- package/search.js.map +1 -0
- package/src/config.ts +64 -0
- package/src/errors.ts +219 -0
- package/src/gen/agent.ts +146 -0
- package/src/gen/agentexecution.ts +205 -0
- package/src/gen/agentinstance.ts +91 -0
- package/src/gen/apikey.ts +86 -0
- package/src/gen/client.ts +99 -0
- package/src/gen/environment.ts +86 -0
- package/src/gen/errors.ts +74 -0
- package/src/gen/executioncontext.ts +87 -0
- package/src/gen/iampolicy.ts +108 -0
- package/src/gen/identityaccount.ts +115 -0
- package/src/gen/identityprovider.ts +94 -0
- package/src/gen/mcpserver.ts +147 -0
- package/src/gen/organization.ts +103 -0
- package/src/gen/project.ts +85 -0
- package/src/gen/session.ts +120 -0
- package/src/gen/skill.ts +102 -0
- package/src/gen/types.ts +51 -0
- package/src/gen/workflow.ts +116 -0
- package/src/gen/workflowexecution.ts +147 -0
- package/src/gen/workflowinstance.ts +91 -0
- package/src/index.ts +124 -0
- package/src/internal/interceptors.ts +83 -0
- package/src/search.ts +71 -0
- package/src/stigmer.ts +83 -0
- package/src/transport.ts +46 -0
- package/stigmer.d.ts +57 -0
- package/stigmer.d.ts.map +1 -0
- package/stigmer.js +64 -0
- package/stigmer.js.map +1 -0
- package/transport.d.ts +13 -0
- package/transport.d.ts.map +1 -0
- package/transport.js +34 -0
- package/transport.js.map +1 -0
package/src/stigmer.ts
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { GeneratedClient } from "./gen/client";
|
|
2
|
+
import { SearchClient } from "./search";
|
|
3
|
+
import { createStigmerTransport } from "./transport";
|
|
4
|
+
import { validateConfig, type StigmerConfig } from "./config";
|
|
5
|
+
import type { AgentClient } from "./gen/agent";
|
|
6
|
+
import type { AgentExecutionClient } from "./gen/agentexecution";
|
|
7
|
+
import type { AgentInstanceClient } from "./gen/agentinstance";
|
|
8
|
+
import type { ApiKeyClient } from "./gen/apikey";
|
|
9
|
+
import type { EnvironmentClient } from "./gen/environment";
|
|
10
|
+
import type { ExecutionContextClient } from "./gen/executioncontext";
|
|
11
|
+
import type { IamPolicyClient } from "./gen/iampolicy";
|
|
12
|
+
import type { IdentityAccountClient } from "./gen/identityaccount";
|
|
13
|
+
import type { IdentityProviderClient } from "./gen/identityprovider";
|
|
14
|
+
import type { McpServerClient } from "./gen/mcpserver";
|
|
15
|
+
import type { OrganizationClient } from "./gen/organization";
|
|
16
|
+
import type { ProjectClient } from "./gen/project";
|
|
17
|
+
import type { SessionClient } from "./gen/session";
|
|
18
|
+
import type { SkillClient } from "./gen/skill";
|
|
19
|
+
import type { WorkflowClient } from "./gen/workflow";
|
|
20
|
+
import type { WorkflowExecutionClient } from "./gen/workflowexecution";
|
|
21
|
+
import type { WorkflowInstanceClient } from "./gen/workflowinstance";
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Top-level Stigmer API client.
|
|
25
|
+
*
|
|
26
|
+
* Provides typed access to all Stigmer platform resources and a cross-resource
|
|
27
|
+
* search client. Create one with `new Stigmer({ ... })`.
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```typescript
|
|
31
|
+
* const stigmer = new Stigmer({
|
|
32
|
+
* baseUrl: "https://api.stigmer.io",
|
|
33
|
+
* apiKey: "sk_live_abc123",
|
|
34
|
+
* });
|
|
35
|
+
*
|
|
36
|
+
* const agent = await stigmer.agent.get("agent-id");
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
export class Stigmer {
|
|
40
|
+
readonly agent: AgentClient;
|
|
41
|
+
readonly agentExecution: AgentExecutionClient;
|
|
42
|
+
readonly agentInstance: AgentInstanceClient;
|
|
43
|
+
readonly apiKey: ApiKeyClient;
|
|
44
|
+
readonly environment: EnvironmentClient;
|
|
45
|
+
readonly executionContext: ExecutionContextClient;
|
|
46
|
+
readonly iamPolicy: IamPolicyClient;
|
|
47
|
+
readonly identityAccount: IdentityAccountClient;
|
|
48
|
+
readonly identityProvider: IdentityProviderClient;
|
|
49
|
+
readonly mcpServer: McpServerClient;
|
|
50
|
+
readonly organization: OrganizationClient;
|
|
51
|
+
readonly project: ProjectClient;
|
|
52
|
+
readonly session: SessionClient;
|
|
53
|
+
readonly skill: SkillClient;
|
|
54
|
+
readonly workflow: WorkflowClient;
|
|
55
|
+
readonly workflowExecution: WorkflowExecutionClient;
|
|
56
|
+
readonly workflowInstance: WorkflowInstanceClient;
|
|
57
|
+
readonly search: SearchClient;
|
|
58
|
+
|
|
59
|
+
constructor(config: StigmerConfig) {
|
|
60
|
+
validateConfig(config);
|
|
61
|
+
const transport = createStigmerTransport(config);
|
|
62
|
+
const client = new GeneratedClient(transport);
|
|
63
|
+
|
|
64
|
+
this.agent = client.agent;
|
|
65
|
+
this.agentExecution = client.agentExecution;
|
|
66
|
+
this.agentInstance = client.agentInstance;
|
|
67
|
+
this.apiKey = client.apiKey;
|
|
68
|
+
this.environment = client.environment;
|
|
69
|
+
this.executionContext = client.executionContext;
|
|
70
|
+
this.iamPolicy = client.iamPolicy;
|
|
71
|
+
this.identityAccount = client.identityAccount;
|
|
72
|
+
this.identityProvider = client.identityProvider;
|
|
73
|
+
this.mcpServer = client.mcpServer;
|
|
74
|
+
this.organization = client.organization;
|
|
75
|
+
this.project = client.project;
|
|
76
|
+
this.session = client.session;
|
|
77
|
+
this.skill = client.skill;
|
|
78
|
+
this.workflow = client.workflow;
|
|
79
|
+
this.workflowExecution = client.workflowExecution;
|
|
80
|
+
this.workflowInstance = client.workflowInstance;
|
|
81
|
+
this.search = new SearchClient(transport);
|
|
82
|
+
}
|
|
83
|
+
}
|
package/src/transport.ts
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { createGrpcWebTransport } from "@connectrpc/connect-web";
|
|
2
|
+
import { createConnectTransport } from "@connectrpc/connect-web";
|
|
3
|
+
import type { Transport, Interceptor } from "@connectrpc/connect";
|
|
4
|
+
import type { StigmerConfig, TokenProvider } from "./config";
|
|
5
|
+
import {
|
|
6
|
+
createAuthInterceptor,
|
|
7
|
+
rpcMetadataInterceptor,
|
|
8
|
+
errorStripInterceptor,
|
|
9
|
+
createAuthRedirectInterceptor,
|
|
10
|
+
} from "./internal/interceptors";
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Create a Connect-RPC transport configured for the Stigmer API.
|
|
14
|
+
*
|
|
15
|
+
* Interceptor chain (applied in order):
|
|
16
|
+
* 1. Auth — attaches `Authorization: Bearer <token>`
|
|
17
|
+
* 2. RPC metadata — annotates errors with method name and service path
|
|
18
|
+
* 3. Error-strip — removes gRPC status-code prefixes from messages
|
|
19
|
+
* 4. Auth redirect — calls `onUnauthenticated` on code 16 (if configured)
|
|
20
|
+
*/
|
|
21
|
+
export function createStigmerTransport(config: StigmerConfig): Transport {
|
|
22
|
+
const tokenProvider: TokenProvider = config.apiKey
|
|
23
|
+
? () => config.apiKey!
|
|
24
|
+
: config.getAccessToken!;
|
|
25
|
+
|
|
26
|
+
const interceptors: Interceptor[] = [
|
|
27
|
+
createAuthInterceptor(tokenProvider),
|
|
28
|
+
rpcMetadataInterceptor,
|
|
29
|
+
errorStripInterceptor,
|
|
30
|
+
];
|
|
31
|
+
|
|
32
|
+
if (config.onUnauthenticated) {
|
|
33
|
+
interceptors.push(createAuthRedirectInterceptor(config.onUnauthenticated));
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const transportFactory =
|
|
37
|
+
config.transport === "connect"
|
|
38
|
+
? createConnectTransport
|
|
39
|
+
: createGrpcWebTransport;
|
|
40
|
+
|
|
41
|
+
return transportFactory({
|
|
42
|
+
baseUrl: config.baseUrl,
|
|
43
|
+
useBinaryFormat: true,
|
|
44
|
+
interceptors,
|
|
45
|
+
});
|
|
46
|
+
}
|
package/stigmer.d.ts
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { SearchClient } from "./search";
|
|
2
|
+
import { type StigmerConfig } from "./config";
|
|
3
|
+
import type { AgentClient } from "./gen/agent";
|
|
4
|
+
import type { AgentExecutionClient } from "./gen/agentexecution";
|
|
5
|
+
import type { AgentInstanceClient } from "./gen/agentinstance";
|
|
6
|
+
import type { ApiKeyClient } from "./gen/apikey";
|
|
7
|
+
import type { EnvironmentClient } from "./gen/environment";
|
|
8
|
+
import type { ExecutionContextClient } from "./gen/executioncontext";
|
|
9
|
+
import type { IamPolicyClient } from "./gen/iampolicy";
|
|
10
|
+
import type { IdentityAccountClient } from "./gen/identityaccount";
|
|
11
|
+
import type { IdentityProviderClient } from "./gen/identityprovider";
|
|
12
|
+
import type { McpServerClient } from "./gen/mcpserver";
|
|
13
|
+
import type { OrganizationClient } from "./gen/organization";
|
|
14
|
+
import type { ProjectClient } from "./gen/project";
|
|
15
|
+
import type { SessionClient } from "./gen/session";
|
|
16
|
+
import type { SkillClient } from "./gen/skill";
|
|
17
|
+
import type { WorkflowClient } from "./gen/workflow";
|
|
18
|
+
import type { WorkflowExecutionClient } from "./gen/workflowexecution";
|
|
19
|
+
import type { WorkflowInstanceClient } from "./gen/workflowinstance";
|
|
20
|
+
/**
|
|
21
|
+
* Top-level Stigmer API client.
|
|
22
|
+
*
|
|
23
|
+
* Provides typed access to all Stigmer platform resources and a cross-resource
|
|
24
|
+
* search client. Create one with `new Stigmer({ ... })`.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```typescript
|
|
28
|
+
* const stigmer = new Stigmer({
|
|
29
|
+
* baseUrl: "https://api.stigmer.io",
|
|
30
|
+
* apiKey: "sk_live_abc123",
|
|
31
|
+
* });
|
|
32
|
+
*
|
|
33
|
+
* const agent = await stigmer.agent.get("agent-id");
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
export declare class Stigmer {
|
|
37
|
+
readonly agent: AgentClient;
|
|
38
|
+
readonly agentExecution: AgentExecutionClient;
|
|
39
|
+
readonly agentInstance: AgentInstanceClient;
|
|
40
|
+
readonly apiKey: ApiKeyClient;
|
|
41
|
+
readonly environment: EnvironmentClient;
|
|
42
|
+
readonly executionContext: ExecutionContextClient;
|
|
43
|
+
readonly iamPolicy: IamPolicyClient;
|
|
44
|
+
readonly identityAccount: IdentityAccountClient;
|
|
45
|
+
readonly identityProvider: IdentityProviderClient;
|
|
46
|
+
readonly mcpServer: McpServerClient;
|
|
47
|
+
readonly organization: OrganizationClient;
|
|
48
|
+
readonly project: ProjectClient;
|
|
49
|
+
readonly session: SessionClient;
|
|
50
|
+
readonly skill: SkillClient;
|
|
51
|
+
readonly workflow: WorkflowClient;
|
|
52
|
+
readonly workflowExecution: WorkflowExecutionClient;
|
|
53
|
+
readonly workflowInstance: WorkflowInstanceClient;
|
|
54
|
+
readonly search: SearchClient;
|
|
55
|
+
constructor(config: StigmerConfig);
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=stigmer.d.ts.map
|
package/stigmer.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stigmer.d.ts","sourceRoot":"","sources":["../src/stigmer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAExC,OAAO,EAAkB,KAAK,aAAa,EAAE,MAAM,UAAU,CAAC;AAC9D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AACjE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,KAAK,EAAE,kBAAkB,E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BAElB,MAAM,EAAE,aAAa;CAwBlC"}
|
package/stigmer.js
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { GeneratedClient } from "./gen/client";
|
|
2
|
+
import { SearchClient } from "./search";
|
|
3
|
+
import { createStigmerTransport } from "./transport";
|
|
4
|
+
import { validateConfig } from "./config";
|
|
5
|
+
/**
|
|
6
|
+
* Top-level Stigmer API client.
|
|
7
|
+
*
|
|
8
|
+
* Provides typed access to all Stigmer platform resources and a cross-resource
|
|
9
|
+
* search client. Create one with `new Stigmer({ ... })`.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```typescript
|
|
13
|
+
* const stigmer = new Stigmer({
|
|
14
|
+
* baseUrl: "https://api.stigmer.io",
|
|
15
|
+
* apiKey: "sk_live_abc123",
|
|
16
|
+
* });
|
|
17
|
+
*
|
|
18
|
+
* const agent = await stigmer.agent.get("agent-id");
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export class Stigmer {
|
|
22
|
+
agent;
|
|
23
|
+
agentExecution;
|
|
24
|
+
agentInstance;
|
|
25
|
+
apiKey;
|
|
26
|
+
environment;
|
|
27
|
+
executionContext;
|
|
28
|
+
iamPolicy;
|
|
29
|
+
identityAccount;
|
|
30
|
+
identityProvider;
|
|
31
|
+
mcpServer;
|
|
32
|
+
organization;
|
|
33
|
+
project;
|
|
34
|
+
session;
|
|
35
|
+
skill;
|
|
36
|
+
workflow;
|
|
37
|
+
workflowExecution;
|
|
38
|
+
workflowInstance;
|
|
39
|
+
search;
|
|
40
|
+
constructor(config) {
|
|
41
|
+
validateConfig(config);
|
|
42
|
+
const transport = createStigmerTransport(config);
|
|
43
|
+
const client = new GeneratedClient(transport);
|
|
44
|
+
this.agent = client.agent;
|
|
45
|
+
this.agentExecution = client.agentExecution;
|
|
46
|
+
this.agentInstance = client.agentInstance;
|
|
47
|
+
this.apiKey = client.apiKey;
|
|
48
|
+
this.environment = client.environment;
|
|
49
|
+
this.executionContext = client.executionContext;
|
|
50
|
+
this.iamPolicy = client.iamPolicy;
|
|
51
|
+
this.identityAccount = client.identityAccount;
|
|
52
|
+
this.identityProvider = client.identityProvider;
|
|
53
|
+
this.mcpServer = client.mcpServer;
|
|
54
|
+
this.organization = client.organization;
|
|
55
|
+
this.project = client.project;
|
|
56
|
+
this.session = client.session;
|
|
57
|
+
this.skill = client.skill;
|
|
58
|
+
this.workflow = client.workflow;
|
|
59
|
+
this.workflowExecution = client.workflowExecution;
|
|
60
|
+
this.workflowInstance = client.workflowInstance;
|
|
61
|
+
this.search = new SearchClient(transport);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=stigmer.js.map
|
package/stigmer.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stigmer.js","sourceRoot":"","sources":["../src/stigmer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,cAAc,EAAsB,MAAM,UAAU,CAAC;AAmB9D;;;;;;;;;;;;;;;GAeG;AACH,MAAM,OAAO,OAAO;IACT,KAAK,CAAc;IACnB,cAAc,CAAuB;IACrC,aAAa,CAAsB;IACnC,MAAM,CAAe;IACrB,WAAW,CAAoB;IAC/B,gBAAgB,CAAyB;IACzC,SAAS,CAAkB;IAC3B,eAAe,CAAwB;IACvC,gBAAgB,CAAyB;IACzC,SAAS,CAAkB;IAC3B,YAAY,CAAqB;IACjC,OAAO,CAAgB;IACvB,OAAO,CAAgB;IACvB,KAAK,CAAc;IACnB,QAAQ,CAAiB;IACzB,iBAAiB,CAA0B;IAC3C,gBAAgB,CAAyB;IACzC,MAAM,CAAe;IAE9B,YAAY,MAAqB;QAC/B,cAAc,CAAC,MAAM,CAAC,CAAC;QACvB,MAAM,SAAS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import type { StigmerConfig } from "./config";
|
|
3
|
+
/**
|
|
4
|
+
* Create a Connect-RPC transport configured for the Stigmer API.
|
|
5
|
+
*
|
|
6
|
+
* Interceptor chain (applied in order):
|
|
7
|
+
* 1. Auth — attaches `Authorization: Bearer <token>`
|
|
8
|
+
* 2. RPC metadata — annotates errors with method name and service path
|
|
9
|
+
* 3. Error-strip — removes gRPC status-code prefixes from messages
|
|
10
|
+
* 4. Auth redirect — calls `onUnauthenticated` on code 16 (if configured)
|
|
11
|
+
*/
|
|
12
|
+
export declare function createStigmerTransport(config: StigmerConfig): Transport;
|
|
13
|
+
//# sourceMappingURL=transport.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transport.d.ts","sourceRoot":"","sources":["../src/transport.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAe,MAAM,qBAAqB,CAAC;AAClE,OAAO,KAAK,EAAE,aAAa,EAAiB,MAAM,UAAU,CAAC;AAQ7D;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,aAAa,GAAG,SAAS,CAyBvE"}
|
package/transport.js
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { createGrpcWebTransport } from "@connectrpc/connect-web";
|
|
2
|
+
import { createConnectTransport } from "@connectrpc/connect-web";
|
|
3
|
+
import { createAuthInterceptor, rpcMetadataInterceptor, errorStripInterceptor, createAuthRedirectInterceptor, } from "./internal/interceptors";
|
|
4
|
+
/**
|
|
5
|
+
* Create a Connect-RPC transport configured for the Stigmer API.
|
|
6
|
+
*
|
|
7
|
+
* Interceptor chain (applied in order):
|
|
8
|
+
* 1. Auth — attaches `Authorization: Bearer <token>`
|
|
9
|
+
* 2. RPC metadata — annotates errors with method name and service path
|
|
10
|
+
* 3. Error-strip — removes gRPC status-code prefixes from messages
|
|
11
|
+
* 4. Auth redirect — calls `onUnauthenticated` on code 16 (if configured)
|
|
12
|
+
*/
|
|
13
|
+
export function createStigmerTransport(config) {
|
|
14
|
+
const tokenProvider = config.apiKey
|
|
15
|
+
? () => config.apiKey
|
|
16
|
+
: config.getAccessToken;
|
|
17
|
+
const interceptors = [
|
|
18
|
+
createAuthInterceptor(tokenProvider),
|
|
19
|
+
rpcMetadataInterceptor,
|
|
20
|
+
errorStripInterceptor,
|
|
21
|
+
];
|
|
22
|
+
if (config.onUnauthenticated) {
|
|
23
|
+
interceptors.push(createAuthRedirectInterceptor(config.onUnauthenticated));
|
|
24
|
+
}
|
|
25
|
+
const transportFactory = config.transport === "connect"
|
|
26
|
+
? createConnectTransport
|
|
27
|
+
: createGrpcWebTransport;
|
|
28
|
+
return transportFactory({
|
|
29
|
+
baseUrl: config.baseUrl,
|
|
30
|
+
useBinaryFormat: true,
|
|
31
|
+
interceptors,
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=transport.js.map
|
package/transport.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transport.js","sourceRoot":"","sources":["../src/transport.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AAGjE,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACtB,qBAAqB,EACrB,6BAA6B,GAC9B,MAAM,yBAAyB,CAAC;AAEjC;;;;;;;;GAQG;AACH,MAAM,UAAU,sBAAsB,CAAC,MAAqB;IAC1D,MAAM,aAAa,GAAkB,MAAM,CAAC,MAAM;QAChD,CAAC,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,MAAO;QACtB,CAAC,CAAC,MAAM,CAAC,cAAe,CAAC;IAE3B,MAAM,YAAY,GAAkB;QAClC,qBAAqB,CAAC,aAAa,CAAC;QACpC,sBAAsB;QACtB,qBAAqB;KACtB,CAAC;IAEF,IAAI,MAAM,CAAC,iBAAiB,EAAE,CAAC;QAC7B,YAAY,CAAC,IAAI,CAAC,6BAA6B,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC,CAAC;IAC7E,CAAC;IAED,MAAM,gBAAgB,GACpB,MAAM,CAAC,SAAS,KAAK,SAAS;QAC5B,CAAC,CAAC,sBAAsB;QACxB,CAAC,CAAC,sBAAsB,CAAC;IAE7B,OAAO,gBAAgB,CAAC;QACtB,OAAO,EAAE,MAAM,CAAC,OAAO;QACvB,eAAe,EAAE,IAAI;QACrB,YAAY;KACb,CAAC,CAAC;AACL,CAAC"}
|