@paygentic/sdk 0.8.1 → 0.8.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commonjs/funcs/billableMetricsListEvents.js +1 -0
- package/dist/commonjs/funcs/billableMetricsListEvents.js.map +1 -1
- package/dist/commonjs/funcs/billableMetricsMeter.js +2 -0
- package/dist/commonjs/funcs/billableMetricsMeter.js.map +1 -1
- package/dist/commonjs/funcs/invoicesV2GetLineItems.d.ts +1 -1
- package/dist/commonjs/funcs/invoicesV2GetLineItems.js +1 -1
- package/dist/commonjs/lib/config.d.ts +2 -2
- package/dist/commonjs/lib/config.js +2 -2
- package/dist/commonjs/models/eventresponse.d.ts +7 -0
- package/dist/commonjs/models/eventresponse.d.ts.map +1 -1
- package/dist/commonjs/models/eventresponse.js +1 -0
- package/dist/commonjs/models/eventresponse.js.map +1 -1
- package/dist/commonjs/models/meterevent.d.ts +4 -0
- package/dist/commonjs/models/meterevent.d.ts.map +1 -1
- package/dist/commonjs/models/meterevent.js +1 -0
- package/dist/commonjs/models/meterevent.js.map +1 -1
- package/dist/commonjs/models/operations/advancetestclock.d.ts +12 -12
- package/dist/commonjs/models/operations/advancetestclock.d.ts.map +1 -1
- package/dist/commonjs/models/operations/advancetestclock.js +13 -13
- package/dist/commonjs/models/operations/advancetestclock.js.map +1 -1
- package/dist/commonjs/models/operations/getbillablemetricmeter.d.ts +11 -1
- package/dist/commonjs/models/operations/getbillablemetricmeter.d.ts.map +1 -1
- package/dist/commonjs/models/operations/getbillablemetricmeter.js +2 -0
- package/dist/commonjs/models/operations/getbillablemetricmeter.js.map +1 -1
- package/dist/commonjs/models/operations/ingestevent.d.ts +71 -3
- package/dist/commonjs/models/operations/ingestevent.d.ts.map +1 -1
- package/dist/commonjs/models/operations/ingestevent.js +28 -2
- package/dist/commonjs/models/operations/ingestevent.js.map +1 -1
- package/dist/commonjs/models/operations/listbillablemetricevents.d.ts +5 -0
- package/dist/commonjs/models/operations/listbillablemetricevents.d.ts.map +1 -1
- package/dist/commonjs/models/operations/listbillablemetricevents.js +1 -0
- package/dist/commonjs/models/operations/listbillablemetricevents.js.map +1 -1
- package/dist/commonjs/models/usageresponse.d.ts +10 -2
- package/dist/commonjs/models/usageresponse.d.ts.map +1 -1
- package/dist/commonjs/models/usageresponse.js +2 -0
- package/dist/commonjs/models/usageresponse.js.map +1 -1
- package/dist/commonjs/sdk/invoicesv2.d.ts +1 -1
- package/dist/commonjs/sdk/invoicesv2.js +1 -1
- package/dist/esm/funcs/billableMetricsListEvents.js +1 -0
- package/dist/esm/funcs/billableMetricsListEvents.js.map +1 -1
- package/dist/esm/funcs/billableMetricsMeter.js +2 -0
- package/dist/esm/funcs/billableMetricsMeter.js.map +1 -1
- package/dist/esm/funcs/invoicesV2GetLineItems.d.ts +1 -1
- package/dist/esm/funcs/invoicesV2GetLineItems.js +1 -1
- package/dist/esm/lib/config.d.ts +2 -2
- package/dist/esm/lib/config.js +2 -2
- package/dist/esm/models/eventresponse.d.ts +7 -0
- package/dist/esm/models/eventresponse.d.ts.map +1 -1
- package/dist/esm/models/eventresponse.js +1 -0
- package/dist/esm/models/eventresponse.js.map +1 -1
- package/dist/esm/models/meterevent.d.ts +4 -0
- package/dist/esm/models/meterevent.d.ts.map +1 -1
- package/dist/esm/models/meterevent.js +1 -0
- package/dist/esm/models/meterevent.js.map +1 -1
- package/dist/esm/models/operations/advancetestclock.d.ts +12 -12
- package/dist/esm/models/operations/advancetestclock.d.ts.map +1 -1
- package/dist/esm/models/operations/advancetestclock.js +10 -10
- package/dist/esm/models/operations/advancetestclock.js.map +1 -1
- package/dist/esm/models/operations/getbillablemetricmeter.d.ts +11 -1
- package/dist/esm/models/operations/getbillablemetricmeter.d.ts.map +1 -1
- package/dist/esm/models/operations/getbillablemetricmeter.js +2 -0
- package/dist/esm/models/operations/getbillablemetricmeter.js.map +1 -1
- package/dist/esm/models/operations/ingestevent.d.ts +71 -3
- package/dist/esm/models/operations/ingestevent.d.ts.map +1 -1
- package/dist/esm/models/operations/ingestevent.js +25 -1
- package/dist/esm/models/operations/ingestevent.js.map +1 -1
- package/dist/esm/models/operations/listbillablemetricevents.d.ts +5 -0
- package/dist/esm/models/operations/listbillablemetricevents.d.ts.map +1 -1
- package/dist/esm/models/operations/listbillablemetricevents.js +1 -0
- package/dist/esm/models/operations/listbillablemetricevents.js.map +1 -1
- package/dist/esm/models/usageresponse.d.ts +10 -2
- package/dist/esm/models/usageresponse.d.ts.map +1 -1
- package/dist/esm/models/usageresponse.js +2 -0
- package/dist/esm/models/usageresponse.js.map +1 -1
- package/dist/esm/sdk/invoicesv2.d.ts +1 -1
- package/dist/esm/sdk/invoicesv2.js +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/funcs/billableMetricsListEvents.ts +1 -0
- package/src/funcs/billableMetricsMeter.ts +2 -0
- package/src/funcs/invoicesV2GetLineItems.ts +1 -1
- package/src/lib/config.ts +2 -2
- package/src/models/eventresponse.ts +8 -0
- package/src/models/meterevent.ts +5 -0
- package/src/models/operations/advancetestclock.ts +39 -23
- package/src/models/operations/getbillablemetricmeter.ts +13 -1
- package/src/models/operations/ingestevent.ts +116 -6
- package/src/models/operations/listbillablemetricevents.ts +6 -0
- package/src/models/usageresponse.ts +12 -2
- package/src/sdk/invoicesv2.ts +1 -1
|
@@ -3,16 +3,40 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import * as z from "zod/v3";
|
|
5
5
|
/** @internal */
|
|
6
|
-
export const
|
|
6
|
+
export const IngestEventRequestBody2$outboundSchema = z.object({
|
|
7
|
+
type: z.string(),
|
|
8
|
+
source: z.string(),
|
|
9
|
+
subject: z.string().optional(),
|
|
10
|
+
externalSubject: z.string(),
|
|
11
|
+
namespace: z.string().optional(),
|
|
12
|
+
timestamp: z.date().transform(v => v.toISOString()).optional(),
|
|
13
|
+
idempotencyKey: z.string().optional(),
|
|
14
|
+
externalId: z.string().optional(),
|
|
15
|
+
data: z.record(z.any()),
|
|
16
|
+
});
|
|
17
|
+
export function ingestEventRequestBody2ToJSON(ingestEventRequestBody2) {
|
|
18
|
+
return JSON.stringify(IngestEventRequestBody2$outboundSchema.parse(ingestEventRequestBody2));
|
|
19
|
+
}
|
|
20
|
+
/** @internal */
|
|
21
|
+
export const IngestEventRequestBody1$outboundSchema = z.object({
|
|
7
22
|
type: z.string(),
|
|
8
23
|
source: z.string(),
|
|
9
24
|
subject: z.string(),
|
|
25
|
+
externalSubject: z.string().optional(),
|
|
10
26
|
namespace: z.string().optional(),
|
|
11
27
|
timestamp: z.date().transform(v => v.toISOString()).optional(),
|
|
12
28
|
idempotencyKey: z.string().optional(),
|
|
13
29
|
externalId: z.string().optional(),
|
|
14
30
|
data: z.record(z.any()),
|
|
15
31
|
});
|
|
32
|
+
export function ingestEventRequestBody1ToJSON(ingestEventRequestBody1) {
|
|
33
|
+
return JSON.stringify(IngestEventRequestBody1$outboundSchema.parse(ingestEventRequestBody1));
|
|
34
|
+
}
|
|
35
|
+
/** @internal */
|
|
36
|
+
export const IngestEventRequest$outboundSchema = z.union([
|
|
37
|
+
z.lazy(() => IngestEventRequestBody1$outboundSchema),
|
|
38
|
+
z.lazy(() => IngestEventRequestBody2$outboundSchema),
|
|
39
|
+
]);
|
|
16
40
|
export function ingestEventRequestToJSON(ingestEventRequest) {
|
|
17
41
|
return JSON.stringify(IngestEventRequest$outboundSchema.parse(ingestEventRequest));
|
|
18
42
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ingestevent.js","sourceRoot":"","sources":["../../../../src/models/operations/ingestevent.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"ingestevent.js","sourceRoot":"","sources":["../../../../src/models/operations/ingestevent.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAiG5B,gBAAgB;AAChB,MAAM,C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,CAAC,QAAQ,EAAE;IAC9D,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACrC,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACjC,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC;CACxB,CAAC,CAAC;AAEH,MAAM,UAAU,6BAA6B,CAC3C,uBAAgD;IAEhD,OAAO,IAAI,CAAC,SAAS,CACnB,sCAAsC,CAAC,KAAK,CAAC,uBAAuB,CAAC,CACtE,CAAC;AACJ,CAAC;AAOD,gBAAgB;AAChB,MAAM,CAAC,MAAM,iCAAiC,GAI1C,CAAC,CAAC,KAAK,CAAC;IACV,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,sCAAsC,CAAC;IACpD,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,sCAAsC,CAAC;CACrD,CAAC,CAAC;AAEH,MAAM,UAAU,wBAAwB,CACtC,kBAAsC;IAEtC,OAAO,IAAI,CAAC,SAAS,CACnB,iCAAiC,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAC5D,CAAC;AACJ,CAAC"}
|
|
@@ -25,6 +25,10 @@ export type ListBillableMetricEventsRequest = {
|
|
|
25
25
|
* Filter by external identifier. Alphanumeric characters, hyphens, and underscores only.
|
|
26
26
|
*/
|
|
27
27
|
externalId?: string | undefined;
|
|
28
|
+
/**
|
|
29
|
+
* Filter by the merchant's own customer identifier the event was reported with.
|
|
30
|
+
*/
|
|
31
|
+
externalSubject?: string | undefined;
|
|
28
32
|
};
|
|
29
33
|
/** @internal */
|
|
30
34
|
export type ListBillableMetricEventsRequest$Outbound = {
|
|
@@ -35,6 +39,7 @@ export type ListBillableMetricEventsRequest$Outbound = {
|
|
|
35
39
|
limit: number;
|
|
36
40
|
offset: number;
|
|
37
41
|
externalId?: string | undefined;
|
|
42
|
+
externalSubject?: string | undefined;
|
|
38
43
|
};
|
|
39
44
|
/** @internal */
|
|
40
45
|
export declare const ListBillableMetricEventsRequest$outboundSchema: z.ZodType<ListBillableMetricEventsRequest$Outbound, z.ZodTypeDef, ListBillableMetricEventsRequest>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"listbillablemetricevents.d.ts","sourceRoot":"","sources":["../../../../src/models/operations/listbillablemetricevents.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAE5B,MAAM,MAAM,+BAA+B,GAAG;IAC5C,EAAE,EAAE,MAAM,CAAC;IACX;;OAEG;IACH,IAAI,EAAE,IAAI,CAAC;IACX;;OAEG;IACH,EAAE,EAAE,IAAI,CAAC;IACT;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"listbillablemetricevents.d.ts","sourceRoot":"","sources":["../../../../src/models/operations/listbillablemetricevents.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAE5B,MAAM,MAAM,+BAA+B,GAAG;IAC5C,EAAE,EAAE,MAAM,CAAC;IACX;;OAEG;IACH,IAAI,EAAE,IAAI,CAAC;IACX;;OAEG;IACH,EAAE,EAAE,IAAI,CAAC;IACT;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACtC,CAAC;AAEF,gBAAgB;AAChB,MAAM,MAAM,wCAAwC,GAAG;IACrD,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,eAAe,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACtC,CAAC;AAEF,gBAAgB;AAChB,eAAO,MAAM,8CAA8C,EAAE,CAAC,CAAC,OAAO,CACpE,wCAAwC,EACxC,CAAC,CAAC,UAAU,EACZ,+BAA+B,CAU/B,CAAC;AAEH,wBAAgB,qCAAqC,CACnD,+BAA+B,EAAE,+BAA+B,GAC/D,MAAM,CAMR"}
|
|
@@ -11,6 +11,7 @@ export const ListBillableMetricEventsRequest$outboundSchema = z.object({
|
|
|
11
11
|
limit: z.number().int().default(20),
|
|
12
12
|
offset: z.number().int().default(0),
|
|
13
13
|
externalId: z.string().optional(),
|
|
14
|
+
externalSubject: z.string().optional(),
|
|
14
15
|
});
|
|
15
16
|
export function listBillableMetricEventsRequestToJSON(listBillableMetricEventsRequest) {
|
|
16
17
|
return JSON.stringify(ListBillableMetricEventsRequest$outboundSchema.parse(listBillableMetricEventsRequest));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"listbillablemetricevents.js","sourceRoot":"","sources":["../../../../src/models/operations/listbillablemetricevents.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"listbillablemetricevents.js","sourceRoot":"","sources":["../../../../src/models/operations/listbillablemetricevents.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AA8C5B,gBAAgB;AAChB,MAAM,CAAC,MAAM,8CAA8C,GAIvD,CAAC,CAAC,MAAM,CAAC;IACX,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;IACd,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;IAC9C,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;IAC5C,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC9B,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;IACnC,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;IACnC,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACjC,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACvC,CAAC,CAAC;AAEH,MAAM,UAAU,qCAAqC,CACnD,+BAAgE;IAEhE,OAAO,IAAI,CAAC,SAAS,CACnB,8CAA8C,CAAC,KAAK,CAClD,+BAA+B,CAChC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -16,6 +16,10 @@ export type GroupedValue = {
|
|
|
16
16
|
[k: string]: string;
|
|
17
17
|
};
|
|
18
18
|
value: number;
|
|
19
|
+
/**
|
|
20
|
+
* Number of raw events in this group
|
|
21
|
+
*/
|
|
22
|
+
eventCount?: number | undefined;
|
|
19
23
|
};
|
|
20
24
|
export type UsageResponse = {
|
|
21
25
|
object: UsageResponseObject;
|
|
@@ -28,13 +32,17 @@ export type UsageResponse = {
|
|
|
28
32
|
*/
|
|
29
33
|
totalValue: number;
|
|
30
34
|
/**
|
|
31
|
-
* Time-bucketed values. Only present when windowSize is specified.
|
|
35
|
+
* Time-bucketed values. Only present when windowSize is specified. When both windowSize and groupBy are set, windowedValues[i] is index-aligned with groupedValues[i] (same window and group).
|
|
32
36
|
*/
|
|
33
37
|
windowedValues?: Array<WindowedValue> | undefined;
|
|
34
38
|
/**
|
|
35
|
-
* Dimension-grouped values. Only present when groupBy is specified.
|
|
39
|
+
* Dimension-grouped values. Only present when groupBy is specified. When both windowSize and groupBy are set, groupedValues[i] is index-aligned with windowedValues[i] (same window and group).
|
|
36
40
|
*/
|
|
37
41
|
groupedValues?: Array<GroupedValue> | undefined;
|
|
42
|
+
/**
|
|
43
|
+
* Total distinct groups before groupLimit/groupOffset truncation. Only present when groupLimit is specified; use it to drive pagination totals.
|
|
44
|
+
*/
|
|
45
|
+
groupCount?: number | undefined;
|
|
38
46
|
};
|
|
39
47
|
/** @internal */
|
|
40
48
|
export declare const UsageResponseObject$inboundSchema: z.ZodNativeEnum<typeof UsageResponseObject>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usageresponse.d.ts","sourceRoot":"","sources":["../../../src/models/usageresponse.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAE5B,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAEpE,eAAO,MAAM,mBAAmB;;CAEtB,CAAC;AACX,MAAM,MAAM,mBAAmB,GAAG,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEzE,MAAM,MAAM,aAAa,GAAG;IAC1B,WAAW,EAAE,IAAI,CAAC;IAClB,SAAS,EAAE,IAAI,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG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;CACjC,CAAC;AAEF,gBAAgB;AAChB,eAAO,MAAM,iCAAiC,EAAE,CAAC,CAAC,aAAa,CAC7D,OAAO,mBAAmB,CACS,CAAC;AAEtC,gBAAgB;AAChB,eAAO,MAAM,2BAA2B,EAAE,CAAC,CAAC,OAAO,CACjD,aAAa,EACb,CAAC,CAAC,UAAU,EACZ,OAAO,CAOP,CAAC;AAEH,wBAAgB,qBAAqB,CACnC,UAAU,EAAE,MAAM,GACjB,eAAe,CAAC,aAAa,EAAE,kBAAkB,CAAC,CAMpD;AAED,gBAAgB;AAChB,eAAO,MAAM,0BAA0B,EAAE,CAAC,CAAC,OAAO,CAChD,YAAY,EACZ,CAAC,CAAC,UAAU,EACZ,OAAO,CAKP,CAAC;AAEH,wBAAgB,oBAAoB,CAClC,UAAU,EAAE,MAAM,GACjB,eAAe,CAAC,YAAY,EAAE,kBAAkB,CAAC,CAMnD;AAED,gBAAgB;AAChB,eAAO,MAAM,2BAA2B,EAAE,CAAC,CAAC,OAAO,CACjD,aAAa,EACb,CAAC,CAAC,UAAU,EACZ,OAAO,CAQP,CAAC;AAEH,wBAAgB,qBAAqB,CACnC,UAAU,EAAE,MAAM,GACjB,eAAe,CAAC,aAAa,EAAE,kBAAkB,CAAC,CAMpD"}
|
|
@@ -21,6 +21,7 @@ export function windowedValueFromJSON(jsonString) {
|
|
|
21
21
|
export const GroupedValue$inboundSchema = z.object({
|
|
22
22
|
groupBy: z.record(z.string()),
|
|
23
23
|
value: z.number(),
|
|
24
|
+
eventCount: z.number().int().optional(),
|
|
24
25
|
});
|
|
25
26
|
export function groupedValueFromJSON(jsonString) {
|
|
26
27
|
return safeParse(jsonString, (x) => GroupedValue$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GroupedValue' from JSON`);
|
|
@@ -32,6 +33,7 @@ export const UsageResponse$inboundSchema = z.object({
|
|
|
32
33
|
totalValue: z.number(),
|
|
33
34
|
windowedValues: z.array(z.lazy(() => WindowedValue$inboundSchema)).optional(),
|
|
34
35
|
groupedValues: z.array(z.lazy(() => GroupedValue$inboundSchema)).optional(),
|
|
36
|
+
groupCount: z.number().int().optional(),
|
|
35
37
|
});
|
|
36
38
|
export function usageResponseFromJSON(jsonString) {
|
|
37
39
|
return safeParse(jsonString, (x) => UsageResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UsageResponse' from JSON`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usageresponse.js","sourceRoot":"","sources":["../../../src/models/usageresponse.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAK9C,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,KAAK,EAAE,OAAO;CACN,CAAC;
|
|
1
|
+
{"version":3,"file":"usageresponse.js","sourceRoot":"","sources":["../../../src/models/usageresponse.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAK9C,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,KAAK,EAAE,OAAO;CACN,CAAC;AA0CX,gBAAgB;AAChB,MAAM,CAAC,MAAM,iCAAiC,GAE1C,CAAC,CAAC,UAAU,CAAC,mBAAmB,CAAC,CAAC;AAEtC,gBAAgB;AAChB,MAAM,CAAC,MAAM,2BAA2B,GAIpC,CAAC,CAAC,MAAM,CAAC;IACX,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAC/D,IAAI,IAAI,CAAC,CAAC,CAAC,CACZ;IACD,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,C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CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,0BAA0B,CAAC,CAAC,CAAC,QAAQ,EAAE;IAC3E,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;CACxC,CAAC,CAAC;AAEH,MAAM,UAAU,qBAAqB,CACnC,UAAkB;IAElB,OAAO,SAAS,CACd,UAAU,EACV,CAAC,CAAC,EAAE,EAAE,CAAC,2BAA2B,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EACvD,2CAA2C,CAC5C,CAAC;AACJ,CAAC"}
|
|
@@ -34,7 +34,7 @@ export declare class InvoicesV2 extends ClientSDK {
|
|
|
34
34
|
* Get Line Items
|
|
35
35
|
*
|
|
36
36
|
* @remarks
|
|
37
|
-
* Get paginated line items for an invoice
|
|
37
|
+
* Get paginated line items for an invoice
|
|
38
38
|
*/
|
|
39
39
|
getLineItems(request: operations.GetInvoiceLineItemsRequest, options?: RequestOptions): Promise<models.InvoiceLineItemsResponse>;
|
|
40
40
|
/**
|
|
@@ -52,7 +52,7 @@ export class InvoicesV2 extends ClientSDK {
|
|
|
52
52
|
* Get Line Items
|
|
53
53
|
*
|
|
54
54
|
* @remarks
|
|
55
|
-
* Get paginated line items for an invoice
|
|
55
|
+
* Get paginated line items for an invoice
|
|
56
56
|
*/
|
|
57
57
|
async getLineItems(request, options) {
|
|
58
58
|
return unwrapAsync(invoicesV2GetLineItems(this, request, options));
|
package/jsr.json
CHANGED
package/package.json
CHANGED
|
@@ -104,6 +104,8 @@ async function $do(
|
|
|
104
104
|
"filterGroupBy": payload.filterGroupBy,
|
|
105
105
|
"from": payload.from,
|
|
106
106
|
"groupBy": payload.groupBy,
|
|
107
|
+
"groupLimit": payload.groupLimit,
|
|
108
|
+
"groupOffset": payload.groupOffset,
|
|
107
109
|
"subject": payload.subject,
|
|
108
110
|
"to": payload.to,
|
|
109
111
|
"windowSize": payload.windowSize,
|
|
@@ -30,7 +30,7 @@ import { Result } from "../types/fp.js";
|
|
|
30
30
|
* Get Line Items
|
|
31
31
|
*
|
|
32
32
|
* @remarks
|
|
33
|
-
* Get paginated line items for an invoice
|
|
33
|
+
* Get paginated line items for an invoice
|
|
34
34
|
*/
|
|
35
35
|
export function invoicesV2GetLineItems(
|
|
36
36
|
client: PaygenticCore,
|
package/src/lib/config.ts
CHANGED
|
@@ -65,7 +65,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
|
|
|
65
65
|
export const SDK_METADATA = {
|
|
66
66
|
language: "typescript",
|
|
67
67
|
openapiDocVersion: "0.1.0",
|
|
68
|
-
sdkVersion: "0.8.
|
|
68
|
+
sdkVersion: "0.8.3",
|
|
69
69
|
genVersion: "2.879.13",
|
|
70
|
-
userAgent: "speakeasy-sdk/typescript 0.8.
|
|
70
|
+
userAgent: "speakeasy-sdk/typescript 0.8.3 2.879.13 0.1.0 @paygentic/sdk",
|
|
71
71
|
} as const;
|
|
@@ -21,7 +21,14 @@ export type EventResponse = {
|
|
|
21
21
|
object: EventResponseObject;
|
|
22
22
|
type?: string | undefined;
|
|
23
23
|
source?: string | undefined;
|
|
24
|
+
/**
|
|
25
|
+
* Resolved customer ID. Absent when the event was reported with an externalSubject that does not match a customer yet.
|
|
26
|
+
*/
|
|
24
27
|
subject?: string | undefined;
|
|
28
|
+
/**
|
|
29
|
+
* The merchant's own customer identifier the event was reported with.
|
|
30
|
+
*/
|
|
31
|
+
externalSubject?: string | undefined;
|
|
25
32
|
namespace?: string | undefined;
|
|
26
33
|
timestamp?: Date | undefined;
|
|
27
34
|
idempotencyKey?: string | undefined;
|
|
@@ -47,6 +54,7 @@ export const EventResponse$inboundSchema: z.ZodType<
|
|
|
47
54
|
type: z.string().optional(),
|
|
48
55
|
source: z.string().optional(),
|
|
49
56
|
subject: z.string().optional(),
|
|
57
|
+
externalSubject: z.string().optional(),
|
|
50
58
|
namespace: z.string().optional(),
|
|
51
59
|
timestamp: z.string().datetime({ offset: true }).transform(v => new Date(v))
|
|
52
60
|
.optional(),
|
package/src/models/meterevent.ts
CHANGED
|
@@ -47,6 +47,10 @@ export type MeterEvent = {
|
|
|
47
47
|
* Optional external identifier for cross-referencing with external systems. Alphanumeric characters, hyphens, and underscores only.
|
|
48
48
|
*/
|
|
49
49
|
externalId?: string | undefined;
|
|
50
|
+
/**
|
|
51
|
+
* The merchant's own customer identifier the event was reported with. Empty subject with an externalSubject means the event is not linked to a customer yet.
|
|
52
|
+
*/
|
|
53
|
+
externalSubject?: string | undefined;
|
|
50
54
|
};
|
|
51
55
|
|
|
52
56
|
/** @internal */
|
|
@@ -69,6 +73,7 @@ export const MeterEvent$inboundSchema: z.ZodType<
|
|
|
69
73
|
idempotencyKey: z.string(),
|
|
70
74
|
data: z.record(z.any()),
|
|
71
75
|
externalId: z.string().optional(),
|
|
76
|
+
externalSubject: z.string().optional(),
|
|
72
77
|
});
|
|
73
78
|
|
|
74
79
|
export function meterEventFromJSON(
|
|
@@ -5,70 +5,84 @@
|
|
|
5
5
|
import * as z from "zod/v3";
|
|
6
6
|
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
7
|
|
|
8
|
-
export type
|
|
8
|
+
export type AdvanceTestClockRequestBody2 = {
|
|
9
9
|
/**
|
|
10
10
|
* ISO 8601 duration format indicating clock advancement distance. Sample values: 'P1M' moves forward one month, 'P7D' moves forward seven days, 'PT2H' moves forward two hours, 'P1Y2M3DT4H5M6S' moves forward one year, two months, three days, four hours, five minutes, and six seconds
|
|
11
11
|
*/
|
|
12
12
|
advanceBy: string;
|
|
13
13
|
};
|
|
14
14
|
|
|
15
|
-
export type
|
|
15
|
+
export type AdvanceTestClockRequestBody1 = {
|
|
16
16
|
/**
|
|
17
17
|
* New absolute time for the test clock (must be forward in time)
|
|
18
18
|
*/
|
|
19
19
|
currentTime: Date;
|
|
20
20
|
};
|
|
21
21
|
|
|
22
|
-
export type AdvanceTestClockRequestBody =
|
|
22
|
+
export type AdvanceTestClockRequestBody =
|
|
23
|
+
| AdvanceTestClockRequestBody1
|
|
24
|
+
| AdvanceTestClockRequestBody2;
|
|
23
25
|
|
|
24
26
|
export type AdvanceTestClockRequest = {
|
|
25
27
|
/**
|
|
26
28
|
* Test clock ID
|
|
27
29
|
*/
|
|
28
30
|
id: string;
|
|
29
|
-
requestBody:
|
|
31
|
+
requestBody: AdvanceTestClockRequestBody1 | AdvanceTestClockRequestBody2;
|
|
30
32
|
};
|
|
31
33
|
|
|
32
34
|
/** @internal */
|
|
33
|
-
export type
|
|
35
|
+
export type AdvanceTestClockRequestBody2$Outbound = {
|
|
34
36
|
advanceBy: string;
|
|
35
37
|
};
|
|
36
38
|
|
|
37
39
|
/** @internal */
|
|
38
|
-
export const
|
|
39
|
-
|
|
40
|
+
export const AdvanceTestClockRequestBody2$outboundSchema: z.ZodType<
|
|
41
|
+
AdvanceTestClockRequestBody2$Outbound,
|
|
40
42
|
z.ZodTypeDef,
|
|
41
|
-
|
|
43
|
+
AdvanceTestClockRequestBody2
|
|
42
44
|
> = z.object({
|
|
43
45
|
advanceBy: z.string(),
|
|
44
46
|
});
|
|
45
47
|
|
|
46
|
-
export function
|
|
47
|
-
|
|
48
|
+
export function advanceTestClockRequestBody2ToJSON(
|
|
49
|
+
advanceTestClockRequestBody2: AdvanceTestClockRequestBody2,
|
|
50
|
+
): string {
|
|
51
|
+
return JSON.stringify(
|
|
52
|
+
AdvanceTestClockRequestBody2$outboundSchema.parse(
|
|
53
|
+
advanceTestClockRequestBody2,
|
|
54
|
+
),
|
|
55
|
+
);
|
|
48
56
|
}
|
|
49
57
|
|
|
50
58
|
/** @internal */
|
|
51
|
-
export type
|
|
59
|
+
export type AdvanceTestClockRequestBody1$Outbound = {
|
|
52
60
|
currentTime: string;
|
|
53
61
|
};
|
|
54
62
|
|
|
55
63
|
/** @internal */
|
|
56
|
-
export const
|
|
57
|
-
|
|
64
|
+
export const AdvanceTestClockRequestBody1$outboundSchema: z.ZodType<
|
|
65
|
+
AdvanceTestClockRequestBody1$Outbound,
|
|
58
66
|
z.ZodTypeDef,
|
|
59
|
-
|
|
67
|
+
AdvanceTestClockRequestBody1
|
|
60
68
|
> = z.object({
|
|
61
69
|
currentTime: z.date().transform(v => v.toISOString()),
|
|
62
70
|
});
|
|
63
71
|
|
|
64
|
-
export function
|
|
65
|
-
|
|
72
|
+
export function advanceTestClockRequestBody1ToJSON(
|
|
73
|
+
advanceTestClockRequestBody1: AdvanceTestClockRequestBody1,
|
|
74
|
+
): string {
|
|
75
|
+
return JSON.stringify(
|
|
76
|
+
AdvanceTestClockRequestBody1$outboundSchema.parse(
|
|
77
|
+
advanceTestClockRequestBody1,
|
|
78
|
+
),
|
|
79
|
+
);
|
|
66
80
|
}
|
|
67
81
|
|
|
68
82
|
/** @internal */
|
|
69
83
|
export type AdvanceTestClockRequestBody$Outbound =
|
|
70
|
-
|
|
|
71
|
-
|
|
|
84
|
+
| AdvanceTestClockRequestBody1$Outbound
|
|
85
|
+
| AdvanceTestClockRequestBody2$Outbound;
|
|
72
86
|
|
|
73
87
|
/** @internal */
|
|
74
88
|
export const AdvanceTestClockRequestBody$outboundSchema: z.ZodType<
|
|
@@ -76,8 +90,8 @@ export const AdvanceTestClockRequestBody$outboundSchema: z.ZodType<
|
|
|
76
90
|
z.ZodTypeDef,
|
|
77
91
|
AdvanceTestClockRequestBody
|
|
78
92
|
> = z.union([
|
|
79
|
-
z.lazy(() =>
|
|
80
|
-
z.lazy(() =>
|
|
93
|
+
z.lazy(() => AdvanceTestClockRequestBody1$outboundSchema),
|
|
94
|
+
z.lazy(() => AdvanceTestClockRequestBody2$outboundSchema),
|
|
81
95
|
]);
|
|
82
96
|
|
|
83
97
|
export function advanceTestClockRequestBodyToJSON(
|
|
@@ -93,7 +107,9 @@ export function advanceTestClockRequestBodyToJSON(
|
|
|
93
107
|
/** @internal */
|
|
94
108
|
export type AdvanceTestClockRequest$Outbound = {
|
|
95
109
|
id: string;
|
|
96
|
-
RequestBody:
|
|
110
|
+
RequestBody:
|
|
111
|
+
| AdvanceTestClockRequestBody1$Outbound
|
|
112
|
+
| AdvanceTestClockRequestBody2$Outbound;
|
|
97
113
|
};
|
|
98
114
|
|
|
99
115
|
/** @internal */
|
|
@@ -104,8 +120,8 @@ export const AdvanceTestClockRequest$outboundSchema: z.ZodType<
|
|
|
104
120
|
> = z.object({
|
|
105
121
|
id: z.string(),
|
|
106
122
|
requestBody: z.union([
|
|
107
|
-
z.lazy(() =>
|
|
108
|
-
z.lazy(() =>
|
|
123
|
+
z.lazy(() => AdvanceTestClockRequestBody1$outboundSchema),
|
|
124
|
+
z.lazy(() => AdvanceTestClockRequestBody2$outboundSchema),
|
|
109
125
|
]),
|
|
110
126
|
}).transform((v) => {
|
|
111
127
|
return remap$(v, {
|
|
@@ -44,9 +44,17 @@ export type GetBillableMetricMeterRequest = {
|
|
|
44
44
|
*/
|
|
45
45
|
filterGroupBy?: string | undefined;
|
|
46
46
|
/**
|
|
47
|
-
* Comma-separated dimension keys
|
|
47
|
+
* Comma-separated dimension keys. Configure keys for the grouping on the metric. Only the "subject" grouping is supported by default.
|
|
48
48
|
*/
|
|
49
49
|
groupBy?: string | undefined;
|
|
50
|
+
/**
|
|
51
|
+
* Cap groupedValues to the top-N by value (descending). With windowSize, restricts the windowed series to those top-N groups. Bounds the payload for high-cardinality groupings; groupCount reports the untruncated distinct-group count.
|
|
52
|
+
*/
|
|
53
|
+
groupLimit?: number | undefined;
|
|
54
|
+
/**
|
|
55
|
+
* Offset into the value-descending group ordering; requires groupLimit to page through grouped results. With windowSize set, pages the windowed series through the ranked groups (offset 0 yields the top-N).
|
|
56
|
+
*/
|
|
57
|
+
groupOffset?: number | undefined;
|
|
50
58
|
};
|
|
51
59
|
|
|
52
60
|
/** @internal */
|
|
@@ -63,6 +71,8 @@ export type GetBillableMetricMeterRequest$Outbound = {
|
|
|
63
71
|
windowSize?: string | undefined;
|
|
64
72
|
filterGroupBy?: string | undefined;
|
|
65
73
|
groupBy?: string | undefined;
|
|
74
|
+
groupLimit?: number | undefined;
|
|
75
|
+
groupOffset?: number | undefined;
|
|
66
76
|
};
|
|
67
77
|
|
|
68
78
|
/** @internal */
|
|
@@ -78,6 +88,8 @@ export const GetBillableMetricMeterRequest$outboundSchema: z.ZodType<
|
|
|
78
88
|
windowSize: GetBillableMetricMeterWindowSize$outboundSchema.optional(),
|
|
79
89
|
filterGroupBy: z.string().optional(),
|
|
80
90
|
groupBy: z.string().optional(),
|
|
91
|
+
groupLimit: z.number().int().optional(),
|
|
92
|
+
groupOffset: z.number().int().optional(),
|
|
81
93
|
});
|
|
82
94
|
|
|
83
95
|
export function getBillableMetricMeterRequestToJSON(
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import * as z from "zod/v3";
|
|
6
6
|
|
|
7
|
-
export type
|
|
7
|
+
export type IngestEventRequestBody2 = {
|
|
8
8
|
/**
|
|
9
9
|
* CloudEvents type. Must match an eventType configured on a BillableMetric.
|
|
10
10
|
*/
|
|
@@ -14,9 +14,52 @@ export type IngestEventRequest = {
|
|
|
14
14
|
*/
|
|
15
15
|
source: string;
|
|
16
16
|
/**
|
|
17
|
-
* Customer or entity ID this event relates to.
|
|
17
|
+
* Customer or entity ID this event relates to. Required unless externalSubject is provided.
|
|
18
|
+
*/
|
|
19
|
+
subject?: string | undefined;
|
|
20
|
+
/**
|
|
21
|
+
* Your own customer identifier, matched against the customer's externalId. Fallback for when the Paygentic customer ID is not known — prefer subject when it is. Events reported before the customer exists are linked retroactively once a customer with this externalId is created. Resolution is eventually consistent: after an externalId is removed or reassigned, events may resolve to the previous customer for up to one hour. If subject is also provided, subject takes precedence and externalSubject is recorded but not used for resolution.
|
|
22
|
+
*/
|
|
23
|
+
externalSubject: string;
|
|
24
|
+
/**
|
|
25
|
+
* Organization/merchant ID. Defaults to the authenticated user's organization. Platform users can specify a different organization.
|
|
26
|
+
*/
|
|
27
|
+
namespace?: string | undefined;
|
|
28
|
+
/**
|
|
29
|
+
* Event timestamp. Defaults to server time if not provided.
|
|
30
|
+
*/
|
|
31
|
+
timestamp?: Date | undefined;
|
|
32
|
+
/**
|
|
33
|
+
* User-provided deduplication key. If not provided, a unique key is generated.
|
|
34
|
+
*/
|
|
35
|
+
idempotencyKey?: string | undefined;
|
|
36
|
+
/**
|
|
37
|
+
* Optional external identifier for cross-referencing with external systems. Alphanumeric characters, hyphens, and underscores only.
|
|
38
|
+
*/
|
|
39
|
+
externalId?: string | undefined;
|
|
40
|
+
/**
|
|
41
|
+
* Event payload containing the metering data.
|
|
42
|
+
*/
|
|
43
|
+
data: { [k: string]: any };
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export type IngestEventRequestBody1 = {
|
|
47
|
+
/**
|
|
48
|
+
* CloudEvents type. Must match an eventType configured on a BillableMetric.
|
|
49
|
+
*/
|
|
50
|
+
type: string;
|
|
51
|
+
/**
|
|
52
|
+
* Event source URI identifying the application.
|
|
53
|
+
*/
|
|
54
|
+
source: string;
|
|
55
|
+
/**
|
|
56
|
+
* Customer or entity ID this event relates to. Required unless externalSubject is provided.
|
|
18
57
|
*/
|
|
19
58
|
subject: string;
|
|
59
|
+
/**
|
|
60
|
+
* Your own customer identifier, matched against the customer's externalId. Fallback for when the Paygentic customer ID is not known — prefer subject when it is. Events reported before the customer exists are linked retroactively once a customer with this externalId is created. Resolution is eventually consistent: after an externalId is removed or reassigned, events may resolve to the previous customer for up to one hour. If subject is also provided, subject takes precedence and externalSubject is recorded but not used for resolution.
|
|
61
|
+
*/
|
|
62
|
+
externalSubject?: string | undefined;
|
|
20
63
|
/**
|
|
21
64
|
* Organization/merchant ID. Defaults to the authenticated user's organization. Platform users can specify a different organization.
|
|
22
65
|
*/
|
|
@@ -39,11 +82,54 @@ export type IngestEventRequest = {
|
|
|
39
82
|
data: { [k: string]: any };
|
|
40
83
|
};
|
|
41
84
|
|
|
85
|
+
export type IngestEventRequest =
|
|
86
|
+
| IngestEventRequestBody1
|
|
87
|
+
| IngestEventRequestBody2;
|
|
88
|
+
|
|
89
|
+
/** @internal */
|
|
90
|
+
export type IngestEventRequestBody2$Outbound = {
|
|
91
|
+
type: string;
|
|
92
|
+
source: string;
|
|
93
|
+
subject?: string | undefined;
|
|
94
|
+
externalSubject: string;
|
|
95
|
+
namespace?: string | undefined;
|
|
96
|
+
timestamp?: string | undefined;
|
|
97
|
+
idempotencyKey?: string | undefined;
|
|
98
|
+
externalId?: string | undefined;
|
|
99
|
+
data: { [k: string]: any };
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
/** @internal */
|
|
103
|
+
export const IngestEventRequestBody2$outboundSchema: z.ZodType<
|
|
104
|
+
IngestEventRequestBody2$Outbound,
|
|
105
|
+
z.ZodTypeDef,
|
|
106
|
+
IngestEventRequestBody2
|
|
107
|
+
> = z.object({
|
|
108
|
+
type: z.string(),
|
|
109
|
+
source: z.string(),
|
|
110
|
+
subject: z.string().optional(),
|
|
111
|
+
externalSubject: z.string(),
|
|
112
|
+
namespace: z.string().optional(),
|
|
113
|
+
timestamp: z.date().transform(v => v.toISOString()).optional(),
|
|
114
|
+
idempotencyKey: z.string().optional(),
|
|
115
|
+
externalId: z.string().optional(),
|
|
116
|
+
data: z.record(z.any()),
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
export function ingestEventRequestBody2ToJSON(
|
|
120
|
+
ingestEventRequestBody2: IngestEventRequestBody2,
|
|
121
|
+
): string {
|
|
122
|
+
return JSON.stringify(
|
|
123
|
+
IngestEventRequestBody2$outboundSchema.parse(ingestEventRequestBody2),
|
|
124
|
+
);
|
|
125
|
+
}
|
|
126
|
+
|
|
42
127
|
/** @internal */
|
|
43
|
-
export type
|
|
128
|
+
export type IngestEventRequestBody1$Outbound = {
|
|
44
129
|
type: string;
|
|
45
130
|
source: string;
|
|
46
131
|
subject: string;
|
|
132
|
+
externalSubject?: string | undefined;
|
|
47
133
|
namespace?: string | undefined;
|
|
48
134
|
timestamp?: string | undefined;
|
|
49
135
|
idempotencyKey?: string | undefined;
|
|
@@ -52,14 +138,15 @@ export type IngestEventRequest$Outbound = {
|
|
|
52
138
|
};
|
|
53
139
|
|
|
54
140
|
/** @internal */
|
|
55
|
-
export const
|
|
56
|
-
|
|
141
|
+
export const IngestEventRequestBody1$outboundSchema: z.ZodType<
|
|
142
|
+
IngestEventRequestBody1$Outbound,
|
|
57
143
|
z.ZodTypeDef,
|
|
58
|
-
|
|
144
|
+
IngestEventRequestBody1
|
|
59
145
|
> = z.object({
|
|
60
146
|
type: z.string(),
|
|
61
147
|
source: z.string(),
|
|
62
148
|
subject: z.string(),
|
|
149
|
+
externalSubject: z.string().optional(),
|
|
63
150
|
namespace: z.string().optional(),
|
|
64
151
|
timestamp: z.date().transform(v => v.toISOString()).optional(),
|
|
65
152
|
idempotencyKey: z.string().optional(),
|
|
@@ -67,6 +154,29 @@ export const IngestEventRequest$outboundSchema: z.ZodType<
|
|
|
67
154
|
data: z.record(z.any()),
|
|
68
155
|
});
|
|
69
156
|
|
|
157
|
+
export function ingestEventRequestBody1ToJSON(
|
|
158
|
+
ingestEventRequestBody1: IngestEventRequestBody1,
|
|
159
|
+
): string {
|
|
160
|
+
return JSON.stringify(
|
|
161
|
+
IngestEventRequestBody1$outboundSchema.parse(ingestEventRequestBody1),
|
|
162
|
+
);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/** @internal */
|
|
166
|
+
export type IngestEventRequest$Outbound =
|
|
167
|
+
| IngestEventRequestBody1$Outbound
|
|
168
|
+
| IngestEventRequestBody2$Outbound;
|
|
169
|
+
|
|
170
|
+
/** @internal */
|
|
171
|
+
export const IngestEventRequest$outboundSchema: z.ZodType<
|
|
172
|
+
IngestEventRequest$Outbound,
|
|
173
|
+
z.ZodTypeDef,
|
|
174
|
+
IngestEventRequest
|
|
175
|
+
> = z.union([
|
|
176
|
+
z.lazy(() => IngestEventRequestBody1$outboundSchema),
|
|
177
|
+
z.lazy(() => IngestEventRequestBody2$outboundSchema),
|
|
178
|
+
]);
|
|
179
|
+
|
|
70
180
|
export function ingestEventRequestToJSON(
|
|
71
181
|
ingestEventRequest: IngestEventRequest,
|
|
72
182
|
): string {
|
|
@@ -30,6 +30,10 @@ export type ListBillableMetricEventsRequest = {
|
|
|
30
30
|
* Filter by external identifier. Alphanumeric characters, hyphens, and underscores only.
|
|
31
31
|
*/
|
|
32
32
|
externalId?: string | undefined;
|
|
33
|
+
/**
|
|
34
|
+
* Filter by the merchant's own customer identifier the event was reported with.
|
|
35
|
+
*/
|
|
36
|
+
externalSubject?: string | undefined;
|
|
33
37
|
};
|
|
34
38
|
|
|
35
39
|
/** @internal */
|
|
@@ -41,6 +45,7 @@ export type ListBillableMetricEventsRequest$Outbound = {
|
|
|
41
45
|
limit: number;
|
|
42
46
|
offset: number;
|
|
43
47
|
externalId?: string | undefined;
|
|
48
|
+
externalSubject?: string | undefined;
|
|
44
49
|
};
|
|
45
50
|
|
|
46
51
|
/** @internal */
|
|
@@ -56,6 +61,7 @@ export const ListBillableMetricEventsRequest$outboundSchema: z.ZodType<
|
|
|
56
61
|
limit: z.number().int().default(20),
|
|
57
62
|
offset: z.number().int().default(0),
|
|
58
63
|
externalId: z.string().optional(),
|
|
64
|
+
externalSubject: z.string().optional(),
|
|
59
65
|
});
|
|
60
66
|
|
|
61
67
|
export function listBillableMetricEventsRequestToJSON(
|