@triveria/wallet 0.0.0-dev-c46c1cf

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/auth.d.ts ADDED
@@ -0,0 +1 @@
1
+ export declare function RequestToken(tokenUrl: string, audience: string, clientId: string, clientSecret: string): Promise<string>;
package/auth.js ADDED
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.RequestToken = RequestToken;
16
+ const axios_1 = __importDefault(require("axios"));
17
+ function RequestToken(tokenUrl, audience, clientId, clientSecret) {
18
+ return __awaiter(this, void 0, void 0, function* () {
19
+ const body = new URLSearchParams({ client_id: clientId, client_secret: clientSecret, audience, grant_type: 'client_credentials' }), headers = { 'content-type': 'application/x-www-form-urlencoded' };
20
+ const { data: { access_token } } = yield axios_1.default.post(`${tokenUrl}`, body, {
21
+ headers,
22
+ });
23
+ return access_token;
24
+ });
25
+ }
package/base.d.ts ADDED
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Triveria Wallet API
3
+ * Triveria Wallet is a cloud-based platform for managing digital credentials. The platform complies with open standards including the W3C Verifiable Credentials Data Model, IETF SD-JWT-VC, MSO Mdoc, OpenID Connect (OIDC), and EBSI DID, providing a unified interface across both eIDAS/EUDI and DID/W3C ecosystems. **Key capabilities:** - Issue and manage Verifiable Credentials (W3C VC, SD-JWT-VC and MSO Mdoc formats) - Credential signing using DIDs, X.509 certificates, and standard JWK keys - Trust framework integration: EBSI Trust Framework, EUDI Large Scale Pilot trust lists, and IDUnion - REST API and SDK access for seamless integration For access and support, contact info@triveria.com.
4
+ *
5
+ * The version of the OpenAPI document: dev.c46c1cf
6
+ *
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ import type { Configuration } from './configuration';
13
+ import type { AxiosInstance, RawAxiosRequestConfig } from 'axios';
14
+ export declare const BASE_PATH: string;
15
+ export declare const COLLECTION_FORMATS: {
16
+ csv: string;
17
+ ssv: string;
18
+ tsv: string;
19
+ pipes: string;
20
+ };
21
+ export interface RequestArgs {
22
+ url: string;
23
+ options: RawAxiosRequestConfig;
24
+ }
25
+ export declare class BaseAPI {
26
+ protected basePath: string;
27
+ protected axios: AxiosInstance;
28
+ protected configuration: Configuration | undefined;
29
+ constructor(configuration?: Configuration, basePath?: string, axios?: AxiosInstance);
30
+ }
31
+ export declare class RequiredError extends Error {
32
+ field: string;
33
+ constructor(field: string, msg?: string);
34
+ }
35
+ interface ServerMap {
36
+ [key: string]: {
37
+ url: string;
38
+ description: string;
39
+ }[];
40
+ }
41
+ export declare const operationServerMap: ServerMap;
42
+ export {};
package/base.js ADDED
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * Triveria Wallet API
6
+ * Triveria Wallet is a cloud-based platform for managing digital credentials. The platform complies with open standards including the W3C Verifiable Credentials Data Model, IETF SD-JWT-VC, MSO Mdoc, OpenID Connect (OIDC), and EBSI DID, providing a unified interface across both eIDAS/EUDI and DID/W3C ecosystems. **Key capabilities:** - Issue and manage Verifiable Credentials (W3C VC, SD-JWT-VC and MSO Mdoc formats) - Credential signing using DIDs, X.509 certificates, and standard JWK keys - Trust framework integration: EBSI Trust Framework, EUDI Large Scale Pilot trust lists, and IDUnion - REST API and SDK access for seamless integration For access and support, contact info@triveria.com.
7
+ *
8
+ * The version of the OpenAPI document: dev.c46c1cf
9
+ *
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ var __importDefault = (this && this.__importDefault) || function (mod) {
16
+ return (mod && mod.__esModule) ? mod : { "default": mod };
17
+ };
18
+ Object.defineProperty(exports, "__esModule", { value: true });
19
+ exports.operationServerMap = exports.RequiredError = exports.BaseAPI = exports.COLLECTION_FORMATS = exports.BASE_PATH = void 0;
20
+ const axios_1 = __importDefault(require("axios"));
21
+ exports.BASE_PATH = "/api/v1".replace(/\/+$/, "");
22
+ exports.COLLECTION_FORMATS = {
23
+ csv: ",",
24
+ ssv: " ",
25
+ tsv: "\t",
26
+ pipes: "|",
27
+ };
28
+ class BaseAPI {
29
+ constructor(configuration, basePath = exports.BASE_PATH, axios = axios_1.default) {
30
+ var _a;
31
+ this.basePath = basePath;
32
+ this.axios = axios;
33
+ if (configuration) {
34
+ this.configuration = configuration;
35
+ this.basePath = (_a = configuration.basePath) !== null && _a !== void 0 ? _a : basePath;
36
+ }
37
+ }
38
+ }
39
+ exports.BaseAPI = BaseAPI;
40
+ ;
41
+ class RequiredError extends Error {
42
+ constructor(field, msg) {
43
+ super(msg);
44
+ this.field = field;
45
+ this.name = "RequiredError";
46
+ }
47
+ }
48
+ exports.RequiredError = RequiredError;
49
+ exports.operationServerMap = {};
package/client.d.ts ADDED
@@ -0,0 +1,24 @@
1
+ import { AxiosInstance } from "axios";
2
+ import { DefaultApi } from "./api";
3
+ import { WalletNotificationStream, WalletNotificationStreamOptions } from "./notifications";
4
+ export type ClientConfiguration = {
5
+ clientId: string;
6
+ clientSecret: string;
7
+ };
8
+ /**
9
+ * DefaultApi - object-oriented interface
10
+ * @export
11
+ * @class DefaultApi
12
+ * @extends {DefaultApi}
13
+ */
14
+ export declare class Client extends DefaultApi {
15
+ protected baseURL: string;
16
+ protected axios: AxiosInstance;
17
+ constructor(tokenUrl: string, audience: string, clientId: string, clientSecret: string, baseURL: string, axios?: AxiosInstance);
18
+ /**
19
+ * Opens a live stream of notifications for a wallet over SSE.
20
+ * @param walletId Wallet ID
21
+ * @param options Stream filtering/reconnect options
22
+ */
23
+ streamWalletNotifications(walletId: string, options?: WalletNotificationStreamOptions): WalletNotificationStream;
24
+ }
package/client.js ADDED
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.Client = void 0;
7
+ const api_1 = require("./api");
8
+ const notifications_1 = require("./notifications");
9
+ const axios_1 = __importDefault(require("axios"));
10
+ const auth_1 = require("./auth");
11
+ /**
12
+ * DefaultApi - object-oriented interface
13
+ * @export
14
+ * @class DefaultApi
15
+ * @extends {DefaultApi}
16
+ */
17
+ class Client extends api_1.DefaultApi {
18
+ constructor(tokenUrl, audience, clientId, clientSecret, baseURL, axios = axios_1.default) {
19
+ super({
20
+ accessToken: (0, auth_1.RequestToken)(tokenUrl, audience, clientId, clientSecret),
21
+ basePath: baseURL,
22
+ isJsonMime,
23
+ }, baseURL, axios);
24
+ this.baseURL = baseURL;
25
+ this.axios = axios;
26
+ }
27
+ /**
28
+ * Opens a live stream of notifications for a wallet over SSE.
29
+ * @param walletId Wallet ID
30
+ * @param options Stream filtering/reconnect options
31
+ */
32
+ streamWalletNotifications(walletId, options = {}) {
33
+ return new notifications_1.WalletNotificationStream(this.configuration, walletId, Object.assign({ axios: this.axios, basePath: this.basePath }, options));
34
+ }
35
+ }
36
+ exports.Client = Client;
37
+ function isJsonMime(mime) {
38
+ const jsonMime = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i');
39
+ return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json');
40
+ }
package/common.d.ts ADDED
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Triveria Wallet API
3
+ * Triveria Wallet is a cloud-based platform for managing digital credentials. The platform complies with open standards including the W3C Verifiable Credentials Data Model, IETF SD-JWT-VC, MSO Mdoc, OpenID Connect (OIDC), and EBSI DID, providing a unified interface across both eIDAS/EUDI and DID/W3C ecosystems. **Key capabilities:** - Issue and manage Verifiable Credentials (W3C VC, SD-JWT-VC and MSO Mdoc formats) - Credential signing using DIDs, X.509 certificates, and standard JWK keys - Trust framework integration: EBSI Trust Framework, EUDI Large Scale Pilot trust lists, and IDUnion - REST API and SDK access for seamless integration For access and support, contact info@triveria.com.
4
+ *
5
+ * The version of the OpenAPI document: dev.c46c1cf
6
+ *
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ import type { Configuration } from "./configuration";
13
+ import type { RequestArgs } from "./base";
14
+ import type { AxiosInstance, AxiosResponse } from 'axios';
15
+ export declare const DUMMY_BASE_URL = "https://example.com";
16
+ /**
17
+ *
18
+ * @throws {RequiredError}
19
+ */
20
+ export declare const assertParamExists: (functionName: string, paramName: string, paramValue: unknown) => void;
21
+ export declare const setApiKeyToObject: (object: any, keyParamName: string, configuration?: Configuration) => Promise<void>;
22
+ export declare const setBasicAuthToObject: (object: any, configuration?: Configuration) => void;
23
+ export declare const setBearerAuthToObject: (object: any, configuration?: Configuration) => Promise<void>;
24
+ export declare const setOAuthToObject: (object: any, name: string, scopes: string[], configuration?: Configuration) => Promise<void>;
25
+ export declare const setSearchParams: (url: URL, ...objects: any[]) => void;
26
+ /**
27
+ * JSON serialization helper function which replaces instances of unserializable types with serializable ones.
28
+ * This function will run for every key-value pair encountered by JSON.stringify while traversing an object.
29
+ * Converting a set to a string will return an empty object, so an intermediate conversion to an array is required.
30
+ */
31
+ export declare const replaceWithSerializableTypeIfNeeded: (key: string, value: any) => any;
32
+ export declare const serializeDataIfNeeded: (value: any, requestOptions: any, configuration?: Configuration) => any;
33
+ export declare const toPathString: (url: URL) => string;
34
+ export declare const createRequestFunction: (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) => <T = unknown, R = AxiosResponse<T>>(axios?: AxiosInstance, basePath?: string) => Promise<R>;
package/common.js ADDED
@@ -0,0 +1,139 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * Triveria Wallet API
6
+ * Triveria Wallet is a cloud-based platform for managing digital credentials. The platform complies with open standards including the W3C Verifiable Credentials Data Model, IETF SD-JWT-VC, MSO Mdoc, OpenID Connect (OIDC), and EBSI DID, providing a unified interface across both eIDAS/EUDI and DID/W3C ecosystems. **Key capabilities:** - Issue and manage Verifiable Credentials (W3C VC, SD-JWT-VC and MSO Mdoc formats) - Credential signing using DIDs, X.509 certificates, and standard JWK keys - Trust framework integration: EBSI Trust Framework, EUDI Large Scale Pilot trust lists, and IDUnion - REST API and SDK access for seamless integration For access and support, contact info@triveria.com.
7
+ *
8
+ * The version of the OpenAPI document: dev.c46c1cf
9
+ *
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
16
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
17
+ return new (P || (P = Promise))(function (resolve, reject) {
18
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
19
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
20
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
21
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
22
+ });
23
+ };
24
+ Object.defineProperty(exports, "__esModule", { value: true });
25
+ exports.createRequestFunction = exports.toPathString = exports.serializeDataIfNeeded = exports.replaceWithSerializableTypeIfNeeded = exports.setSearchParams = exports.setOAuthToObject = exports.setBearerAuthToObject = exports.setBasicAuthToObject = exports.setApiKeyToObject = exports.assertParamExists = exports.DUMMY_BASE_URL = void 0;
26
+ const base_1 = require("./base");
27
+ exports.DUMMY_BASE_URL = 'https://example.com';
28
+ /**
29
+ *
30
+ * @throws {RequiredError}
31
+ */
32
+ const assertParamExists = function (functionName, paramName, paramValue) {
33
+ if (paramValue === null || paramValue === undefined) {
34
+ throw new base_1.RequiredError(paramName, `Required parameter ${paramName} was null or undefined when calling ${functionName}.`);
35
+ }
36
+ };
37
+ exports.assertParamExists = assertParamExists;
38
+ const setApiKeyToObject = function (object, keyParamName, configuration) {
39
+ return __awaiter(this, void 0, void 0, function* () {
40
+ if (configuration && configuration.apiKey) {
41
+ const localVarApiKeyValue = typeof configuration.apiKey === 'function'
42
+ ? yield configuration.apiKey(keyParamName)
43
+ : yield configuration.apiKey;
44
+ object[keyParamName] = localVarApiKeyValue;
45
+ }
46
+ });
47
+ };
48
+ exports.setApiKeyToObject = setApiKeyToObject;
49
+ const setBasicAuthToObject = function (object, configuration) {
50
+ if (configuration && (configuration.username || configuration.password)) {
51
+ object["auth"] = { username: configuration.username, password: configuration.password };
52
+ }
53
+ };
54
+ exports.setBasicAuthToObject = setBasicAuthToObject;
55
+ const setBearerAuthToObject = function (object, configuration) {
56
+ return __awaiter(this, void 0, void 0, function* () {
57
+ if (configuration && configuration.accessToken) {
58
+ const accessToken = typeof configuration.accessToken === 'function'
59
+ ? yield configuration.accessToken()
60
+ : yield configuration.accessToken;
61
+ object["Authorization"] = "Bearer " + accessToken;
62
+ }
63
+ });
64
+ };
65
+ exports.setBearerAuthToObject = setBearerAuthToObject;
66
+ const setOAuthToObject = function (object, name, scopes, configuration) {
67
+ return __awaiter(this, void 0, void 0, function* () {
68
+ if (configuration && configuration.accessToken) {
69
+ const localVarAccessTokenValue = typeof configuration.accessToken === 'function'
70
+ ? yield configuration.accessToken(name, scopes)
71
+ : yield configuration.accessToken;
72
+ object["Authorization"] = "Bearer " + localVarAccessTokenValue;
73
+ }
74
+ });
75
+ };
76
+ exports.setOAuthToObject = setOAuthToObject;
77
+ function setFlattenedQueryParams(urlSearchParams, parameter, key = "") {
78
+ if (parameter == null)
79
+ return;
80
+ if (typeof parameter === "object") {
81
+ if (Array.isArray(parameter) || parameter instanceof Set) {
82
+ parameter.forEach(item => setFlattenedQueryParams(urlSearchParams, item, key));
83
+ }
84
+ else {
85
+ Object.keys(parameter).forEach(currentKey => setFlattenedQueryParams(urlSearchParams, parameter[currentKey], `${key}${key !== '' ? '.' : ''}${currentKey}`));
86
+ }
87
+ }
88
+ else {
89
+ if (urlSearchParams.has(key)) {
90
+ urlSearchParams.append(key, parameter);
91
+ }
92
+ else {
93
+ urlSearchParams.set(key, parameter);
94
+ }
95
+ }
96
+ }
97
+ const setSearchParams = function (url, ...objects) {
98
+ const searchParams = new URLSearchParams(url.search);
99
+ setFlattenedQueryParams(searchParams, objects);
100
+ url.search = searchParams.toString();
101
+ };
102
+ exports.setSearchParams = setSearchParams;
103
+ /**
104
+ * JSON serialization helper function which replaces instances of unserializable types with serializable ones.
105
+ * This function will run for every key-value pair encountered by JSON.stringify while traversing an object.
106
+ * Converting a set to a string will return an empty object, so an intermediate conversion to an array is required.
107
+ */
108
+ // @ts-ignore
109
+ const replaceWithSerializableTypeIfNeeded = function (key, value) {
110
+ if (value instanceof Set) {
111
+ return Array.from(value);
112
+ }
113
+ else {
114
+ return value;
115
+ }
116
+ };
117
+ exports.replaceWithSerializableTypeIfNeeded = replaceWithSerializableTypeIfNeeded;
118
+ const serializeDataIfNeeded = function (value, requestOptions, configuration) {
119
+ const nonString = typeof value !== 'string';
120
+ const needsSerialization = nonString && configuration && configuration.isJsonMime
121
+ ? configuration.isJsonMime(requestOptions.headers['Content-Type'])
122
+ : nonString;
123
+ return needsSerialization
124
+ ? JSON.stringify(value !== undefined ? value : {}, exports.replaceWithSerializableTypeIfNeeded)
125
+ : (value || "");
126
+ };
127
+ exports.serializeDataIfNeeded = serializeDataIfNeeded;
128
+ const toPathString = function (url) {
129
+ return url.pathname + url.search + url.hash;
130
+ };
131
+ exports.toPathString = toPathString;
132
+ const createRequestFunction = function (axiosArgs, globalAxios, BASE_PATH, configuration) {
133
+ return (axios = globalAxios, basePath = BASE_PATH) => {
134
+ var _a;
135
+ const axiosRequestArgs = Object.assign(Object.assign({}, axiosArgs.options), { url: (axios.defaults.baseURL ? '' : (_a = configuration === null || configuration === void 0 ? void 0 : configuration.basePath) !== null && _a !== void 0 ? _a : basePath) + axiosArgs.url });
136
+ return axios.request(axiosRequestArgs);
137
+ };
138
+ };
139
+ exports.createRequestFunction = createRequestFunction;
@@ -0,0 +1,98 @@
1
+ /**
2
+ * Triveria Wallet API
3
+ * Triveria Wallet is a cloud-based platform for managing digital credentials. The platform complies with open standards including the W3C Verifiable Credentials Data Model, IETF SD-JWT-VC, MSO Mdoc, OpenID Connect (OIDC), and EBSI DID, providing a unified interface across both eIDAS/EUDI and DID/W3C ecosystems. **Key capabilities:** - Issue and manage Verifiable Credentials (W3C VC, SD-JWT-VC and MSO Mdoc formats) - Credential signing using DIDs, X.509 certificates, and standard JWK keys - Trust framework integration: EBSI Trust Framework, EUDI Large Scale Pilot trust lists, and IDUnion - REST API and SDK access for seamless integration For access and support, contact info@triveria.com.
4
+ *
5
+ * The version of the OpenAPI document: dev.c46c1cf
6
+ *
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ interface AWSv4Configuration {
13
+ options?: {
14
+ region?: string;
15
+ service?: string;
16
+ };
17
+ credentials?: {
18
+ accessKeyId?: string;
19
+ secretAccessKey?: string;
20
+ sessionToken?: string;
21
+ };
22
+ }
23
+ export interface ConfigurationParameters {
24
+ apiKey?: string | Promise<string> | ((name: string) => string) | ((name: string) => Promise<string>);
25
+ username?: string;
26
+ password?: string;
27
+ accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise<string>);
28
+ awsv4?: AWSv4Configuration;
29
+ basePath?: string;
30
+ serverIndex?: number;
31
+ baseOptions?: any;
32
+ formDataCtor?: new () => any;
33
+ }
34
+ export declare class Configuration {
35
+ /**
36
+ * parameter for apiKey security
37
+ * @param name security name
38
+ */
39
+ apiKey?: string | Promise<string> | ((name: string) => string) | ((name: string) => Promise<string>);
40
+ /**
41
+ * parameter for basic security
42
+ */
43
+ username?: string;
44
+ /**
45
+ * parameter for basic security
46
+ */
47
+ password?: string;
48
+ /**
49
+ * parameter for oauth2 security
50
+ * @param name security name
51
+ * @param scopes oauth2 scope
52
+ */
53
+ accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise<string>);
54
+ /**
55
+ * parameter for aws4 signature security
56
+ * @param {Object} AWS4Signature - AWS4 Signature security
57
+ * @param {string} options.region - aws region
58
+ * @param {string} options.service - name of the service.
59
+ * @param {string} credentials.accessKeyId - aws access key id
60
+ * @param {string} credentials.secretAccessKey - aws access key
61
+ * @param {string} credentials.sessionToken - aws session token
62
+ * @memberof Configuration
63
+ */
64
+ awsv4?: AWSv4Configuration;
65
+ /**
66
+ * override base path
67
+ */
68
+ basePath?: string;
69
+ /**
70
+ * override server index
71
+ */
72
+ serverIndex?: number;
73
+ /**
74
+ * base options for axios calls
75
+ */
76
+ baseOptions?: any;
77
+ /**
78
+ * The FormData constructor that will be used to create multipart form data
79
+ * requests. You can inject this here so that execution environments that
80
+ * do not support the FormData class can still run the generated client.
81
+ *
82
+ * @type {new () => FormData}
83
+ */
84
+ formDataCtor?: new () => any;
85
+ constructor(param?: ConfigurationParameters);
86
+ /**
87
+ * Check if the given MIME is a JSON MIME.
88
+ * JSON MIME examples:
89
+ * application/json
90
+ * application/json; charset=UTF8
91
+ * APPLICATION/JSON
92
+ * application/vnd.company+json
93
+ * @param mime - MIME (Multipurpose Internet Mail Extensions)
94
+ * @return True if the given MIME is JSON, false otherwise.
95
+ */
96
+ isJsonMime(mime: string): boolean;
97
+ }
98
+ export {};
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /**
4
+ * Triveria Wallet API
5
+ * Triveria Wallet is a cloud-based platform for managing digital credentials. The platform complies with open standards including the W3C Verifiable Credentials Data Model, IETF SD-JWT-VC, MSO Mdoc, OpenID Connect (OIDC), and EBSI DID, providing a unified interface across both eIDAS/EUDI and DID/W3C ecosystems. **Key capabilities:** - Issue and manage Verifiable Credentials (W3C VC, SD-JWT-VC and MSO Mdoc formats) - Credential signing using DIDs, X.509 certificates, and standard JWK keys - Trust framework integration: EBSI Trust Framework, EUDI Large Scale Pilot trust lists, and IDUnion - REST API and SDK access for seamless integration For access and support, contact info@triveria.com.
6
+ *
7
+ * The version of the OpenAPI document: dev.c46c1cf
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.Configuration = void 0;
16
+ class Configuration {
17
+ constructor(param = {}) {
18
+ var _a;
19
+ this.apiKey = param.apiKey;
20
+ this.username = param.username;
21
+ this.password = param.password;
22
+ this.accessToken = param.accessToken;
23
+ this.awsv4 = param.awsv4;
24
+ this.basePath = param.basePath;
25
+ this.serverIndex = param.serverIndex;
26
+ this.baseOptions = Object.assign(Object.assign({}, param.baseOptions), { headers: Object.assign({}, (_a = param.baseOptions) === null || _a === void 0 ? void 0 : _a.headers) });
27
+ this.formDataCtor = param.formDataCtor;
28
+ }
29
+ /**
30
+ * Check if the given MIME is a JSON MIME.
31
+ * JSON MIME examples:
32
+ * application/json
33
+ * application/json; charset=UTF8
34
+ * APPLICATION/JSON
35
+ * application/vnd.company+json
36
+ * @param mime - MIME (Multipurpose Internet Mail Extensions)
37
+ * @return True if the given MIME is JSON, false otherwise.
38
+ */
39
+ isJsonMime(mime) {
40
+ const jsonMime = /^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$/i;
41
+ return mime !== null && jsonMime.test(mime);
42
+ }
43
+ }
44
+ exports.Configuration = Configuration;
package/index.d.ts ADDED
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Triveria Wallet API
3
+ * Triveria Wallet is a cloud-based platform for managing digital credentials. The platform complies with open standards including the W3C Verifiable Credentials Data Model, IETF SD-JWT-VC, MSO Mdoc, OpenID Connect (OIDC), and EBSI DID, providing a unified interface across both eIDAS/EUDI and DID/W3C ecosystems. **Key capabilities:** - Issue and manage Verifiable Credentials (W3C VC, SD-JWT-VC and MSO Mdoc formats) - Credential signing using DIDs, X.509 certificates, and standard JWK keys - Trust framework integration: EBSI Trust Framework, EUDI Large Scale Pilot trust lists, and IDUnion - REST API and SDK access for seamless integration For access and support, contact info@triveria.com.
4
+ *
5
+ * The version of the OpenAPI document: dev.c46c1cf
6
+ *
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ export * from "./api";
13
+ export * from "./configuration";
14
+ export * from "./client";
15
+ export * from "./auth";
package/index.js ADDED
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * Triveria Wallet API
6
+ * Triveria Wallet is a cloud-based platform for managing digital credentials. The platform complies with open standards including the W3C Verifiable Credentials Data Model, IETF SD-JWT-VC, MSO Mdoc, OpenID Connect (OIDC), and EBSI DID, providing a unified interface across both eIDAS/EUDI and DID/W3C ecosystems. **Key capabilities:** - Issue and manage Verifiable Credentials (W3C VC, SD-JWT-VC and MSO Mdoc formats) - Credential signing using DIDs, X.509 certificates, and standard JWK keys - Trust framework integration: EBSI Trust Framework, EUDI Large Scale Pilot trust lists, and IDUnion - REST API and SDK access for seamless integration For access and support, contact info@triveria.com.
7
+ *
8
+ * The version of the OpenAPI document: dev.c46c1cf
9
+ *
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
16
+ if (k2 === undefined) k2 = k;
17
+ var desc = Object.getOwnPropertyDescriptor(m, k);
18
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
19
+ desc = { enumerable: true, get: function() { return m[k]; } };
20
+ }
21
+ Object.defineProperty(o, k2, desc);
22
+ }) : (function(o, m, k, k2) {
23
+ if (k2 === undefined) k2 = k;
24
+ o[k2] = m[k];
25
+ }));
26
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
27
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
28
+ };
29
+ Object.defineProperty(exports, "__esModule", { value: true });
30
+ __exportStar(require("./api"), exports);
31
+ __exportStar(require("./configuration"), exports);
32
+ __exportStar(require("./client"), exports);
33
+ __exportStar(require("./auth"), exports);
@@ -0,0 +1,96 @@
1
+ /**
2
+ * Hand-written client for the `walletNotifications` SSE endpoint.
3
+ *
4
+ * This file is NOT managed by the OpenAPI generator (see .openapi-generator/FILES) -
5
+ * it builds on top of the generated request builder in `api.ts` to provide an
6
+ * ergonomic Node.js client for the `GET /wallets/{wallet_id}/notifications`
7
+ * `text/event-stream` endpoint, including reconnect-with-replay via `Last-Event-ID`.
8
+ */
9
+ import { EventEmitter } from 'events';
10
+ import type { AxiosInstance } from 'axios';
11
+ import { Configuration } from './configuration';
12
+ import { WalletNotification } from './api';
13
+ export interface WalletNotificationStreamOptions {
14
+ /** Filter the stream to a single notification event type. */
15
+ eventType?: string;
16
+ /** Filter the stream to a single notification state. */
17
+ state?: string;
18
+ /** Resume the stream after this event ID (queued notification replay). */
19
+ lastEventId?: string;
20
+ /** Axios instance to use for the underlying request. Defaults to the global axios instance. */
21
+ axios?: AxiosInstance;
22
+ /** Overrides the base path used to reach the API. */
23
+ basePath?: string;
24
+ /** Automatically reconnect (with replay via Last-Event-ID) when the stream drops. Defaults to true. */
25
+ reconnect?: boolean;
26
+ /** Delay before reconnecting when the server hasn't sent an SSE `retry:` field. Defaults to 3000ms. */
27
+ retryDelayMs?: number;
28
+ /** Upper bound for the reconnect delay, including any server-provided `retry:` value. Defaults to 30000ms. */
29
+ maxRetryDelayMs?: number;
30
+ }
31
+ export declare interface WalletNotificationStream {
32
+ on(event: 'open', listener: () => void): this;
33
+ on(event: 'notification', listener: (notification: WalletNotification) => void): this;
34
+ on(event: 'error', listener: (error: Error) => void): this;
35
+ on(event: 'close', listener: () => void): this;
36
+ once(event: 'open', listener: () => void): this;
37
+ once(event: 'notification', listener: (notification: WalletNotification) => void): this;
38
+ once(event: 'error', listener: (error: Error) => void): this;
39
+ once(event: 'close', listener: () => void): this;
40
+ }
41
+ /**
42
+ * Live stream of wallet notifications over `GET /wallets/{wallet_id}/notifications`.
43
+ *
44
+ * Emits `open`, `notification`, `error` and `close` events, and is itself an
45
+ * async iterable of {@link WalletNotification}:
46
+ *
47
+ * ```ts
48
+ * const stream = new WalletNotificationStream(configuration, walletId);
49
+ * for await (const notification of stream) {
50
+ * console.log(notification);
51
+ * }
52
+ * ```
53
+ *
54
+ * Drops are reconnected automatically (replaying queued notifications via
55
+ * `Last-Event-ID`) unless `options.reconnect` is set to `false`. The current
56
+ * `Last-Event-ID` is exposed via {@link WalletNotificationStream.lastEventId}
57
+ * so it can be persisted and used to resume the stream later, e.g. across
58
+ * process restarts.
59
+ */
60
+ export declare class WalletNotificationStream extends EventEmitter implements AsyncIterable<WalletNotification> {
61
+ private readonly configuration;
62
+ private readonly walletId;
63
+ private readonly axiosInstance;
64
+ private readonly basePath;
65
+ private readonly eventType?;
66
+ private readonly state?;
67
+ private readonly reconnect;
68
+ private readonly retryDelayMs;
69
+ private readonly maxRetryDelayMs;
70
+ private _lastEventId?;
71
+ private nextRetryDelayMs?;
72
+ private abortController?;
73
+ private retryTimer?;
74
+ private closed;
75
+ private readonly queue;
76
+ private readonly waiters;
77
+ constructor(configuration: Configuration, walletId: string, options?: WalletNotificationStreamOptions);
78
+ /** Stops the stream and prevents further reconnection attempts. */
79
+ close(): void;
80
+ get isClosed(): boolean;
81
+ /**
82
+ * The ID of the last SSE event received on this stream (per the `id:` field),
83
+ * or the `lastEventId` the stream was constructed/reconnected with if no event
84
+ * has been received yet.
85
+ *
86
+ * Persist this value and pass it back as `options.lastEventId` when creating a
87
+ * new {@link WalletNotificationStream} (e.g. after a process restart) to resume
88
+ * the stream and replay any notifications queued since that event.
89
+ */
90
+ get lastEventId(): string | undefined;
91
+ private connect;
92
+ private scheduleReconnect;
93
+ private dispatchToQueue;
94
+ private settleWaiters;
95
+ [Symbol.asyncIterator](): AsyncIterator<WalletNotification>;
96
+ }