@paid-ai/paid-node 1.0.1-alpha9 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -2
- package/dist/cjs/Client.js +2 -2
- package/dist/cjs/api/resources/contacts/client/Client.d.ts +0 -2
- package/dist/cjs/api/resources/contacts/client/Client.js +0 -2
- package/dist/cjs/api/resources/contacts/client/requests/CreateContactRequest.d.ts +13 -4
- package/dist/cjs/api/resources/contacts/client/requests/CreateContactRequest.js +11 -0
- package/dist/cjs/api/resources/orders/client/requests/CreateOrderRequest.d.ts +1 -0
- package/dist/cjs/api/types/Contact.d.ts +11 -0
- package/dist/cjs/api/types/Contact.js +11 -0
- package/dist/cjs/api/types/CreateOrderLineAttributeRequest.d.ts +5 -0
- package/dist/cjs/api/types/CreateOrderLineAttributeRequest.js +3 -0
- package/dist/cjs/api/types/CreateOrderLineRequest.d.ts +9 -0
- package/dist/cjs/api/types/CreateOrderLineRequest.js +3 -0
- package/dist/cjs/api/types/Signal.d.ts +2 -0
- package/dist/cjs/api/types/UpdateContactRequest.d.ts +11 -0
- package/dist/cjs/api/types/UpdateContactRequest.js +11 -0
- package/dist/cjs/api/types/index.d.ts +2 -0
- package/dist/cjs/api/types/index.js +2 -0
- package/dist/cjs/tracing/index.d.ts +3 -2
- package/dist/cjs/tracing/index.js +2 -1
- package/dist/cjs/tracing/tracing.d.ts +7 -1
- package/dist/cjs/tracing/tracing.js +23 -8
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/Client.mjs +2 -2
- package/dist/esm/api/resources/contacts/client/Client.d.mts +0 -2
- package/dist/esm/api/resources/contacts/client/Client.mjs +0 -2
- package/dist/esm/api/resources/contacts/client/requests/CreateContactRequest.d.mts +13 -4
- package/dist/esm/api/resources/contacts/client/requests/CreateContactRequest.mjs +10 -1
- package/dist/esm/api/resources/orders/client/requests/CreateOrderRequest.d.mts +1 -0
- package/dist/esm/api/types/Contact.d.mts +11 -0
- package/dist/esm/api/types/Contact.mjs +10 -1
- package/dist/esm/api/types/CreateOrderLineAttributeRequest.d.mts +5 -0
- package/dist/esm/api/types/CreateOrderLineAttributeRequest.mjs +2 -0
- package/dist/esm/api/types/CreateOrderLineRequest.d.mts +9 -0
- package/dist/esm/api/types/CreateOrderLineRequest.mjs +2 -0
- package/dist/esm/api/types/Signal.d.mts +2 -0
- package/dist/esm/api/types/UpdateContactRequest.d.mts +11 -0
- package/dist/esm/api/types/UpdateContactRequest.mjs +10 -1
- package/dist/esm/api/types/index.d.mts +2 -0
- package/dist/esm/api/types/index.mjs +2 -0
- package/dist/esm/tracing/index.d.mts +3 -2
- package/dist/esm/tracing/index.mjs +2 -2
- package/dist/esm/tracing/tracing.d.mts +7 -1
- package/dist/esm/tracing/tracing.mjs +22 -8
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +216 -216
- package/reference.md +0 -2
package/README.md
CHANGED
|
@@ -290,7 +290,8 @@ const signal: Paid.Signal = {
|
|
|
290
290
|
amount: 0.002,
|
|
291
291
|
currency: "USD"
|
|
292
292
|
},
|
|
293
|
-
"gen_ai.response.model": "<ai_model_name>",
|
|
293
|
+
"gen_ai.response.model": "<ai_model_name>", // optional, but will be displayed on UI
|
|
294
|
+
start_time: "2024-01-01T11:45:00.000Z", // optional, affects where trace is on the timeline
|
|
294
295
|
}
|
|
295
296
|
}
|
|
296
297
|
};
|
|
@@ -319,7 +320,8 @@ async function main() {
|
|
|
319
320
|
amount: 0.002,
|
|
320
321
|
currency: "USD"
|
|
321
322
|
},
|
|
322
|
-
"gen_ai.response.model": "<ai_model_name>",
|
|
323
|
+
"gen_ai.response.model": "<ai_model_name>", // optional, but will be displayed on UI
|
|
324
|
+
start_time: "2024-01-01T11:45:00.000Z", // optional, affects where trace is on the timeline
|
|
323
325
|
}
|
|
324
326
|
});
|
|
325
327
|
});
|
package/dist/cjs/Client.js
CHANGED
|
@@ -48,8 +48,8 @@ class PaidClient {
|
|
|
48
48
|
this._options = Object.assign(Object.assign({}, _options), { headers: (0, headers_js_1.mergeHeaders)({
|
|
49
49
|
"X-Fern-Language": "JavaScript",
|
|
50
50
|
"X-Fern-SDK-Name": "@paid-ai/paid-node",
|
|
51
|
-
"X-Fern-SDK-Version": "1.0
|
|
52
|
-
"User-Agent": "@paid-ai/paid-node/1.0
|
|
51
|
+
"X-Fern-SDK-Version": "1.1.0",
|
|
52
|
+
"User-Agent": "@paid-ai/paid-node/1.1.0",
|
|
53
53
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
54
54
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
55
55
|
}, _options === null || _options === void 0 ? void 0 : _options.headers) });
|
|
@@ -3,17 +3,26 @@ import type * as Paid from "../../../../index.js";
|
|
|
3
3
|
* @example
|
|
4
4
|
* {
|
|
5
5
|
* customerId: "customerId",
|
|
6
|
-
* firstName: "firstName",
|
|
7
|
-
* lastName: "lastName",
|
|
8
6
|
* email: "email"
|
|
9
7
|
* }
|
|
10
8
|
*/
|
|
11
9
|
export interface CreateContactRequest {
|
|
12
10
|
customerId: string;
|
|
13
|
-
firstName
|
|
14
|
-
lastName
|
|
11
|
+
firstName?: string;
|
|
12
|
+
lastName?: string;
|
|
15
13
|
email: string;
|
|
16
14
|
phone?: string | null;
|
|
17
15
|
billingAddress?: Paid.ContactBillingAddress | null;
|
|
18
16
|
externalId?: string | null;
|
|
17
|
+
roles?: CreateContactRequest.Roles.Item[];
|
|
18
|
+
}
|
|
19
|
+
export declare namespace CreateContactRequest {
|
|
20
|
+
type Roles = Roles.Item[];
|
|
21
|
+
namespace Roles {
|
|
22
|
+
const Item: {
|
|
23
|
+
readonly Billing: "BILLING";
|
|
24
|
+
readonly AccountsPayable: "ACCOUNTS_PAYABLE";
|
|
25
|
+
};
|
|
26
|
+
type Item = (typeof Item)[keyof typeof Item];
|
|
27
|
+
}
|
|
19
28
|
}
|
|
@@ -1,3 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.CreateContactRequest = void 0;
|
|
5
|
+
var CreateContactRequest;
|
|
6
|
+
(function (CreateContactRequest) {
|
|
7
|
+
let Roles;
|
|
8
|
+
(function (Roles) {
|
|
9
|
+
Roles.Item = {
|
|
10
|
+
Billing: "BILLING",
|
|
11
|
+
AccountsPayable: "ACCOUNTS_PAYABLE",
|
|
12
|
+
};
|
|
13
|
+
})(Roles = CreateContactRequest.Roles || (CreateContactRequest.Roles = {}));
|
|
14
|
+
})(CreateContactRequest || (exports.CreateContactRequest = CreateContactRequest = {}));
|
|
@@ -8,6 +8,17 @@ export interface Contact {
|
|
|
8
8
|
phone: string | null;
|
|
9
9
|
billingAddress?: Paid.ContactBillingAddress | null;
|
|
10
10
|
externalId: string | null;
|
|
11
|
+
roles: Contact.Roles.Item[];
|
|
11
12
|
createdAt: string;
|
|
12
13
|
updatedAt: string;
|
|
13
14
|
}
|
|
15
|
+
export declare namespace Contact {
|
|
16
|
+
type Roles = Roles.Item[];
|
|
17
|
+
namespace Roles {
|
|
18
|
+
const Item: {
|
|
19
|
+
readonly Billing: "BILLING";
|
|
20
|
+
readonly AccountsPayable: "ACCOUNTS_PAYABLE";
|
|
21
|
+
};
|
|
22
|
+
type Item = (typeof Item)[keyof typeof Item];
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -1,3 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.Contact = void 0;
|
|
5
|
+
var Contact;
|
|
6
|
+
(function (Contact) {
|
|
7
|
+
let Roles;
|
|
8
|
+
(function (Roles) {
|
|
9
|
+
Roles.Item = {
|
|
10
|
+
Billing: "BILLING",
|
|
11
|
+
AccountsPayable: "ACCOUNTS_PAYABLE",
|
|
12
|
+
};
|
|
13
|
+
})(Roles = Contact.Roles || (Contact.Roles = {}));
|
|
14
|
+
})(Contact || (exports.Contact = Contact = {}));
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type * as Paid from "../index.js";
|
|
2
|
+
export interface CreateOrderLineRequest {
|
|
3
|
+
productId: string;
|
|
4
|
+
name?: string;
|
|
5
|
+
description?: string | null;
|
|
6
|
+
startDate?: string | null;
|
|
7
|
+
endDate?: string | null;
|
|
8
|
+
attributes?: Paid.CreateOrderLineAttributeRequest[];
|
|
9
|
+
}
|
|
@@ -3,6 +3,8 @@ export interface Signal {
|
|
|
3
3
|
eventName: string;
|
|
4
4
|
customer: Paid.CustomerAttribution;
|
|
5
5
|
attribution?: Paid.Attribution;
|
|
6
|
+
/** True event timestamp in RFC3339 format with timezone (e.g. 2026-01-31T23:00:00Z) */
|
|
7
|
+
timestamp?: string;
|
|
6
8
|
data?: Record<string, unknown>;
|
|
7
9
|
idempotencyKey?: string;
|
|
8
10
|
}
|
|
@@ -7,4 +7,15 @@ export interface UpdateContactRequest {
|
|
|
7
7
|
phone?: string | null;
|
|
8
8
|
billingAddress?: Paid.ContactBillingAddress | null;
|
|
9
9
|
externalId?: string | null;
|
|
10
|
+
roles?: UpdateContactRequest.Roles.Item[];
|
|
11
|
+
}
|
|
12
|
+
export declare namespace UpdateContactRequest {
|
|
13
|
+
type Roles = Roles.Item[];
|
|
14
|
+
namespace Roles {
|
|
15
|
+
const Item: {
|
|
16
|
+
readonly Billing: "BILLING";
|
|
17
|
+
readonly AccountsPayable: "ACCOUNTS_PAYABLE";
|
|
18
|
+
};
|
|
19
|
+
type Item = (typeof Item)[keyof typeof Item];
|
|
20
|
+
}
|
|
10
21
|
}
|
|
@@ -1,3 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.UpdateContactRequest = void 0;
|
|
5
|
+
var UpdateContactRequest;
|
|
6
|
+
(function (UpdateContactRequest) {
|
|
7
|
+
let Roles;
|
|
8
|
+
(function (Roles) {
|
|
9
|
+
Roles.Item = {
|
|
10
|
+
Billing: "BILLING",
|
|
11
|
+
AccountsPayable: "ACCOUNTS_PAYABLE",
|
|
12
|
+
};
|
|
13
|
+
})(Roles = UpdateContactRequest.Roles || (UpdateContactRequest.Roles = {}));
|
|
14
|
+
})(UpdateContactRequest || (exports.UpdateContactRequest = UpdateContactRequest = {}));
|
|
@@ -3,6 +3,8 @@ export * from "./BulkSignalsResponse.js";
|
|
|
3
3
|
export * from "./Contact.js";
|
|
4
4
|
export * from "./ContactBillingAddress.js";
|
|
5
5
|
export * from "./ContactListResponse.js";
|
|
6
|
+
export * from "./CreateOrderLineAttributeRequest.js";
|
|
7
|
+
export * from "./CreateOrderLineRequest.js";
|
|
6
8
|
export * from "./Customer.js";
|
|
7
9
|
export * from "./CustomerAttribution.js";
|
|
8
10
|
export * from "./CustomerBillingAddress.js";
|
|
@@ -19,6 +19,8 @@ __exportStar(require("./BulkSignalsResponse.js"), exports);
|
|
|
19
19
|
__exportStar(require("./Contact.js"), exports);
|
|
20
20
|
__exportStar(require("./ContactBillingAddress.js"), exports);
|
|
21
21
|
__exportStar(require("./ContactListResponse.js"), exports);
|
|
22
|
+
__exportStar(require("./CreateOrderLineAttributeRequest.js"), exports);
|
|
23
|
+
__exportStar(require("./CreateOrderLineRequest.js"), exports);
|
|
22
24
|
__exportStar(require("./Customer.js"), exports);
|
|
23
25
|
__exportStar(require("./CustomerAttribution.js"), exports);
|
|
24
26
|
__exportStar(require("./CustomerBillingAddress.js"), exports);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { getPaidTracer, getPaidTracerProvider, initializeTracing, trace } from "./tracing.js";
|
|
1
|
+
import { getPaidTracer, getPaidTracerProvider, initializeTracing, trace, createPaidSpanProcessors } from "./tracing.js";
|
|
2
2
|
import { signal } from "./signal.js";
|
|
3
3
|
import { AISDKSpanProcessor } from "./aiSdkSpanProcessor.js";
|
|
4
|
-
export {
|
|
4
|
+
export type { InitializeTracingOptions } from "./tracing.js";
|
|
5
|
+
export { getPaidTracer, getPaidTracerProvider, initializeTracing, trace, signal, AISDKSpanProcessor, createPaidSpanProcessors };
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AISDKSpanProcessor = exports.signal = exports.trace = exports.initializeTracing = exports.getPaidTracerProvider = exports.getPaidTracer = void 0;
|
|
3
|
+
exports.createPaidSpanProcessors = exports.AISDKSpanProcessor = exports.signal = exports.trace = exports.initializeTracing = exports.getPaidTracerProvider = exports.getPaidTracer = void 0;
|
|
4
4
|
const tracing_js_1 = require("./tracing.js");
|
|
5
5
|
Object.defineProperty(exports, "getPaidTracer", { enumerable: true, get: function () { return tracing_js_1.getPaidTracer; } });
|
|
6
6
|
Object.defineProperty(exports, "getPaidTracerProvider", { enumerable: true, get: function () { return tracing_js_1.getPaidTracerProvider; } });
|
|
7
7
|
Object.defineProperty(exports, "initializeTracing", { enumerable: true, get: function () { return tracing_js_1.initializeTracing; } });
|
|
8
8
|
Object.defineProperty(exports, "trace", { enumerable: true, get: function () { return tracing_js_1.trace; } });
|
|
9
|
+
Object.defineProperty(exports, "createPaidSpanProcessors", { enumerable: true, get: function () { return tracing_js_1.createPaidSpanProcessors; } });
|
|
9
10
|
const signal_js_1 = require("./signal.js");
|
|
10
11
|
Object.defineProperty(exports, "signal", { enumerable: true, get: function () { return signal_js_1.signal; } });
|
|
11
12
|
const aiSdkSpanProcessor_js_1 = require("./aiSdkSpanProcessor.js");
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import type { Tracer } from "@opentelemetry/api";
|
|
2
|
+
import type { SpanProcessor } from "@opentelemetry/sdk-trace-base";
|
|
2
3
|
import { NodeTracerProvider } from "@opentelemetry/sdk-trace-node";
|
|
4
|
+
export interface InitializeTracingOptions {
|
|
5
|
+
collectorEndpoint?: string;
|
|
6
|
+
registerGlobal?: boolean;
|
|
7
|
+
}
|
|
3
8
|
export declare function getToken(): string | undefined;
|
|
4
9
|
export declare function getPaidTracerProvider(): NodeTracerProvider | undefined;
|
|
5
10
|
export declare function getPaidTracer(): Tracer | undefined;
|
|
6
|
-
export declare function
|
|
11
|
+
export declare function createPaidSpanProcessors(apiKey: string, collectorEndpoint?: string): SpanProcessor[];
|
|
12
|
+
export declare function initializeTracing(apiKey?: string, options?: InitializeTracingOptions): void;
|
|
7
13
|
export declare function trace<F extends (...args: any[]) => any>(options: {
|
|
8
14
|
externalCustomerId: string;
|
|
9
15
|
externalProductId?: string;
|
|
@@ -12,6 +12,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.getToken = getToken;
|
|
13
13
|
exports.getPaidTracerProvider = getPaidTracerProvider;
|
|
14
14
|
exports.getPaidTracer = getPaidTracer;
|
|
15
|
+
exports.createPaidSpanProcessors = createPaidSpanProcessors;
|
|
15
16
|
exports.initializeTracing = initializeTracing;
|
|
16
17
|
exports.trace = trace;
|
|
17
18
|
const api_1 = require("@opentelemetry/api");
|
|
@@ -49,7 +50,12 @@ const setupGracefulShutdown = (shuttable) => {
|
|
|
49
50
|
});
|
|
50
51
|
});
|
|
51
52
|
};
|
|
52
|
-
function
|
|
53
|
+
function createPaidSpanProcessors(apiKey, collectorEndpoint) {
|
|
54
|
+
const url = collectorEndpoint || DEFAULT_COLLECTOR_ENDPOINT;
|
|
55
|
+
const exporter = new exporter_trace_otlp_http_1.OTLPTraceExporter({ url, headers: { Authorization: `Bearer ${apiKey}` } });
|
|
56
|
+
return [new spanProcessor_js_1.PaidSpanProcessor(), new aiSdkSpanProcessor_js_1.AISDKSpanProcessor(), new sdk_trace_node_1.SimpleSpanProcessor(exporter)];
|
|
57
|
+
}
|
|
58
|
+
function initializeTracing(apiKey, options) {
|
|
53
59
|
const paidEnabled = (process.env.PAID_ENABLED || "true") !== "false";
|
|
54
60
|
if (!paidEnabled) {
|
|
55
61
|
console.info("Paid tracing is disabled via PAID_ENABLED environment variable");
|
|
@@ -71,6 +77,7 @@ function initializeTracing(apiKey, collectorEndpoint) {
|
|
|
71
77
|
else {
|
|
72
78
|
paidApiToken = apiKey;
|
|
73
79
|
}
|
|
80
|
+
const { collectorEndpoint, registerGlobal = false } = options || {};
|
|
74
81
|
const url = collectorEndpoint || DEFAULT_COLLECTOR_ENDPOINT;
|
|
75
82
|
const exporter = new exporter_trace_otlp_http_1.OTLPTraceExporter({ url, headers: { Authorization: `Bearer ${paidApiToken}` } });
|
|
76
83
|
const spanProcessor = new sdk_trace_node_1.SimpleSpanProcessor(exporter);
|
|
@@ -79,13 +86,21 @@ function initializeTracing(apiKey, collectorEndpoint) {
|
|
|
79
86
|
paidTracerProvider = new sdk_trace_node_1.NodeTracerProvider({
|
|
80
87
|
spanProcessors: [new spanProcessor_js_1.PaidSpanProcessor(), new aiSdkSpanProcessor_js_1.AISDKSpanProcessor(), spanProcessor],
|
|
81
88
|
});
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
+
if (registerGlobal) {
|
|
90
|
+
// Register the provider globally so that any tracer (including the AI SDK's
|
|
91
|
+
// `trace.getTracer("ai")`) routes spans through our span processors.
|
|
92
|
+
// This also sets up an AsyncLocalStorageContextManager for context propagation.
|
|
93
|
+
paidTracerProvider.register();
|
|
94
|
+
}
|
|
95
|
+
else {
|
|
96
|
+
// Set up context propagation without registering the provider globally.
|
|
97
|
+
// This gives us async parent-child linking via AsyncLocalStorage
|
|
98
|
+
// without polluting the global trace provider.
|
|
99
|
+
const contextManager = new context_async_hooks_1.AsyncLocalStorageContextManager();
|
|
100
|
+
contextManager.enable();
|
|
101
|
+
if (!api_1.context.setGlobalContextManager(contextManager)) {
|
|
102
|
+
contextManager.disable();
|
|
103
|
+
}
|
|
89
104
|
}
|
|
90
105
|
paidTracer = paidTracerProvider.getTracer("paid.node");
|
|
91
106
|
setupGracefulShutdown(spanProcessor);
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "1.0
|
|
1
|
+
export declare const SDK_VERSION = "1.1.0";
|
package/dist/cjs/version.js
CHANGED
package/dist/esm/Client.mjs
CHANGED
|
@@ -12,8 +12,8 @@ export class PaidClient {
|
|
|
12
12
|
this._options = Object.assign(Object.assign({}, _options), { headers: mergeHeaders({
|
|
13
13
|
"X-Fern-Language": "JavaScript",
|
|
14
14
|
"X-Fern-SDK-Name": "@paid-ai/paid-node",
|
|
15
|
-
"X-Fern-SDK-Version": "1.0
|
|
16
|
-
"User-Agent": "@paid-ai/paid-node/1.0
|
|
15
|
+
"X-Fern-SDK-Version": "1.1.0",
|
|
16
|
+
"User-Agent": "@paid-ai/paid-node/1.1.0",
|
|
17
17
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
18
18
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
19
19
|
}, _options === null || _options === void 0 ? void 0 : _options.headers) });
|
|
@@ -3,17 +3,26 @@ import type * as Paid from "../../../../index.mjs";
|
|
|
3
3
|
* @example
|
|
4
4
|
* {
|
|
5
5
|
* customerId: "customerId",
|
|
6
|
-
* firstName: "firstName",
|
|
7
|
-
* lastName: "lastName",
|
|
8
6
|
* email: "email"
|
|
9
7
|
* }
|
|
10
8
|
*/
|
|
11
9
|
export interface CreateContactRequest {
|
|
12
10
|
customerId: string;
|
|
13
|
-
firstName
|
|
14
|
-
lastName
|
|
11
|
+
firstName?: string;
|
|
12
|
+
lastName?: string;
|
|
15
13
|
email: string;
|
|
16
14
|
phone?: string | null;
|
|
17
15
|
billingAddress?: Paid.ContactBillingAddress | null;
|
|
18
16
|
externalId?: string | null;
|
|
17
|
+
roles?: CreateContactRequest.Roles.Item[];
|
|
18
|
+
}
|
|
19
|
+
export declare namespace CreateContactRequest {
|
|
20
|
+
type Roles = Roles.Item[];
|
|
21
|
+
namespace Roles {
|
|
22
|
+
const Item: {
|
|
23
|
+
readonly Billing: "BILLING";
|
|
24
|
+
readonly AccountsPayable: "ACCOUNTS_PAYABLE";
|
|
25
|
+
};
|
|
26
|
+
type Item = (typeof Item)[keyof typeof Item];
|
|
27
|
+
}
|
|
19
28
|
}
|
|
@@ -1,2 +1,11 @@
|
|
|
1
1
|
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
-
export
|
|
2
|
+
export var CreateContactRequest;
|
|
3
|
+
(function (CreateContactRequest) {
|
|
4
|
+
let Roles;
|
|
5
|
+
(function (Roles) {
|
|
6
|
+
Roles.Item = {
|
|
7
|
+
Billing: "BILLING",
|
|
8
|
+
AccountsPayable: "ACCOUNTS_PAYABLE",
|
|
9
|
+
};
|
|
10
|
+
})(Roles = CreateContactRequest.Roles || (CreateContactRequest.Roles = {}));
|
|
11
|
+
})(CreateContactRequest || (CreateContactRequest = {}));
|
|
@@ -8,6 +8,17 @@ export interface Contact {
|
|
|
8
8
|
phone: string | null;
|
|
9
9
|
billingAddress?: Paid.ContactBillingAddress | null;
|
|
10
10
|
externalId: string | null;
|
|
11
|
+
roles: Contact.Roles.Item[];
|
|
11
12
|
createdAt: string;
|
|
12
13
|
updatedAt: string;
|
|
13
14
|
}
|
|
15
|
+
export declare namespace Contact {
|
|
16
|
+
type Roles = Roles.Item[];
|
|
17
|
+
namespace Roles {
|
|
18
|
+
const Item: {
|
|
19
|
+
readonly Billing: "BILLING";
|
|
20
|
+
readonly AccountsPayable: "ACCOUNTS_PAYABLE";
|
|
21
|
+
};
|
|
22
|
+
type Item = (typeof Item)[keyof typeof Item];
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -1,2 +1,11 @@
|
|
|
1
1
|
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
-
export
|
|
2
|
+
export var Contact;
|
|
3
|
+
(function (Contact) {
|
|
4
|
+
let Roles;
|
|
5
|
+
(function (Roles) {
|
|
6
|
+
Roles.Item = {
|
|
7
|
+
Billing: "BILLING",
|
|
8
|
+
AccountsPayable: "ACCOUNTS_PAYABLE",
|
|
9
|
+
};
|
|
10
|
+
})(Roles = Contact.Roles || (Contact.Roles = {}));
|
|
11
|
+
})(Contact || (Contact = {}));
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type * as Paid from "../index.mjs";
|
|
2
|
+
export interface CreateOrderLineRequest {
|
|
3
|
+
productId: string;
|
|
4
|
+
name?: string;
|
|
5
|
+
description?: string | null;
|
|
6
|
+
startDate?: string | null;
|
|
7
|
+
endDate?: string | null;
|
|
8
|
+
attributes?: Paid.CreateOrderLineAttributeRequest[];
|
|
9
|
+
}
|
|
@@ -3,6 +3,8 @@ export interface Signal {
|
|
|
3
3
|
eventName: string;
|
|
4
4
|
customer: Paid.CustomerAttribution;
|
|
5
5
|
attribution?: Paid.Attribution;
|
|
6
|
+
/** True event timestamp in RFC3339 format with timezone (e.g. 2026-01-31T23:00:00Z) */
|
|
7
|
+
timestamp?: string;
|
|
6
8
|
data?: Record<string, unknown>;
|
|
7
9
|
idempotencyKey?: string;
|
|
8
10
|
}
|
|
@@ -7,4 +7,15 @@ export interface UpdateContactRequest {
|
|
|
7
7
|
phone?: string | null;
|
|
8
8
|
billingAddress?: Paid.ContactBillingAddress | null;
|
|
9
9
|
externalId?: string | null;
|
|
10
|
+
roles?: UpdateContactRequest.Roles.Item[];
|
|
11
|
+
}
|
|
12
|
+
export declare namespace UpdateContactRequest {
|
|
13
|
+
type Roles = Roles.Item[];
|
|
14
|
+
namespace Roles {
|
|
15
|
+
const Item: {
|
|
16
|
+
readonly Billing: "BILLING";
|
|
17
|
+
readonly AccountsPayable: "ACCOUNTS_PAYABLE";
|
|
18
|
+
};
|
|
19
|
+
type Item = (typeof Item)[keyof typeof Item];
|
|
20
|
+
}
|
|
10
21
|
}
|
|
@@ -1,2 +1,11 @@
|
|
|
1
1
|
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
-
export
|
|
2
|
+
export var UpdateContactRequest;
|
|
3
|
+
(function (UpdateContactRequest) {
|
|
4
|
+
let Roles;
|
|
5
|
+
(function (Roles) {
|
|
6
|
+
Roles.Item = {
|
|
7
|
+
Billing: "BILLING",
|
|
8
|
+
AccountsPayable: "ACCOUNTS_PAYABLE",
|
|
9
|
+
};
|
|
10
|
+
})(Roles = UpdateContactRequest.Roles || (UpdateContactRequest.Roles = {}));
|
|
11
|
+
})(UpdateContactRequest || (UpdateContactRequest = {}));
|
|
@@ -3,6 +3,8 @@ export * from "./BulkSignalsResponse.mjs";
|
|
|
3
3
|
export * from "./Contact.mjs";
|
|
4
4
|
export * from "./ContactBillingAddress.mjs";
|
|
5
5
|
export * from "./ContactListResponse.mjs";
|
|
6
|
+
export * from "./CreateOrderLineAttributeRequest.mjs";
|
|
7
|
+
export * from "./CreateOrderLineRequest.mjs";
|
|
6
8
|
export * from "./Customer.mjs";
|
|
7
9
|
export * from "./CustomerAttribution.mjs";
|
|
8
10
|
export * from "./CustomerBillingAddress.mjs";
|
|
@@ -3,6 +3,8 @@ export * from "./BulkSignalsResponse.mjs";
|
|
|
3
3
|
export * from "./Contact.mjs";
|
|
4
4
|
export * from "./ContactBillingAddress.mjs";
|
|
5
5
|
export * from "./ContactListResponse.mjs";
|
|
6
|
+
export * from "./CreateOrderLineAttributeRequest.mjs";
|
|
7
|
+
export * from "./CreateOrderLineRequest.mjs";
|
|
6
8
|
export * from "./Customer.mjs";
|
|
7
9
|
export * from "./CustomerAttribution.mjs";
|
|
8
10
|
export * from "./CustomerBillingAddress.mjs";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { getPaidTracer, getPaidTracerProvider, initializeTracing, trace } from "./tracing.mjs";
|
|
1
|
+
import { getPaidTracer, getPaidTracerProvider, initializeTracing, trace, createPaidSpanProcessors } from "./tracing.mjs";
|
|
2
2
|
import { signal } from "./signal.mjs";
|
|
3
3
|
import { AISDKSpanProcessor } from "./aiSdkSpanProcessor.mjs";
|
|
4
|
-
export {
|
|
4
|
+
export type { InitializeTracingOptions } from "./tracing.mjs";
|
|
5
|
+
export { getPaidTracer, getPaidTracerProvider, initializeTracing, trace, signal, AISDKSpanProcessor, createPaidSpanProcessors };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getPaidTracer, getPaidTracerProvider, initializeTracing, trace } from "./tracing.mjs";
|
|
1
|
+
import { getPaidTracer, getPaidTracerProvider, initializeTracing, trace, createPaidSpanProcessors } from "./tracing.mjs";
|
|
2
2
|
import { signal } from "./signal.mjs";
|
|
3
3
|
import { AISDKSpanProcessor } from "./aiSdkSpanProcessor.mjs";
|
|
4
|
-
export { getPaidTracer, getPaidTracerProvider, initializeTracing, trace, signal, AISDKSpanProcessor };
|
|
4
|
+
export { getPaidTracer, getPaidTracerProvider, initializeTracing, trace, signal, AISDKSpanProcessor, createPaidSpanProcessors };
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import type { Tracer } from "@opentelemetry/api";
|
|
2
|
+
import type { SpanProcessor } from "@opentelemetry/sdk-trace-base";
|
|
2
3
|
import { NodeTracerProvider } from "@opentelemetry/sdk-trace-node";
|
|
4
|
+
export interface InitializeTracingOptions {
|
|
5
|
+
collectorEndpoint?: string;
|
|
6
|
+
registerGlobal?: boolean;
|
|
7
|
+
}
|
|
3
8
|
export declare function getToken(): string | undefined;
|
|
4
9
|
export declare function getPaidTracerProvider(): NodeTracerProvider | undefined;
|
|
5
10
|
export declare function getPaidTracer(): Tracer | undefined;
|
|
6
|
-
export declare function
|
|
11
|
+
export declare function createPaidSpanProcessors(apiKey: string, collectorEndpoint?: string): SpanProcessor[];
|
|
12
|
+
export declare function initializeTracing(apiKey?: string, options?: InitializeTracingOptions): void;
|
|
7
13
|
export declare function trace<F extends (...args: any[]) => any>(options: {
|
|
8
14
|
externalCustomerId: string;
|
|
9
15
|
externalProductId?: string;
|
|
@@ -42,7 +42,12 @@ const setupGracefulShutdown = (shuttable) => {
|
|
|
42
42
|
});
|
|
43
43
|
});
|
|
44
44
|
};
|
|
45
|
-
export function
|
|
45
|
+
export function createPaidSpanProcessors(apiKey, collectorEndpoint) {
|
|
46
|
+
const url = collectorEndpoint || DEFAULT_COLLECTOR_ENDPOINT;
|
|
47
|
+
const exporter = new OTLPTraceExporter({ url, headers: { Authorization: `Bearer ${apiKey}` } });
|
|
48
|
+
return [new PaidSpanProcessor(), new AISDKSpanProcessor(), new SimpleSpanProcessor(exporter)];
|
|
49
|
+
}
|
|
50
|
+
export function initializeTracing(apiKey, options) {
|
|
46
51
|
const paidEnabled = (process.env.PAID_ENABLED || "true") !== "false";
|
|
47
52
|
if (!paidEnabled) {
|
|
48
53
|
console.info("Paid tracing is disabled via PAID_ENABLED environment variable");
|
|
@@ -64,6 +69,7 @@ export function initializeTracing(apiKey, collectorEndpoint) {
|
|
|
64
69
|
else {
|
|
65
70
|
paidApiToken = apiKey;
|
|
66
71
|
}
|
|
72
|
+
const { collectorEndpoint, registerGlobal = false } = options || {};
|
|
67
73
|
const url = collectorEndpoint || DEFAULT_COLLECTOR_ENDPOINT;
|
|
68
74
|
const exporter = new OTLPTraceExporter({ url, headers: { Authorization: `Bearer ${paidApiToken}` } });
|
|
69
75
|
const spanProcessor = new SimpleSpanProcessor(exporter);
|
|
@@ -72,13 +78,21 @@ export function initializeTracing(apiKey, collectorEndpoint) {
|
|
|
72
78
|
paidTracerProvider = new NodeTracerProvider({
|
|
73
79
|
spanProcessors: [new PaidSpanProcessor(), new AISDKSpanProcessor(), spanProcessor],
|
|
74
80
|
});
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
81
|
+
if (registerGlobal) {
|
|
82
|
+
// Register the provider globally so that any tracer (including the AI SDK's
|
|
83
|
+
// `trace.getTracer("ai")`) routes spans through our span processors.
|
|
84
|
+
// This also sets up an AsyncLocalStorageContextManager for context propagation.
|
|
85
|
+
paidTracerProvider.register();
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
// Set up context propagation without registering the provider globally.
|
|
89
|
+
// This gives us async parent-child linking via AsyncLocalStorage
|
|
90
|
+
// without polluting the global trace provider.
|
|
91
|
+
const contextManager = new AsyncLocalStorageContextManager();
|
|
92
|
+
contextManager.enable();
|
|
93
|
+
if (!context.setGlobalContextManager(contextManager)) {
|
|
94
|
+
contextManager.disable();
|
|
95
|
+
}
|
|
82
96
|
}
|
|
83
97
|
paidTracer = paidTracerProvider.getTracer("paid.node");
|
|
84
98
|
setupGracefulShutdown(spanProcessor);
|
package/dist/esm/version.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "1.0
|
|
1
|
+
export declare const SDK_VERSION = "1.1.0";
|
package/dist/esm/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "1.0
|
|
1
|
+
export const SDK_VERSION = "1.1.0";
|
package/package.json
CHANGED
|
@@ -1,226 +1,226 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
2
|
+
"name": "@paid-ai/paid-node",
|
|
3
|
+
"version": "1.1.0",
|
|
4
|
+
"private": false,
|
|
5
|
+
"repository": "github:paid-ai/paid-node",
|
|
6
|
+
"type": "commonjs",
|
|
7
|
+
"main": "./dist/cjs/index.js",
|
|
8
|
+
"module": "./dist/esm/index.mjs",
|
|
9
|
+
"types": "./dist/cjs/index.d.ts",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"types": "./dist/cjs/index.d.ts",
|
|
13
|
+
"import": {
|
|
14
|
+
"types": "./dist/esm/index.d.mts",
|
|
15
|
+
"default": "./dist/esm/index.mjs"
|
|
16
|
+
},
|
|
17
|
+
"require": {
|
|
18
|
+
"types": "./dist/cjs/index.d.ts",
|
|
19
|
+
"default": "./dist/cjs/index.js"
|
|
20
|
+
},
|
|
21
|
+
"default": "./dist/cjs/index.js"
|
|
22
|
+
},
|
|
23
|
+
"./package.json": "./package.json",
|
|
24
|
+
"./openai": {
|
|
25
|
+
"types": "./dist/cjs/openai-wrapper/index.d.ts",
|
|
26
|
+
"import": {
|
|
27
|
+
"types": "./dist/esm/openai-wrapper/index.d.mts",
|
|
28
|
+
"default": "./dist/esm/openai-wrapper/index.mjs"
|
|
29
|
+
},
|
|
30
|
+
"require": {
|
|
31
|
+
"types": "./dist/cjs/openai-wrapper/index.d.ts",
|
|
32
|
+
"default": "./dist/cjs/openai-wrapper/index.js"
|
|
33
|
+
},
|
|
34
|
+
"default": "./dist/cjs/openai-wrapper/index.js"
|
|
35
|
+
},
|
|
36
|
+
"./anthropic": {
|
|
37
|
+
"types": "./dist/cjs/anthropic-wrapper/index.d.ts",
|
|
38
|
+
"import": {
|
|
39
|
+
"types": "./dist/esm/anthropic-wrapper/index.d.mts",
|
|
40
|
+
"default": "./dist/esm/anthropic-wrapper/index.mjs"
|
|
41
|
+
},
|
|
42
|
+
"require": {
|
|
43
|
+
"types": "./dist/cjs/anthropic-wrapper/index.d.ts",
|
|
44
|
+
"default": "./dist/cjs/anthropic-wrapper/index.js"
|
|
45
|
+
},
|
|
46
|
+
"default": "./dist/cjs/anthropic-wrapper/index.js"
|
|
47
|
+
},
|
|
48
|
+
"./mistral": {
|
|
49
|
+
"types": "./dist/cjs/mistral-wrapper/index.d.ts",
|
|
50
|
+
"import": {
|
|
51
|
+
"types": "./dist/esm/mistral-wrapper/index.d.mts",
|
|
52
|
+
"default": "./dist/esm/mistral-wrapper/index.mjs"
|
|
53
|
+
},
|
|
54
|
+
"require": {
|
|
55
|
+
"types": "./dist/cjs/mistral-wrapper/index.d.ts",
|
|
56
|
+
"default": "./dist/cjs/mistral-wrapper/index.js"
|
|
57
|
+
},
|
|
58
|
+
"default": "./dist/cjs/mistral-wrapper/index.js"
|
|
59
|
+
},
|
|
60
|
+
"./langchain": {
|
|
61
|
+
"types": "./dist/cjs/langchain-wrapper/index.d.ts",
|
|
62
|
+
"import": {
|
|
63
|
+
"types": "./dist/esm/langchain-wrapper/index.d.mts",
|
|
64
|
+
"default": "./dist/esm/langchain-wrapper/index.mjs"
|
|
65
|
+
},
|
|
66
|
+
"require": {
|
|
67
|
+
"types": "./dist/cjs/langchain-wrapper/index.d.ts",
|
|
68
|
+
"default": "./dist/cjs/langchain-wrapper/index.js"
|
|
69
|
+
},
|
|
70
|
+
"default": "./dist/cjs/langchain-wrapper/index.js"
|
|
71
|
+
},
|
|
72
|
+
"./vercel": {
|
|
73
|
+
"types": "./dist/cjs/vercel-wrapper/index.d.ts",
|
|
74
|
+
"import": {
|
|
75
|
+
"types": "./dist/esm/vercel-wrapper/index.d.mts",
|
|
76
|
+
"default": "./dist/esm/vercel-wrapper/index.mjs"
|
|
77
|
+
},
|
|
78
|
+
"require": {
|
|
79
|
+
"types": "./dist/cjs/vercel-wrapper/index.d.ts",
|
|
80
|
+
"default": "./dist/cjs/vercel-wrapper/index.js"
|
|
81
|
+
},
|
|
82
|
+
"default": "./dist/cjs/vercel-wrapper/index.js"
|
|
83
|
+
},
|
|
84
|
+
"./tracing": {
|
|
85
|
+
"types": "./dist/cjs/tracing/index.d.ts",
|
|
86
|
+
"import": {
|
|
87
|
+
"types": "./dist/esm/tracing/index.d.mts",
|
|
88
|
+
"default": "./dist/esm/tracing/index.mjs"
|
|
89
|
+
},
|
|
90
|
+
"require": {
|
|
91
|
+
"types": "./dist/cjs/tracing/index.d.ts",
|
|
92
|
+
"default": "./dist/cjs/tracing/index.js"
|
|
93
|
+
},
|
|
94
|
+
"default": "./dist/cjs/tracing/index.js"
|
|
95
|
+
},
|
|
96
|
+
"./tracing/auto": {
|
|
97
|
+
"types": "./dist/cjs/tracing/autoInstrumentation.d.ts",
|
|
98
|
+
"import": {
|
|
99
|
+
"types": "./dist/esm/tracing/autoInstrumentation.d.mts",
|
|
100
|
+
"default": "./dist/esm/tracing/autoInstrumentation.mjs"
|
|
101
|
+
},
|
|
102
|
+
"require": {
|
|
103
|
+
"types": "./dist/cjs/tracing/autoInstrumentation.d.ts",
|
|
104
|
+
"default": "./dist/cjs/tracing/autoInstrumentation.js"
|
|
105
|
+
},
|
|
106
|
+
"default": "./dist/cjs/tracing/autoInstrumentation.js"
|
|
107
|
+
}
|
|
22
108
|
},
|
|
23
|
-
"
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
"
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
|
|
34
|
-
|
|
109
|
+
"files": [
|
|
110
|
+
"dist",
|
|
111
|
+
"reference.md",
|
|
112
|
+
"README.md",
|
|
113
|
+
"LICENSE"
|
|
114
|
+
],
|
|
115
|
+
"scripts": {
|
|
116
|
+
"format": "biome format --write --skip-parse-errors --no-errors-on-unmatched --max-diagnostics=none",
|
|
117
|
+
"format:check": "biome format --skip-parse-errors --no-errors-on-unmatched --max-diagnostics=none",
|
|
118
|
+
"lint": "biome lint --skip-parse-errors --no-errors-on-unmatched --max-diagnostics=none",
|
|
119
|
+
"lint:fix": "biome lint --fix --unsafe --skip-parse-errors --no-errors-on-unmatched --max-diagnostics=none",
|
|
120
|
+
"check": "biome check --skip-parse-errors --no-errors-on-unmatched --max-diagnostics=none",
|
|
121
|
+
"check:fix": "biome check --fix --unsafe --skip-parse-errors --no-errors-on-unmatched --max-diagnostics=none",
|
|
122
|
+
"build": "pnpm build:cjs && pnpm build:esm",
|
|
123
|
+
"build:cjs": "tsc --project ./tsconfig.cjs.json",
|
|
124
|
+
"build:esm": "tsc --project ./tsconfig.esm.json && node scripts/rename-to-esm-files.js dist/esm",
|
|
125
|
+
"test": "vitest",
|
|
126
|
+
"test:unit": "vitest --project unit",
|
|
127
|
+
"test:wire": "vitest --project wire"
|
|
35
128
|
},
|
|
36
|
-
"
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
|
|
46
|
-
|
|
129
|
+
"dependencies": {
|
|
130
|
+
"@opentelemetry/api": ">=1.9.0",
|
|
131
|
+
"@opentelemetry/context-async-hooks": ">=0.208.0",
|
|
132
|
+
"@opentelemetry/exporter-trace-otlp-http": ">=0.208.0",
|
|
133
|
+
"@opentelemetry/exporter-trace-otlp-proto": ">=0.208.0",
|
|
134
|
+
"@opentelemetry/instrumentation": ">=0.208.0",
|
|
135
|
+
"@opentelemetry/resources": ">=1.38.0",
|
|
136
|
+
"@opentelemetry/sdk-node": ">=0.208.0",
|
|
137
|
+
"@opentelemetry/sdk-trace-base": ">=1.38.0",
|
|
138
|
+
"@opentelemetry/sdk-trace-node": "^2.2.0",
|
|
139
|
+
"@opentelemetry/semantic-conventions": ">=1.38.0",
|
|
140
|
+
"@arizeai/openinference-instrumentation-anthropic": ">=0.1.2",
|
|
141
|
+
"@arizeai/openinference-instrumentation-openai": ">=4.0.0",
|
|
142
|
+
"@arizeai/openinference-semantic-conventions": ">=2.1.2",
|
|
143
|
+
"@traceloop/instrumentation-bedrock": ">=0.22.0"
|
|
47
144
|
},
|
|
48
|
-
"
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
"types": "./dist/cjs/mistral-wrapper/index.d.ts",
|
|
56
|
-
"default": "./dist/cjs/mistral-wrapper/index.js"
|
|
57
|
-
},
|
|
58
|
-
"default": "./dist/cjs/mistral-wrapper/index.js"
|
|
145
|
+
"peerDependencies": {
|
|
146
|
+
"@ai-sdk/openai": ">=1.0.0",
|
|
147
|
+
"@anthropic-ai/sdk": ">=0.36.3",
|
|
148
|
+
"@langchain/core": ">=0.3.0",
|
|
149
|
+
"@mistralai/mistralai": ">=1.0.0",
|
|
150
|
+
"ai": ">=5.0.0",
|
|
151
|
+
"openai": ">=4.85.4"
|
|
59
152
|
},
|
|
60
|
-
"
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
"
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
"
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
153
|
+
"peerDependenciesMeta": {
|
|
154
|
+
"@ai-sdk/openai": {
|
|
155
|
+
"optional": true
|
|
156
|
+
},
|
|
157
|
+
"@anthropic-ai/sdk": {
|
|
158
|
+
"optional": true
|
|
159
|
+
},
|
|
160
|
+
"@langchain/core": {
|
|
161
|
+
"optional": true
|
|
162
|
+
},
|
|
163
|
+
"@mistralai/mistralai": {
|
|
164
|
+
"optional": true
|
|
165
|
+
},
|
|
166
|
+
"ai": {
|
|
167
|
+
"optional": true
|
|
168
|
+
},
|
|
169
|
+
"openai": {
|
|
170
|
+
"optional": true
|
|
171
|
+
}
|
|
71
172
|
},
|
|
72
|
-
"
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
"
|
|
76
|
-
"
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
"
|
|
80
|
-
"
|
|
81
|
-
|
|
82
|
-
|
|
173
|
+
"devDependencies": {
|
|
174
|
+
"webpack": "^5.97.1",
|
|
175
|
+
"ts-loader": "^9.5.1",
|
|
176
|
+
"vitest": "^3.2.4",
|
|
177
|
+
"msw": ">=2.0.0",
|
|
178
|
+
"@types/node": "^18.19.70",
|
|
179
|
+
"typescript": "~5.7.2",
|
|
180
|
+
"@biomejs/biome": "2.3.1",
|
|
181
|
+
"@ai-sdk/openai": ">=1.0.0",
|
|
182
|
+
"@anthropic-ai/sdk": ">=0.36.3",
|
|
183
|
+
"@langchain/core": ">=0.3.0",
|
|
184
|
+
"@mistralai/mistralai": ">=1.0.0",
|
|
185
|
+
"ai": ">=5.0.0",
|
|
186
|
+
"openai": ">=4.85.4",
|
|
187
|
+
"nock": ">=14.0.0",
|
|
188
|
+
"zod": ">=3.0.0"
|
|
83
189
|
},
|
|
84
|
-
"
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
"
|
|
88
|
-
"
|
|
89
|
-
},
|
|
90
|
-
"require": {
|
|
91
|
-
"types": "./dist/cjs/tracing/index.d.ts",
|
|
92
|
-
"default": "./dist/cjs/tracing/index.js"
|
|
93
|
-
},
|
|
94
|
-
"default": "./dist/cjs/tracing/index.js"
|
|
190
|
+
"browser": {
|
|
191
|
+
"fs": false,
|
|
192
|
+
"os": false,
|
|
193
|
+
"path": false,
|
|
194
|
+
"stream": false
|
|
95
195
|
},
|
|
96
|
-
"
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
"types": "./dist/esm/tracing/autoInstrumentation.d.mts",
|
|
100
|
-
"default": "./dist/esm/tracing/autoInstrumentation.mjs"
|
|
101
|
-
},
|
|
102
|
-
"require": {
|
|
103
|
-
"types": "./dist/cjs/tracing/autoInstrumentation.d.ts",
|
|
104
|
-
"default": "./dist/cjs/tracing/autoInstrumentation.js"
|
|
105
|
-
},
|
|
106
|
-
"default": "./dist/cjs/tracing/autoInstrumentation.js"
|
|
107
|
-
}
|
|
108
|
-
},
|
|
109
|
-
"files": [
|
|
110
|
-
"dist",
|
|
111
|
-
"reference.md",
|
|
112
|
-
"README.md",
|
|
113
|
-
"LICENSE"
|
|
114
|
-
],
|
|
115
|
-
"scripts": {
|
|
116
|
-
"format": "biome format --write --skip-parse-errors --no-errors-on-unmatched --max-diagnostics=none",
|
|
117
|
-
"format:check": "biome format --skip-parse-errors --no-errors-on-unmatched --max-diagnostics=none",
|
|
118
|
-
"lint": "biome lint --skip-parse-errors --no-errors-on-unmatched --max-diagnostics=none",
|
|
119
|
-
"lint:fix": "biome lint --fix --unsafe --skip-parse-errors --no-errors-on-unmatched --max-diagnostics=none",
|
|
120
|
-
"check": "biome check --skip-parse-errors --no-errors-on-unmatched --max-diagnostics=none",
|
|
121
|
-
"check:fix": "biome check --fix --unsafe --skip-parse-errors --no-errors-on-unmatched --max-diagnostics=none",
|
|
122
|
-
"build": "pnpm build:cjs && pnpm build:esm",
|
|
123
|
-
"build:cjs": "tsc --project ./tsconfig.cjs.json",
|
|
124
|
-
"build:esm": "tsc --project ./tsconfig.esm.json && node scripts/rename-to-esm-files.js dist/esm",
|
|
125
|
-
"test": "vitest",
|
|
126
|
-
"test:unit": "vitest --project unit",
|
|
127
|
-
"test:wire": "vitest --project wire"
|
|
128
|
-
},
|
|
129
|
-
"dependencies": {
|
|
130
|
-
"@opentelemetry/api": ">=1.9.0",
|
|
131
|
-
"@opentelemetry/context-async-hooks": ">=0.208.0",
|
|
132
|
-
"@opentelemetry/exporter-trace-otlp-http": ">=0.208.0",
|
|
133
|
-
"@opentelemetry/exporter-trace-otlp-proto": ">=0.208.0",
|
|
134
|
-
"@opentelemetry/instrumentation": ">=0.208.0",
|
|
135
|
-
"@opentelemetry/resources": ">=1.38.0",
|
|
136
|
-
"@opentelemetry/sdk-node": ">=0.208.0",
|
|
137
|
-
"@opentelemetry/sdk-trace-base": ">=1.38.0",
|
|
138
|
-
"@opentelemetry/sdk-trace-node": "^2.2.0",
|
|
139
|
-
"@opentelemetry/semantic-conventions": ">=1.38.0",
|
|
140
|
-
"@arizeai/openinference-instrumentation-anthropic": ">=0.1.2",
|
|
141
|
-
"@arizeai/openinference-instrumentation-openai": ">=4.0.0",
|
|
142
|
-
"@arizeai/openinference-semantic-conventions": ">=2.1.2",
|
|
143
|
-
"@traceloop/instrumentation-bedrock": ">=0.22.0"
|
|
144
|
-
},
|
|
145
|
-
"peerDependencies": {
|
|
146
|
-
"@ai-sdk/openai": ">=1.0.0",
|
|
147
|
-
"@anthropic-ai/sdk": ">=0.36.3",
|
|
148
|
-
"@langchain/core": ">=0.3.0",
|
|
149
|
-
"@mistralai/mistralai": ">=1.0.0",
|
|
150
|
-
"ai": ">=5.0.0",
|
|
151
|
-
"openai": ">=4.85.4"
|
|
152
|
-
},
|
|
153
|
-
"peerDependenciesMeta": {
|
|
154
|
-
"@ai-sdk/openai": {
|
|
155
|
-
"optional": true
|
|
156
|
-
},
|
|
157
|
-
"@anthropic-ai/sdk": {
|
|
158
|
-
"optional": true
|
|
159
|
-
},
|
|
160
|
-
"@langchain/core": {
|
|
161
|
-
"optional": true
|
|
196
|
+
"packageManager": "pnpm@10.14.0",
|
|
197
|
+
"engines": {
|
|
198
|
+
"node": ">=18.0.0"
|
|
162
199
|
},
|
|
163
|
-
"
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
"zod": ">=3.0.0"
|
|
189
|
-
},
|
|
190
|
-
"browser": {
|
|
191
|
-
"fs": false,
|
|
192
|
-
"os": false,
|
|
193
|
-
"path": false,
|
|
194
|
-
"stream": false
|
|
195
|
-
},
|
|
196
|
-
"packageManager": "pnpm@10.14.0",
|
|
197
|
-
"engines": {
|
|
198
|
-
"node": ">=18.0.0"
|
|
199
|
-
},
|
|
200
|
-
"sideEffects": false,
|
|
201
|
-
"typesVersions": {
|
|
202
|
-
"*": {
|
|
203
|
-
"openai": [
|
|
204
|
-
"./dist/cjs/openai-wrapper/index.d.ts"
|
|
205
|
-
],
|
|
206
|
-
"anthropic": [
|
|
207
|
-
"./dist/cjs/anthropic-wrapper/index.d.ts"
|
|
208
|
-
],
|
|
209
|
-
"mistral": [
|
|
210
|
-
"./dist/cjs/mistral-wrapper/index.d.ts"
|
|
211
|
-
],
|
|
212
|
-
"langchain": [
|
|
213
|
-
"./dist/cjs/langchain-wrapper/index.d.ts"
|
|
214
|
-
],
|
|
215
|
-
"vercel": [
|
|
216
|
-
"./dist/cjs/vercel-wrapper/index.d.ts"
|
|
217
|
-
],
|
|
218
|
-
"tracing": [
|
|
219
|
-
"./dist/cjs/tracing/index.d.ts"
|
|
220
|
-
],
|
|
221
|
-
"tracing/auto": [
|
|
222
|
-
"./dist/cjs/tracing/autoInstrumentation.d.ts"
|
|
223
|
-
]
|
|
200
|
+
"sideEffects": false,
|
|
201
|
+
"typesVersions": {
|
|
202
|
+
"*": {
|
|
203
|
+
"openai": [
|
|
204
|
+
"./dist/cjs/openai-wrapper/index.d.ts"
|
|
205
|
+
],
|
|
206
|
+
"anthropic": [
|
|
207
|
+
"./dist/cjs/anthropic-wrapper/index.d.ts"
|
|
208
|
+
],
|
|
209
|
+
"mistral": [
|
|
210
|
+
"./dist/cjs/mistral-wrapper/index.d.ts"
|
|
211
|
+
],
|
|
212
|
+
"langchain": [
|
|
213
|
+
"./dist/cjs/langchain-wrapper/index.d.ts"
|
|
214
|
+
],
|
|
215
|
+
"vercel": [
|
|
216
|
+
"./dist/cjs/vercel-wrapper/index.d.ts"
|
|
217
|
+
],
|
|
218
|
+
"tracing": [
|
|
219
|
+
"./dist/cjs/tracing/index.d.ts"
|
|
220
|
+
],
|
|
221
|
+
"tracing/auto": [
|
|
222
|
+
"./dist/cjs/tracing/autoInstrumentation.d.ts"
|
|
223
|
+
]
|
|
224
|
+
}
|
|
224
225
|
}
|
|
225
|
-
|
|
226
|
-
}
|
|
226
|
+
}
|
package/reference.md
CHANGED