@versori/run 0.4.4 → 0.4.5
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/esm/deps/jsr.io/@std/encoding/1.0.10/_common64.d.ts +35 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.10/_common64.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.10/_common64.js +113 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.10/_common_detach.d.ts +4 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.10/_common_detach.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.10/_common_detach.js +13 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.10/_types.d.ts +9 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.10/_types.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.10/_types.js +2 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.10/base64.d.ts +40 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.10/base64.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.10/base64.js +82 -0
- package/esm/src/connection/CredentialsProvider.d.ts +17 -0
- package/esm/src/connection/CredentialsProvider.d.ts.map +1 -0
- package/esm/src/connection/CredentialsProvider.js +63 -0
- package/esm/src/connection/DirectConnectionFactory.d.ts +5 -3
- package/esm/src/connection/DirectConnectionFactory.d.ts.map +1 -1
- package/esm/src/connection/DirectConnectionFactory.js +7 -2
- package/esm/src/credentials/CredentialsProvider.d.ts +49 -0
- package/esm/src/credentials/CredentialsProvider.d.ts.map +1 -0
- package/esm/src/credentials/CredentialsProvider.js +102 -0
- package/esm/src/interpreter/durable/DurableInterpreter.d.ts.map +1 -1
- package/esm/src/interpreter/durable/DurableInterpreter.js +4 -17
- package/esm/src/interpreter/memory/MemoryInterpreter.d.ts.map +1 -1
- package/esm/src/interpreter/memory/MemoryInterpreter.js +4 -9
- package/esm/src/kv/nats/NatsKeyValueProvider.d.ts.map +1 -1
- package/esm/src/kv/nats/NatsKeyValueProvider.js +2 -2
- package/esm/src/kv/sdk/SDKKeyValueProvider.d.ts.map +1 -1
- package/esm/src/kv/sdk/SDKKeyValueProvider.js +3 -3
- package/package.json +1 -1
- package/script/deps/jsr.io/@std/encoding/1.0.10/_common64.d.ts +35 -0
- package/script/deps/jsr.io/@std/encoding/1.0.10/_common64.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/encoding/1.0.10/_common64.js +119 -0
- package/script/deps/jsr.io/@std/encoding/1.0.10/_common_detach.d.ts +4 -0
- package/script/deps/jsr.io/@std/encoding/1.0.10/_common_detach.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/encoding/1.0.10/_common_detach.js +16 -0
- package/script/deps/jsr.io/@std/encoding/1.0.10/_types.d.ts +9 -0
- package/script/deps/jsr.io/@std/encoding/1.0.10/_types.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/encoding/1.0.10/_types.js +3 -0
- package/script/deps/jsr.io/@std/encoding/1.0.10/base64.d.ts +40 -0
- package/script/deps/jsr.io/@std/encoding/1.0.10/base64.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/encoding/1.0.10/base64.js +86 -0
- package/script/src/connection/CredentialsProvider.d.ts +17 -0
- package/script/src/connection/CredentialsProvider.d.ts.map +1 -0
- package/script/src/connection/CredentialsProvider.js +67 -0
- package/script/src/connection/DirectConnectionFactory.d.ts +5 -3
- package/script/src/connection/DirectConnectionFactory.d.ts.map +1 -1
- package/script/src/connection/DirectConnectionFactory.js +7 -2
- package/script/src/credentials/CredentialsProvider.d.ts +49 -0
- package/script/src/credentials/CredentialsProvider.d.ts.map +1 -0
- package/script/src/credentials/CredentialsProvider.js +106 -0
- package/script/src/interpreter/durable/DurableInterpreter.d.ts.map +1 -1
- package/script/src/interpreter/durable/DurableInterpreter.js +4 -17
- package/script/src/interpreter/memory/MemoryInterpreter.d.ts.map +1 -1
- package/script/src/interpreter/memory/MemoryInterpreter.js +4 -9
- package/script/src/kv/nats/NatsKeyValueProvider.d.ts.map +1 -1
- package/script/src/kv/nats/NatsKeyValueProvider.js +2 -2
- package/script/src/kv/sdk/SDKKeyValueProvider.d.ts.map +1 -1
- package/script/src/kv/sdk/SDKKeyValueProvider.js +3 -3
- package/esm/src/dsl/http/default.d.ts +0 -26
- package/esm/src/dsl/http/default.d.ts.map +0 -1
- package/esm/src/dsl/http/default.js +0 -56
- package/esm/src/dsl/http/versori/cli.d.ts +0 -2
- package/esm/src/dsl/http/versori/cli.d.ts.map +0 -1
- package/esm/src/dsl/http/versori/cli.js +0 -32
- package/esm/src/dsl/http/versori/internalauth.d.ts +0 -15
- package/esm/src/dsl/http/versori/internalauth.d.ts.map +0 -1
- package/esm/src/dsl/http/versori/internalauth.js +0 -102
- package/esm/src/dsl/http/versori/proxyroundtripper.d.ts +0 -23
- package/esm/src/dsl/http/versori/proxyroundtripper.d.ts.map +0 -1
- package/esm/src/dsl/http/versori/proxyroundtripper.js +0 -208
- package/script/src/dsl/http/default.d.ts +0 -26
- package/script/src/dsl/http/default.d.ts.map +0 -1
- package/script/src/dsl/http/default.js +0 -60
- package/script/src/dsl/http/versori/cli.d.ts +0 -2
- package/script/src/dsl/http/versori/cli.d.ts.map +0 -1
- package/script/src/dsl/http/versori/cli.js +0 -35
- package/script/src/dsl/http/versori/internalauth.d.ts +0 -15
- package/script/src/dsl/http/versori/internalauth.d.ts.map +0 -1
- package/script/src/dsl/http/versori/internalauth.js +0 -106
- package/script/src/dsl/http/versori/proxyroundtripper.d.ts +0 -23
- package/script/src/dsl/http/versori/proxyroundtripper.d.ts.map +0 -1
- package/script/src/dsl/http/versori/proxyroundtripper.js +0 -212
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DirectConnectionFactory.d.ts","sourceRoot":"","sources":["../../../src/src/connection/DirectConnectionFactory.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7C,OAAO,EA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O,QAAQ,CAAC,YAAY,CAAC,EAC5C,MAAM,EAAE,MAAM,CAAC,OAAO,QAAQ,CAAC,oBAAoB,CAAC,EAC5C,MAAM,EAAE,MAAM;IAoBnC,OAAO,CAAC,GAAG,EAAE,UAAU,GAAG,OAAO,CAAC,SAAS,CAAC;IAI5C,OAAO,CAAC,GAAG,EAAE,UAAU,GAAG,OAAO,CAAC,cAAc,CAAC;IAIjD,sBAAsB,IAAI,mBAAmB;IAI7C,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,uBAAuB;CAuB1D"}
|
|
@@ -14,12 +14,13 @@
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.DirectConnectionFactory = void 0;
|
|
16
16
|
const connect_node_1 = require("@connectrpc/connect-node");
|
|
17
|
-
const
|
|
17
|
+
const constants_js_1 = require("../internal/constants.js");
|
|
18
18
|
const createConnectRpcClient_js_1 = require("../services/createConnectRpcClient.js");
|
|
19
|
+
const mod_js_1 = require("../services/credentials/mod.js");
|
|
20
|
+
const CredentialsProvider_js_1 = require("./CredentialsProvider.js");
|
|
19
21
|
const HttpClientFactory_js_1 = require("./internal/HttpClientFactory.js");
|
|
20
22
|
const InboundConnectionFactory_js_1 = require("./internal/InboundConnectionFactory.js");
|
|
21
23
|
const OutboundConnectionFactory_js_1 = require("./internal/OutboundConnectionFactory.js");
|
|
22
|
-
const constants_js_1 = require("../internal/constants.js");
|
|
23
24
|
/**
|
|
24
25
|
* DirectConnectionFactory is used by actual {@link FetchFactory} and {@link ExpressHandlers} implementations to build a
|
|
25
26
|
* fetchers and handlers for a given connection.
|
|
@@ -76,6 +77,7 @@ class DirectConnectionFactory {
|
|
|
76
77
|
// since both classes are fairly large and complex.
|
|
77
78
|
this.outboundConnectionFactory = new OutboundConnectionFactory_js_1.OutboundConnectionFactory(httpClientFactory, credentials, tokens, oauth1, logger);
|
|
78
79
|
this.expressInboundConnectionFactory = new InboundConnectionFactory_js_1.ExpressInboundConnectionFactory(credentials, tokens, logger);
|
|
80
|
+
this.getCredentialsProvider = this.getCredentialsProvider.bind(this);
|
|
79
81
|
}
|
|
80
82
|
fetcher(cnx) {
|
|
81
83
|
return this.outboundConnectionFactory.fetcher(cnx);
|
|
@@ -83,6 +85,9 @@ class DirectConnectionFactory {
|
|
|
83
85
|
handler(cnx) {
|
|
84
86
|
return this.expressInboundConnectionFactory.handler(cnx);
|
|
85
87
|
}
|
|
88
|
+
getCredentialsProvider() {
|
|
89
|
+
return new CredentialsProvider_js_1.CredentialsProviderImpl(this.credentials, this.tokens, this.oauth1);
|
|
90
|
+
}
|
|
86
91
|
static fromEnv(logger) {
|
|
87
92
|
const baseUrl = Deno.env.get(constants_js_1.envVarCredsBaseURL) || 'http://localhost:9000';
|
|
88
93
|
const credentials = (0, createConnectRpcClient_js_1.createConnectRpcClient)(mod_js_1.credentialv1alpha1.CredentialService, () => {
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { MessageInitShape } from '@bufbuild/protobuf';
|
|
2
|
+
import { Client } from '@connectrpc/connect';
|
|
3
|
+
import { credentialv1alpha1, oauth1v1 } from '../services/credentials/mod.js';
|
|
4
|
+
export type Token = {
|
|
5
|
+
accessToken: string;
|
|
6
|
+
tokenType: string;
|
|
7
|
+
expiry?: Date;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* CredentialsProvider is the interface for interacting with the credentials service.
|
|
11
|
+
*/
|
|
12
|
+
export interface CredentialsProvider {
|
|
13
|
+
getRaw(name: string, activationId?: string): Promise<Uint8Array>;
|
|
14
|
+
getAccessToken(name: string, forceRefresh?: boolean, activationId?: string): Promise<Token>;
|
|
15
|
+
getOAuth1Metadata(name: string, activationId?: string): Promise<oauth1v1.GetAuthorizationMetadataResponse>;
|
|
16
|
+
}
|
|
17
|
+
export type CredentialData = {
|
|
18
|
+
[key: string]: Uint8Array;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* CredentialsProviderV2 is the latest version of the CredentialsProvider interface and provides more capabilities for
|
|
22
|
+
* interacting with the credentials service.
|
|
23
|
+
*
|
|
24
|
+
* All implementations should be provided a fixed organisation ID to prevent misuse of the API.
|
|
25
|
+
*/
|
|
26
|
+
export interface CredentialsProviderV2 {
|
|
27
|
+
get(id: string): Promise<credentialv1alpha1.Credential>;
|
|
28
|
+
updateApiKey(id: string, key: string): Promise<credentialv1alpha1.Credential>;
|
|
29
|
+
updateBasicAuth(id: string, username: string, password: string): Promise<credentialv1alpha1.Credential>;
|
|
30
|
+
updateCertificate(id: string, payload: MessageInitShape<typeof credentialv1alpha1.CredentialDataCertificateSchema>): Promise<credentialv1alpha1.Credential>;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* CredentialsProviderV2 is the latest version of the CredentialsProvider interface and provides more capabilities for
|
|
34
|
+
* interacting with the credentials service.
|
|
35
|
+
*
|
|
36
|
+
* THIS IS A WORK IN PROGRESS - WE SHOULD STILL USE THE V1 INTERFACE FOR NOW.
|
|
37
|
+
*
|
|
38
|
+
* No idea if this approach is a good idea, happy to change it if there's a better way.
|
|
39
|
+
*/
|
|
40
|
+
export declare class CredentialsProviderImpl implements CredentialsProviderV2 {
|
|
41
|
+
private readonly client;
|
|
42
|
+
private readonly organisationId;
|
|
43
|
+
constructor(client: Client<typeof credentialv1alpha1.CredentialService>, organisationId: string);
|
|
44
|
+
get(id: string): Promise<credentialv1alpha1.Credential>;
|
|
45
|
+
updateApiKey(id: string, key: string): Promise<credentialv1alpha1.Credential>;
|
|
46
|
+
updateBasicAuth(id: string, username: string, password: string): Promise<credentialv1alpha1.Credential>;
|
|
47
|
+
updateCertificate(id: string, payload: MessageInitShape<typeof credentialv1alpha1.CredentialDataCertificateSchema>): Promise<credentialv1alpha1.Credential>;
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=CredentialsProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CredentialsProvider.d.ts","sourceRoot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,iBAAiB,CACb,EAAE,EAAE,MAAM,EACV,OAAO,EAAE,gBAAgB,CAAC,OAAO,kBAAkB,CAAC,+BAA+B,CAAC,GACrF,OAAO,CAAC,kBAAkB,CAAC,UAAU,CAAC,CAAC;CAC7C;AAED;;;;;;;GAOG;AACH,qBAAa,uBAAwB,YAAW,qBAAqB;IAE7D,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,cAAc;gBADd,MAAM,EAAE,MAAM,CAAC,OAAO,kBAAkB,CAAC,iBAAiB,CAAC,EAC3D,cAAc,EAAE,MAAM;IAIrC,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC,UAAU,CAAC;IAUvD,YAAY,CAAC,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC,UAAU,CAAC;IAoB7E,eAAe,CACjB,EAAE,EAAE,MAAM,EACV,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,GACjB,OAAO,CAAC,kBAAkB,CAAC,UAAU,CAAC;IAwBnC,iBAAiB,CACnB,EAAE,EAAE,MAAM,EACV,OAAO,EAAE,gBAAgB,CAAC,OAAO,kBAAkB,CAAC,+BAA+B,CAAC,GACrF,OAAO,CAAC,kBAAkB,CAAC,UAAU,CAAC;CAyB5C"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2025 Versori Group Inc
|
|
4
|
+
*
|
|
5
|
+
* Use of this software is governed by the Business Source License 1.1
|
|
6
|
+
* included in the LICENSE file at the root of this repository.
|
|
7
|
+
*
|
|
8
|
+
* Change Date: 2029-01-01
|
|
9
|
+
* Change License: Apache License, Version 2.0
|
|
10
|
+
*
|
|
11
|
+
* As of the Change Date, in accordance with the Business Source License,
|
|
12
|
+
* use of this software will be governed by the Apache License, Version 2.0.
|
|
13
|
+
*/
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.CredentialsProviderImpl = void 0;
|
|
16
|
+
const protobuf_1 = require("@bufbuild/protobuf");
|
|
17
|
+
const base64_js_1 = require("../../deps/jsr.io/@std/encoding/1.0.10/base64.js");
|
|
18
|
+
const mod_js_1 = require("../services/credentials/mod.js");
|
|
19
|
+
/**
|
|
20
|
+
* CredentialsProviderV2 is the latest version of the CredentialsProvider interface and provides more capabilities for
|
|
21
|
+
* interacting with the credentials service.
|
|
22
|
+
*
|
|
23
|
+
* THIS IS A WORK IN PROGRESS - WE SHOULD STILL USE THE V1 INTERFACE FOR NOW.
|
|
24
|
+
*
|
|
25
|
+
* No idea if this approach is a good idea, happy to change it if there's a better way.
|
|
26
|
+
*/
|
|
27
|
+
class CredentialsProviderImpl {
|
|
28
|
+
constructor(client, organisationId) {
|
|
29
|
+
Object.defineProperty(this, "client", {
|
|
30
|
+
enumerable: true,
|
|
31
|
+
configurable: true,
|
|
32
|
+
writable: true,
|
|
33
|
+
value: client
|
|
34
|
+
});
|
|
35
|
+
Object.defineProperty(this, "organisationId", {
|
|
36
|
+
enumerable: true,
|
|
37
|
+
configurable: true,
|
|
38
|
+
writable: true,
|
|
39
|
+
value: organisationId
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
async get(id) {
|
|
43
|
+
const response = await this.client.get({ id, organisationId: this.organisationId });
|
|
44
|
+
if (!response.credential) {
|
|
45
|
+
throw new Error('Failed to get credential, response was undefined');
|
|
46
|
+
}
|
|
47
|
+
return response.credential;
|
|
48
|
+
}
|
|
49
|
+
async updateApiKey(id, key) {
|
|
50
|
+
const rawMsg = (0, protobuf_1.create)(mod_js_1.credentialv1alpha1.CredentialDataRawSchema, {
|
|
51
|
+
raw: new TextEncoder().encode((0, base64_js_1.encodeBase64)(key)),
|
|
52
|
+
});
|
|
53
|
+
const response = await this.client.update({
|
|
54
|
+
id,
|
|
55
|
+
organisationId: this.organisationId,
|
|
56
|
+
data: {
|
|
57
|
+
raw: rawMsg.raw,
|
|
58
|
+
},
|
|
59
|
+
});
|
|
60
|
+
if (!response.credential) {
|
|
61
|
+
throw new Error('Failed to update API key credential, response was undefined');
|
|
62
|
+
}
|
|
63
|
+
return response.credential;
|
|
64
|
+
}
|
|
65
|
+
async updateBasicAuth(id, username, password) {
|
|
66
|
+
const basicAuthMsg = (0, protobuf_1.create)(mod_js_1.credentialv1alpha1.CredentialDataBasicAuthSchema, {
|
|
67
|
+
username,
|
|
68
|
+
password,
|
|
69
|
+
});
|
|
70
|
+
const data = {
|
|
71
|
+
username: new TextEncoder().encode((0, base64_js_1.encodeBase64)(basicAuthMsg.username)),
|
|
72
|
+
password: new TextEncoder().encode((0, base64_js_1.encodeBase64)(basicAuthMsg.password)),
|
|
73
|
+
};
|
|
74
|
+
const response = await this.client.update({
|
|
75
|
+
id,
|
|
76
|
+
organisationId: this.organisationId,
|
|
77
|
+
data,
|
|
78
|
+
});
|
|
79
|
+
if (!response.credential) {
|
|
80
|
+
throw new Error('Failed to update basic auth credential, response was undefined');
|
|
81
|
+
}
|
|
82
|
+
return response.credential;
|
|
83
|
+
}
|
|
84
|
+
async updateCertificate(id, payload) {
|
|
85
|
+
const certificateMsg = (0, protobuf_1.create)(mod_js_1.credentialv1alpha1.CredentialDataCertificateSchema, {
|
|
86
|
+
certificate: payload.certificate,
|
|
87
|
+
key: payload.key,
|
|
88
|
+
ca: payload.ca,
|
|
89
|
+
});
|
|
90
|
+
const data = {
|
|
91
|
+
certificate: new TextEncoder().encode((0, base64_js_1.encodeBase64)(certificateMsg.certificate)),
|
|
92
|
+
key: new TextEncoder().encode((0, base64_js_1.encodeBase64)(certificateMsg.key)),
|
|
93
|
+
ca: new TextEncoder().encode((0, base64_js_1.encodeBase64)(certificateMsg.ca)),
|
|
94
|
+
};
|
|
95
|
+
const response = await this.client.update({
|
|
96
|
+
id,
|
|
97
|
+
organisationId: this.organisationId,
|
|
98
|
+
data,
|
|
99
|
+
});
|
|
100
|
+
if (!response.credential) {
|
|
101
|
+
throw new Error('Failed to update certificate credential, response was undefined');
|
|
102
|
+
}
|
|
103
|
+
return response.credential;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
exports.CredentialsProviderImpl = CredentialsProviderImpl;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DurableInterpreter.d.ts","sourceRoot":"","sources":["../../../../src/src/interpreter/durable/DurableInterpreter.ts"],"names":[],"mappings":"AAaA,OAAsB,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAG3D,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAClD,OAAgB,EAAqB,MAAM,EAAE,MAAM,SAAS,CAAC;AAE7D,OAAO,EAA+B,UAAU,EAAM,YAAY,EAAO,MAAM,MAAM,CAAC;AACtF,OAAO,EAAE,uBAAuB,EAAE,MAAM,6CAA6C,CAAC;AACtF,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,eAAe,EAAuB,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"DurableInterpreter.d.ts","sourceRoot":"","sources":["../../../../src/src/interpreter/durable/DurableInterpreter.ts"],"names":[],"mappings":"AAaA,OAAsB,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAG3D,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAClD,OAAgB,EAAqB,MAAM,EAAE,MAAM,SAAS,CAAC;AAE7D,OAAO,EAA+B,UAAU,EAAM,YAAY,EAAO,MAAM,MAAM,CAAC;AACtF,OAAO,EAAE,uBAAuB,EAAE,MAAM,6CAA6C,CAAC;AACtF,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,eAAe,EAAuB,MAAM,kCAAkC,CAAC;AACxF,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAcrE,OAAO,EAAE,QAAQ,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s");
|
|
25
25
|
const DirectConnectionFactory_js_1 = require("../../connection/DirectConnectionFactory.js");
|
|
26
26
|
const ContextProvider_js_1 = require("../../context/ContextProvider.js");
|
|
27
|
-
const default_js_1 = require("../../dsl/http/default.js");
|
|
28
27
|
const configloader_js_1 = require("../../dsl/http/versori/configloader.js");
|
|
29
28
|
const constants_js_1 = require("../../dsl/http/versori/constants.js");
|
|
30
29
|
const cronapi_js_1 = require("../../dsl/http/versori/cronapi.js");
|
|
31
|
-
const proxyroundtripper_js_1 = require("../../dsl/http/versori/proxyroundtripper.js");
|
|
32
30
|
const Workflow_js_1 = require("../../dsl/Workflow.js");
|
|
33
31
|
const Issues_js_1 = require("../../issues/Issues.js");
|
|
34
32
|
const MemoryKeyValueProvider_js_1 = require("../../kv/memory/MemoryKeyValueProvider.js");
|
|
@@ -43,14 +41,6 @@ function getKVProvider(runLocal) {
|
|
|
43
41
|
}
|
|
44
42
|
return SDKKeyValueProvider_js_1.SDKKeyValueProvider.fromEnv();
|
|
45
43
|
}
|
|
46
|
-
function getRoundTripperFactory(log, _tracer, opts) {
|
|
47
|
-
if (opts && opts.runLocal) {
|
|
48
|
-
log.info('Running in local mode, using ProxyRoundTripperFactory');
|
|
49
|
-
return proxyroundtripper_js_1.ProxyRoundTripper.fromEnv(log);
|
|
50
|
-
}
|
|
51
|
-
log.info('Running with default round tripper factory');
|
|
52
|
-
return new default_js_1.DefaultRoundTripperFactory();
|
|
53
|
-
}
|
|
54
44
|
/**
|
|
55
45
|
* DurableInterpreter is an interpreter for executing Versori workflows with support for durable, queue-based workflow
|
|
56
46
|
* execution. It supports all trigger types including the {@link workflow} trigger which allows workflows to be started
|
|
@@ -234,23 +224,20 @@ class DurableInterpreter {
|
|
|
234
224
|
otelSDK.start();
|
|
235
225
|
}
|
|
236
226
|
const tracer = api_1.default.trace.getTracer(serviceName, version);
|
|
237
|
-
const roundTripperFactory = getRoundTripperFactory(log, tracer, {
|
|
238
|
-
skipVersoriCredentials: options.skipVersoriCredentials,
|
|
239
|
-
runLocal: runLocal,
|
|
240
|
-
});
|
|
241
227
|
const queueProvider = await Queue_js_1.QueueImpl.fromEnv(log);
|
|
228
|
+
const connectionFactory = DirectConnectionFactory_js_1.DirectConnectionFactory.fromEnv(log);
|
|
242
229
|
const issuesProvider = new Issues_js_1.IssueImpl(log);
|
|
243
230
|
if (options.contextProvider) {
|
|
244
231
|
// no need to set up a key-value provider if options.contextProvider is already
|
|
245
232
|
// initialised.
|
|
246
|
-
return new DurableInterpreter(log, compiler, options.contextProvider, express_1.default.Router(), express_1.default.Router(), new Map(), PlatformApi_js_1.PlatformApiImpl.fromEnv(),
|
|
233
|
+
return new DurableInterpreter(log, compiler, options.contextProvider, express_1.default.Router(), express_1.default.Router(), new Map(), PlatformApi_js_1.PlatformApiImpl.fromEnv(), connectionFactory, cronapi_js_1.CronAPIClient.fromEnv(), tracer, issuesProvider, configReader, queueProvider, otelSDK);
|
|
247
234
|
}
|
|
248
235
|
const kvp = await getKVProvider(runLocal);
|
|
249
236
|
const platformApi = PlatformApi_js_1.PlatformApiImpl.fromEnv();
|
|
250
237
|
const organisationId = Deno.env.get(constants_js_1.envVarOrgId) || 'development';
|
|
251
238
|
const environmentId = Deno.env.get(constants_js_1.envVarEnvId) || 'development';
|
|
252
|
-
const ctxProvider = new ContextProvider_js_1.ContextProviderImpl(log, kvp,
|
|
253
|
-
return new DurableInterpreter(log, compiler, ctxProvider, express_1.default.Router(), express_1.default.Router(), new Map(), PlatformApi_js_1.PlatformApiImpl.fromEnv(),
|
|
239
|
+
const ctxProvider = new ContextProvider_js_1.ContextProviderImpl(log, kvp, connectionFactory.getCredentialsProvider(), platformApi, organisationId, environmentId, issuesProvider);
|
|
240
|
+
return new DurableInterpreter(log, compiler, ctxProvider, express_1.default.Router(), express_1.default.Router(), new Map(), PlatformApi_js_1.PlatformApiImpl.fromEnv(), connectionFactory, cronapi_js_1.CronAPIClient.fromEnv(), tracer, issuesProvider, configReader, queueProvider, otelSDK);
|
|
254
241
|
}
|
|
255
242
|
register(workflow, options) {
|
|
256
243
|
const localAbortController = new AbortController();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MemoryInterpreter.d.ts","sourceRoot":"","sources":["../../../../src/src/interpreter/memory/MemoryInterpreter.ts"],"names":[],"mappings":"AAaA,OAAsB,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAG3D,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAClD,OAAgB,EAAqB,MAAM,EAAE,MAAM,SAAS,CAAC;AAE7D,OAAO,EAA+B,UAAU,EAAM,YAAY,EAAO,MAAM,MAAM,CAAC;AACtF,OAAO,EAAE,uBAAuB,EAAE,MAAM,6CAA6C,CAAC;AACtF,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,eAAe,EAAuB,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"MemoryInterpreter.d.ts","sourceRoot":"","sources":["../../../../src/src/interpreter/memory/MemoryInterpreter.ts"],"names":[],"mappings":"AAaA,OAAsB,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAG3D,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAClD,OAAgB,EAAqB,MAAM,EAAE,MAAM,SAAS,CAAC;AAE7D,OAAO,EAA+B,UAAU,EAAM,YAAY,EAAO,MAAM,MAAM,CAAC;AACtF,OAAO,EAAE,uBAAuB,EAAE,MAAM,6CAA6C,CAAC;AACtF,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,eAAe,EAAuB,MAAM,kCAAkC,CAAC;AACxF,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAGrE,OAAO,EAAE,QAAQ,EAAgB,MAAM,uBAAuB,CAAC;AAW/D,OAAO,EAAE,QAAQ,EAAa,MAAM,wBAAwB,CAAC;AAK7D,OAAO,EAAE,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AQ,CAAC,OAAO,CAAC;IAlB7B,OAAO,CAAC,mBAAmB,CAA2B;IACtD,OAAO,CAAC,aAAa,CAAC,CAAS;IAC/B,OAAO,CAAC,UAAU,CAAC,CAAS;IAC5B,OAAO,CAAC,cAAc,CAAC,CAAa;IACpC,OAAO,CAAC,cAAc,CAAS;gBAGV,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,kBAAkB,EAC5B,eAAe,EAAE,eAAe,EAChC,aAAa,EAAE,MAAM,EACrB,UAAU,EAAE,MAAM,EAC3B,YAAY,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EACxB,UAAU,EAAE,uBAAuB,EACnC,YAAY,EAAE,YAAY,EAC1B,MAAM,EAAE,MAAM,EACd,cAAc,EAAE,QAAQ,EACxB,SAAS,EAAE,YAAY,EACvB,OAAO,CAAC,EAAE,OAAO,YAAA;WAWzB,WAAW,CAAC,OAAO,GAAE,wBAA6B,GAAG,OAAO,CAAC,iBAAiB,CAAC;IA+F5F,QAAQ,CAAC,CAAC,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,EAAE,wBAAwB;IAmDrE,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IA+LtB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CASxB"}
|
|
@@ -24,11 +24,10 @@ const express_1 = __importDefault(require("express"));
|
|
|
24
24
|
const rxjs_1 = require("rxjs");
|
|
25
25
|
const DirectConnectionFactory_js_1 = require("../../connection/DirectConnectionFactory.js");
|
|
26
26
|
const ContextProvider_js_1 = require("../../context/ContextProvider.js");
|
|
27
|
-
const default_js_1 = require("../../dsl/http/default.js");
|
|
28
27
|
const configloader_js_1 = require("../../dsl/http/versori/configloader.js");
|
|
29
|
-
const constants_js_1 = require("../../dsl/http/versori/constants.js");
|
|
30
28
|
const cronapi_js_1 = require("../../dsl/http/versori/cronapi.js");
|
|
31
29
|
const Workflow_js_1 = require("../../dsl/Workflow.js");
|
|
30
|
+
const constants_js_1 = require("../../internal/constants.js");
|
|
32
31
|
const Issues_js_1 = require("../../issues/Issues.js");
|
|
33
32
|
const MemoryKeyValueProvider_js_1 = require("../../kv/memory/MemoryKeyValueProvider.js");
|
|
34
33
|
const NatsKeyValueProvider_js_1 = require("../../kv/nats/NatsKeyValueProvider.js");
|
|
@@ -41,10 +40,6 @@ function getKVProvider(runLocal) {
|
|
|
41
40
|
}
|
|
42
41
|
return NatsKeyValueProvider_js_1.NatsKeyValueProvider.fromEnv();
|
|
43
42
|
}
|
|
44
|
-
function getRoundTripperFactory(log) {
|
|
45
|
-
log.info('Running with default round tripper factory');
|
|
46
|
-
return new default_js_1.DefaultRoundTripperFactory();
|
|
47
|
-
}
|
|
48
43
|
/**
|
|
49
44
|
* MemoryInterpreter is the default interpreter for executing Versori workflows. It handles registration and execution
|
|
50
45
|
* of workflows triggered by schedules and webhooks.
|
|
@@ -211,7 +206,7 @@ class MemoryInterpreter {
|
|
|
211
206
|
otelSDK.start();
|
|
212
207
|
}
|
|
213
208
|
const tracer = api_1.default.trace.getTracer(serviceName, version);
|
|
214
|
-
const
|
|
209
|
+
const connectionFactory = DirectConnectionFactory_js_1.DirectConnectionFactory.fromEnv(log);
|
|
215
210
|
const issuesProvider = new Issues_js_1.IssueImpl(log);
|
|
216
211
|
if (options.contextProvider) {
|
|
217
212
|
// no need to set up a key-value provider if options.contextProvider is already
|
|
@@ -222,8 +217,8 @@ class MemoryInterpreter {
|
|
|
222
217
|
const platformApi = PlatformApi_js_1.PlatformApiImpl.fromEnv();
|
|
223
218
|
const organisationId = Deno.env.get(constants_js_1.envVarOrgId) || 'development';
|
|
224
219
|
const environmentId = Deno.env.get(constants_js_1.envVarEnvId) || 'development';
|
|
225
|
-
const ctxProvider = new ContextProvider_js_1.ContextProviderImpl(log, kvp,
|
|
226
|
-
return new MemoryInterpreter(log, compiler, ctxProvider, express_1.default.Router(), express_1.default.Router(), new Map(),
|
|
220
|
+
const ctxProvider = new ContextProvider_js_1.ContextProviderImpl(log, kvp, connectionFactory.getCredentialsProvider(), platformApi, organisationId, environmentId, issuesProvider);
|
|
221
|
+
return new MemoryInterpreter(log, compiler, ctxProvider, express_1.default.Router(), express_1.default.Router(), new Map(), connectionFactory, cronapi_js_1.CronAPIClient.fromEnv(), tracer, issuesProvider, configReader, otelSDK);
|
|
227
222
|
}
|
|
228
223
|
register(workflow, options) {
|
|
229
224
|
const localAbortController = new AbortController();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NatsKeyValueProvider.d.ts","sourceRoot":"","sources":["../../../../src/src/kv/nats/NatsKeyValueProvider.ts"],"names":[],"mappings":"AAeA,OAAO,EAA+B,UAAU,EAAE,MAAM,+DAA+D,CAAC;
|
|
1
|
+
{"version":3,"file":"NatsKeyValueProvider.d.ts","sourceRoot":"","sources":["../../../../src/src/kv/nats/NatsKeyValueProvider.ts"],"names":[],"mappings":"AAeA,OAAO,EAA+B,UAAU,EAAE,MAAM,+DAA+D,CAAC;AAExH,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AA4CvF,MAAM,MAAM,2BAA2B,GAAG;IACtC,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE;QACF,GAAG,EAAE,MAAM,CAAC;QACZ,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,GAAG,CAAC,EAAE,UAAU,CAAC;KACpB,CAAC;CACL,CAAC;AAuBF,qBAAa,oBAAqB,YAAW,gBAAgB,EAAE,eAAe;IAEtE,OAAO,CAAC,QAAQ,CAAC,GAAG;IACpB,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B,OAAO,CAAC,QAAQ,CAAC,cAAc;IAC/B,OAAO,CAAC,QAAQ,CAAC,gBAAgB;IACjC,OAAO,CAAC,QAAQ,CAAC,IAAI;IALzB,OAAO;WAQM,WAAW,CACpB,IAAI,GAAE,OAAO,CAAC,2BAA2B,CAAM,GAChD,OAAO,CAAC,oBAAoB,CAAC;IA0BhC,MAAM,CAAC,OAAO,IAAI,OAAO,CAAC,oBAAoB,CAAC;IAI/C,CAAC,MAAM,CAAC,YAAY,CAAC,IAAI,WAAW,CAAC,IAAI,CAAC;IAI1C,EAAE,CAAC,OAAO,EAAE,SAAS,GAAG,QAAQ;IAqB1B,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;IA6CrD,OAAO,CAAC,aAAa;CAYxB"}
|
|
@@ -16,8 +16,8 @@ exports.NatsKeyValueProvider = void 0;
|
|
|
16
16
|
const mod_js_1 = require("../../../deps/jsr.io/@nats-io/jetstream/3.2.0/src/mod.js");
|
|
17
17
|
const mod_js_2 = require("../../../deps/jsr.io/@nats-io/kv/3.2.0/src/mod.js");
|
|
18
18
|
const mod_js_3 = require("../../../deps/jsr.io/@nats-io/transport-deno/3.2.0/src/mod.js");
|
|
19
|
-
const NatsKeyValue_js_1 = require("./NatsKeyValue.js");
|
|
20
19
|
const isKVOptionsExecution_js_1 = require("../isKVOptionsExecution.js");
|
|
20
|
+
const NatsKeyValue_js_1 = require("./NatsKeyValue.js");
|
|
21
21
|
function getOptionsFromEnv() {
|
|
22
22
|
const natsTlsCaFile = Deno.env.get('RUN_NATS_TLS_CA_FILE');
|
|
23
23
|
return {
|
|
@@ -175,7 +175,7 @@ class NatsKeyValueProvider {
|
|
|
175
175
|
const activationSuffix = options.activationId ? `.${options.activationId}` : '';
|
|
176
176
|
switch (options.scope) {
|
|
177
177
|
case ':organization:':
|
|
178
|
-
return `${this.opts.organizationId}
|
|
178
|
+
return `${this.opts.organizationId}`;
|
|
179
179
|
case ':project:':
|
|
180
180
|
return `${this.opts.organizationId}.${this.opts.projectId}.${this.opts.environment}${activationSuffix}`;
|
|
181
181
|
case ':execution:':
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SDKKeyValueProvider.d.ts","sourceRoot":"","sources":["../../../../src/src/kv/sdk/SDKKeyValueProvider.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SDKKeyValueProvider.d.ts","sourceRoot":"","sources":["../../../../src/src/kv/sdk/SDKKeyValueProvider.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAkCvF,MAAM,MAAM,0BAA0B,GAAG;IACrC,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;CACpB,CAAC;AA6BF,qBAAa,mBAAoB,YAAW,gBAAgB,EAAE,eAAe;IAErE,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B,OAAO,CAAC,QAAQ,CAAC,cAAc;IAC/B,OAAO,CAAC,QAAQ,CAAC,gBAAgB;IACjC,OAAO,CAAC,QAAQ,CAAC,IAAI;IAJzB,OAAO;WAOM,WAAW,CACpB,IAAI,GAAE,OAAO,CAAC,0BAA0B,CAAM,GAC/C,OAAO,CAAC,mBAAmB,CAAC;IAY/B,MAAM,CAAC,OAAO,IAAI,OAAO,CAAC,mBAAmB,CAAC;IAI9C,CAAC,MAAM,CAAC,YAAY,CAAC,IAAI,WAAW,CAAC,IAAI,CAAC;IAI1C,EAAE,CAAC,OAAO,EAAE,SAAS,GAAG,QAAQ;IAqB1B,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;IA6CrD,OAAO,CAAC,aAAa;CAYxB"}
|
|
@@ -13,10 +13,10 @@
|
|
|
13
13
|
*/
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.SDKKeyValueProvider = void 0;
|
|
16
|
-
const StoresService_js_1 = require("../../dsl/http/versori/kvapi/services/StoresService.js");
|
|
17
16
|
const KvOperationsService_js_1 = require("../../dsl/http/versori/kvapi/services/KvOperationsService.js");
|
|
18
|
-
const
|
|
17
|
+
const StoresService_js_1 = require("../../dsl/http/versori/kvapi/services/StoresService.js");
|
|
19
18
|
const isKVOptionsExecution_js_1 = require("../isKVOptionsExecution.js");
|
|
19
|
+
const SDKKeyValue_js_1 = require("./SDKKeyValue.js");
|
|
20
20
|
function getOptionsFromEnv() {
|
|
21
21
|
return {
|
|
22
22
|
organizationId: Deno.env.get('RUN_ORGANISATION_ID'),
|
|
@@ -148,7 +148,7 @@ class SDKKeyValueProvider {
|
|
|
148
148
|
const activationSuffix = options.activationId ? `/${options.activationId}` : '';
|
|
149
149
|
switch (options.scope) {
|
|
150
150
|
case ':organization:':
|
|
151
|
-
return `${this.opts.organizationId}
|
|
151
|
+
return `${this.opts.organizationId}`;
|
|
152
152
|
case ':project:':
|
|
153
153
|
return `${this.opts.organizationId}/${this.opts.projectId}/${this.opts.environment}${activationSuffix}`;
|
|
154
154
|
case ':execution:':
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { DynamicFetcher, RoundTripperFactory } from './types.js';
|
|
2
|
-
import { CredentialsProvider } from './versori/contextcredentials.js';
|
|
3
|
-
/**
|
|
4
|
-
* A factory class for creating a default round tripper.
|
|
5
|
-
* This class is used to provide a default implementation for initializing
|
|
6
|
-
* if no round tripper factory is given.
|
|
7
|
-
*/
|
|
8
|
-
export declare class DefaultRoundTripperFactory implements RoundTripperFactory {
|
|
9
|
-
/**
|
|
10
|
-
* Constructs a new instance of the DefaultRoundTripperFactory.
|
|
11
|
-
*/
|
|
12
|
-
constructor();
|
|
13
|
-
/**
|
|
14
|
-
* Creates a round tripper function.
|
|
15
|
-
* This implementation simply returns the fetch function passed to it.
|
|
16
|
-
*
|
|
17
|
-
* @param connName - The name of the connection.
|
|
18
|
-
* @param fn - The fetch function to be used. Defaults to the global fetch function.
|
|
19
|
-
* @returns A promise that resolves to the fetch function.
|
|
20
|
-
*/
|
|
21
|
-
create(_connName: string): Promise<typeof fetch>;
|
|
22
|
-
createDynamic(_templateName: string): Promise<DynamicFetcher>;
|
|
23
|
-
credentials(): CredentialsProvider;
|
|
24
|
-
baseUrlFetcher(_connName: string): (activationId: string) => Promise<string>;
|
|
25
|
-
}
|
|
26
|
-
//# sourceMappingURL=default.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"default.d.ts","sourceRoot":"","sources":["../../../../src/src/dsl/http/default.ts"],"names":[],"mappings":"AAcA,OAAO,EAAc,cAAc,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAC7E,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAGtE;;;;GAIG;AACH,qBAAa,0BAA2B,YAAW,mBAAmB;IAClE;;OAEG;;IAIH;;;;;;;OAOG;IACH,MAAM,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,KAAK,CAAC;IAIhD,aAAa,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;IAU7D,WAAW,IAAI,mBAAmB;IAclC,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,CAAC,YAAY,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC;CAG/E"}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2025 Versori Group Inc
|
|
3
|
-
*
|
|
4
|
-
* Use of this software is governed by the Business Source License 1.1
|
|
5
|
-
* included in the LICENSE file at the root of this repository.
|
|
6
|
-
*
|
|
7
|
-
* Change Date: 2029-01-01
|
|
8
|
-
* Change License: Apache License, Version 2.0
|
|
9
|
-
*
|
|
10
|
-
* As of the Change Date, in accordance with the Business Source License,
|
|
11
|
-
* use of this software will be governed by the Apache License, Version 2.0.
|
|
12
|
-
*/
|
|
13
|
-
import { create } from '@bufbuild/protobuf';
|
|
14
|
-
import { oauth1v1 } from '../../services/credentials/mod.js';
|
|
15
|
-
/**
|
|
16
|
-
* A factory class for creating a default round tripper.
|
|
17
|
-
* This class is used to provide a default implementation for initializing
|
|
18
|
-
* if no round tripper factory is given.
|
|
19
|
-
*/
|
|
20
|
-
export class DefaultRoundTripperFactory {
|
|
21
|
-
/**
|
|
22
|
-
* Constructs a new instance of the DefaultRoundTripperFactory.
|
|
23
|
-
*/
|
|
24
|
-
constructor() {
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Creates a round tripper function.
|
|
28
|
-
* This implementation simply returns the fetch function passed to it.
|
|
29
|
-
*
|
|
30
|
-
* @param connName - The name of the connection.
|
|
31
|
-
* @param fn - The fetch function to be used. Defaults to the global fetch function.
|
|
32
|
-
* @returns A promise that resolves to the fetch function.
|
|
33
|
-
*/
|
|
34
|
-
create(_connName) {
|
|
35
|
-
return Promise.resolve(globalThis.fetch);
|
|
36
|
-
}
|
|
37
|
-
createDynamic(_templateName) {
|
|
38
|
-
return Promise.resolve((_activation, input, init) => {
|
|
39
|
-
return globalThis.fetch(input, init);
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
credentials() {
|
|
43
|
-
return {
|
|
44
|
-
getRaw: () => Promise.resolve(new Uint8Array(0)),
|
|
45
|
-
getAccessToken: () => Promise.resolve({
|
|
46
|
-
accessToken: '',
|
|
47
|
-
tokenType: '',
|
|
48
|
-
expiry: undefined,
|
|
49
|
-
}),
|
|
50
|
-
getOAuth1Metadata: () => Promise.resolve(create(oauth1v1.GetAuthorizationMetadataResponseSchema)), // Create empty response
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
baseUrlFetcher(_connName) {
|
|
54
|
-
return (_activationId) => Promise.resolve('');
|
|
55
|
-
}
|
|
56
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../../../../src/src/dsl/http/versori/cli.ts"],"names":[],"mappings":"AA8BA,wBAAgB,gBAAgB,IAAI,MAAM,CAmBzC"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2025 Versori Group Inc
|
|
3
|
-
*
|
|
4
|
-
* Use of this software is governed by the Business Source License 1.1
|
|
5
|
-
* included in the LICENSE file at the root of this repository.
|
|
6
|
-
*
|
|
7
|
-
* Change Date: 2029-01-01
|
|
8
|
-
* Change License: Apache License, Version 2.0
|
|
9
|
-
*
|
|
10
|
-
* As of the Change Date, in accordance with the Business Source License,
|
|
11
|
-
* use of this software will be governed by the Apache License, Version 2.0.
|
|
12
|
-
*/
|
|
13
|
-
// This file contains functions that can read stuff generated by the Versori CLI. This is used when running locally.
|
|
14
|
-
import { homedir } from 'node:os';
|
|
15
|
-
const cookiesFileName = 'cookies.json';
|
|
16
|
-
const versoriCookieName = 'versori_sess';
|
|
17
|
-
export function getVersoriCookie() {
|
|
18
|
-
const cookiesFilePath = `${homedir()}/.config/versori/${cookiesFileName}`;
|
|
19
|
-
let cookiesFile;
|
|
20
|
-
try {
|
|
21
|
-
cookiesFile = JSON.parse(Deno.readTextFileSync(cookiesFilePath));
|
|
22
|
-
}
|
|
23
|
-
catch (e) {
|
|
24
|
-
console.error('Error reading file, have you run the Versori CLI to log in?');
|
|
25
|
-
throw new Error(`Failed to read or parse cookies file at ${cookiesFilePath}: ${e}`);
|
|
26
|
-
}
|
|
27
|
-
const versoriCookie = cookiesFile.cookies.find((cookie) => cookie.Name === versoriCookieName);
|
|
28
|
-
if (!versoriCookie) {
|
|
29
|
-
throw new Error(`Cookie 'versori_sess' not found in ${cookiesFilePath}`);
|
|
30
|
-
}
|
|
31
|
-
return `${versoriCookieName}=${versoriCookie.Value}`;
|
|
32
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
type internalAuthHeader = {
|
|
2
|
-
[key: string]: string;
|
|
3
|
-
};
|
|
4
|
-
export declare class InternalAuth {
|
|
5
|
-
private clientId;
|
|
6
|
-
private clientSecret;
|
|
7
|
-
private tokenEndpoint;
|
|
8
|
-
private runLocal;
|
|
9
|
-
private accessToken;
|
|
10
|
-
private expiresAt;
|
|
11
|
-
constructor();
|
|
12
|
-
getAuthHeader(): Promise<internalAuthHeader>;
|
|
13
|
-
}
|
|
14
|
-
export {};
|
|
15
|
-
//# sourceMappingURL=internalauth.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"internalauth.d.ts","sourceRoot":"","sources":["../../../../../src/src/dsl/http/versori/internalauth.ts"],"names":[],"mappings":"AAsBA,KAAK,kBAAkB,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,CAAC;AAEpD,qBAAa,YAAY;IACrB,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,YAAY,CAAS;IAC7B,OAAO,CAAC,aAAa,CAAS;IAC9B,OAAO,CAAC,QAAQ,CAAU;IAE1B,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,SAAS,CAAS;;IAkCpB,aAAa,IAAI,OAAO,CAAC,kBAAkB,CAAC;CA0BrD"}
|