@paygentic/sdk 0.10.6 → 0.10.8
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.d.ts +1 -1
- package/dist/commonjs/funcs/billableMetricsListEvents.js +1 -1
- package/dist/commonjs/funcs/externalReferencesDeleteExternalReference.js +2 -2
- package/dist/commonjs/funcs/externalReferencesDeleteExternalReference.js.map +1 -1
- package/dist/commonjs/lib/config.d.ts +2 -2
- package/dist/commonjs/lib/config.js +2 -2
- package/dist/commonjs/models/entitytype.d.ts +8 -6
- package/dist/commonjs/models/entitytype.d.ts.map +1 -1
- package/dist/commonjs/models/entitytype.js +6 -5
- package/dist/commonjs/models/entitytype.js.map +1 -1
- package/dist/commonjs/models/entitytypeinput.d.ts +16 -0
- package/dist/commonjs/models/entitytypeinput.d.ts.map +1 -0
- package/dist/commonjs/models/entitytypeinput.js +50 -0
- package/dist/commonjs/models/entitytypeinput.js.map +1 -0
- package/dist/commonjs/models/externalreference.d.ts +1 -1
- package/dist/commonjs/models/index.d.ts +1 -0
- package/dist/commonjs/models/index.d.ts.map +1 -1
- package/dist/commonjs/models/index.js +1 -0
- package/dist/commonjs/models/index.js.map +1 -1
- package/dist/commonjs/models/operations/createexternalreference.d.ts +2 -2
- package/dist/commonjs/models/operations/createexternalreference.d.ts.map +1 -1
- package/dist/commonjs/models/operations/createexternalreference.js +1 -1
- package/dist/commonjs/models/operations/createexternalreference.js.map +1 -1
- package/dist/commonjs/models/operations/createplan.d.ts +1 -1
- package/dist/commonjs/models/operations/createsubscription.d.ts +5 -0
- package/dist/commonjs/models/operations/createsubscription.d.ts.map +1 -1
- package/dist/commonjs/models/operations/createsubscription.js +1 -0
- package/dist/commonjs/models/operations/createsubscription.js.map +1 -1
- package/dist/commonjs/models/operations/updatesubscription.d.ts +0 -1
- package/dist/commonjs/models/operations/updatesubscription.d.ts.map +1 -1
- package/dist/commonjs/models/operations/updatesubscription.js +0 -1
- package/dist/commonjs/models/operations/updatesubscription.js.map +1 -1
- package/dist/commonjs/models/permission.d.ts +6 -3
- package/dist/commonjs/models/permission.d.ts.map +1 -1
- package/dist/commonjs/models/permission.js +5 -3
- package/dist/commonjs/models/permission.js.map +1 -1
- package/dist/commonjs/models/plan.d.ts +1 -1
- package/dist/commonjs/sdk/billablemetrics.d.ts +1 -1
- package/dist/commonjs/sdk/billablemetrics.js +1 -1
- package/dist/esm/funcs/billableMetricsListEvents.d.ts +1 -1
- package/dist/esm/funcs/billableMetricsListEvents.js +1 -1
- package/dist/esm/funcs/externalReferencesDeleteExternalReference.js +2 -2
- package/dist/esm/funcs/externalReferencesDeleteExternalReference.js.map +1 -1
- package/dist/esm/lib/config.d.ts +2 -2
- package/dist/esm/lib/config.js +2 -2
- package/dist/esm/models/entitytype.d.ts +8 -6
- package/dist/esm/models/entitytype.d.ts.map +1 -1
- package/dist/esm/models/entitytype.js +6 -5
- package/dist/esm/models/entitytype.js.map +1 -1
- package/dist/esm/models/entitytypeinput.d.ts +16 -0
- package/dist/esm/models/entitytypeinput.d.ts.map +1 -0
- package/dist/esm/models/entitytypeinput.js +14 -0
- package/dist/esm/models/entitytypeinput.js.map +1 -0
- package/dist/esm/models/externalreference.d.ts +1 -1
- package/dist/esm/models/index.d.ts +1 -0
- package/dist/esm/models/index.d.ts.map +1 -1
- package/dist/esm/models/index.js +1 -0
- package/dist/esm/models/index.js.map +1 -1
- package/dist/esm/models/operations/createexternalreference.d.ts +2 -2
- package/dist/esm/models/operations/createexternalreference.d.ts.map +1 -1
- package/dist/esm/models/operations/createexternalreference.js +1 -1
- package/dist/esm/models/operations/createexternalreference.js.map +1 -1
- package/dist/esm/models/operations/createplan.d.ts +1 -1
- package/dist/esm/models/operations/createsubscription.d.ts +5 -0
- package/dist/esm/models/operations/createsubscription.d.ts.map +1 -1
- package/dist/esm/models/operations/createsubscription.js +1 -0
- package/dist/esm/models/operations/createsubscription.js.map +1 -1
- package/dist/esm/models/operations/updatesubscription.d.ts +0 -1
- package/dist/esm/models/operations/updatesubscription.d.ts.map +1 -1
- package/dist/esm/models/operations/updatesubscription.js +0 -1
- package/dist/esm/models/operations/updatesubscription.js.map +1 -1
- package/dist/esm/models/permission.d.ts +6 -3
- package/dist/esm/models/permission.d.ts.map +1 -1
- package/dist/esm/models/permission.js +5 -3
- package/dist/esm/models/permission.js.map +1 -1
- package/dist/esm/models/plan.d.ts +1 -1
- package/dist/esm/sdk/billablemetrics.d.ts +1 -1
- package/dist/esm/sdk/billablemetrics.js +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/funcs/billableMetricsListEvents.ts +1 -1
- package/src/funcs/externalReferencesDeleteExternalReference.ts +2 -2
- package/src/lib/config.ts +2 -2
- package/src/models/entitytype.ts +17 -8
- package/src/models/entitytypeinput.ts +23 -0
- package/src/models/externalreference.ts +1 -1
- package/src/models/index.ts +1 -0
- package/src/models/operations/createexternalreference.ts +3 -3
- package/src/models/operations/createplan.ts +1 -1
- package/src/models/operations/createsubscription.ts +6 -0
- package/src/models/operations/updatesubscription.ts +0 -1
- package/src/models/permission.ts +11 -4
- package/src/models/plan.ts +1 -1
- package/src/sdk/billablemetrics.ts +1 -1
|
@@ -135,7 +135,7 @@ async function $do(
|
|
|
135
135
|
|
|
136
136
|
const doResult = await client._do(req, {
|
|
137
137
|
context,
|
|
138
|
-
errorCodes: ["401", "403", "404", "4XX", "500", "5XX"],
|
|
138
|
+
errorCodes: ["401", "403", "404", "409", "4XX", "500", "5XX"],
|
|
139
139
|
retryConfig: context.retryConfig,
|
|
140
140
|
retryCodes: context.retryCodes,
|
|
141
141
|
});
|
|
@@ -161,7 +161,7 @@ async function $do(
|
|
|
161
161
|
| SDKValidationError
|
|
162
162
|
>(
|
|
163
163
|
M.nil(204, z.void()),
|
|
164
|
-
M.jsonErr([401, 403, 404], errors.ErrorT$inboundSchema),
|
|
164
|
+
M.jsonErr([401, 403, 404, 409], errors.ErrorT$inboundSchema),
|
|
165
165
|
M.jsonErr(500, errors.ErrorT$inboundSchema),
|
|
166
166
|
M.fail("4XX"),
|
|
167
167
|
M.fail("5XX"),
|
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.10.
|
|
68
|
+
sdkVersion: "0.10.8",
|
|
69
69
|
genVersion: "2.879.13",
|
|
70
|
-
userAgent: "speakeasy-sdk/typescript 0.10.
|
|
70
|
+
userAgent: "speakeasy-sdk/typescript 0.10.8 2.879.13 0.1.0 @paygentic/sdk",
|
|
71
71
|
} as const;
|
package/src/models/entitytype.ts
CHANGED
|
@@ -3,23 +3,32 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import * as z from "zod/v3";
|
|
6
|
-
import
|
|
6
|
+
import * as openEnums from "../types/enums.js";
|
|
7
|
+
import { OpenEnum } from "../types/enums.js";
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
|
-
* The type of Paygentic entity this external reference points at
|
|
10
|
+
* The type of Paygentic entity this external reference points at. `subscriptionProposal` and `subscription` references link a subscription proposal, and the subscription its approval creates, to the CRM record they come from. They are read-only through these endpoints.
|
|
10
11
|
*/
|
|
11
12
|
export const EntityType = {
|
|
12
13
|
Item: "item",
|
|
13
14
|
Customer: "customer",
|
|
15
|
+
SubscriptionProposal: "subscriptionProposal",
|
|
16
|
+
Subscription: "subscription",
|
|
14
17
|
} as const;
|
|
15
18
|
/**
|
|
16
|
-
* The type of Paygentic entity this external reference points at
|
|
19
|
+
* The type of Paygentic entity this external reference points at. `subscriptionProposal` and `subscription` references link a subscription proposal, and the subscription its approval creates, to the CRM record they come from. They are read-only through these endpoints.
|
|
17
20
|
*/
|
|
18
|
-
export type EntityType =
|
|
21
|
+
export type EntityType = OpenEnum<typeof EntityType>;
|
|
19
22
|
|
|
20
23
|
/** @internal */
|
|
21
|
-
export const EntityType$inboundSchema: z.
|
|
22
|
-
|
|
24
|
+
export const EntityType$inboundSchema: z.ZodType<
|
|
25
|
+
EntityType,
|
|
26
|
+
z.ZodTypeDef,
|
|
27
|
+
unknown
|
|
28
|
+
> = openEnums.inboundSchema(EntityType);
|
|
23
29
|
/** @internal */
|
|
24
|
-
export const EntityType$outboundSchema: z.
|
|
25
|
-
|
|
30
|
+
export const EntityType$outboundSchema: z.ZodType<
|
|
31
|
+
string,
|
|
32
|
+
z.ZodTypeDef,
|
|
33
|
+
EntityType
|
|
34
|
+
> = openEnums.outboundSchema(EntityType);
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { ClosedEnum } from "../types/enums.js";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* The type of Paygentic entity a new external reference points at
|
|
10
|
+
*/
|
|
11
|
+
export const EntityTypeInput = {
|
|
12
|
+
Item: "item",
|
|
13
|
+
Customer: "customer",
|
|
14
|
+
} as const;
|
|
15
|
+
/**
|
|
16
|
+
* The type of Paygentic entity a new external reference points at
|
|
17
|
+
*/
|
|
18
|
+
export type EntityTypeInput = ClosedEnum<typeof EntityTypeInput>;
|
|
19
|
+
|
|
20
|
+
/** @internal */
|
|
21
|
+
export const EntityTypeInput$outboundSchema: z.ZodNativeEnum<
|
|
22
|
+
typeof EntityTypeInput
|
|
23
|
+
> = z.nativeEnum(EntityTypeInput);
|
|
@@ -30,7 +30,7 @@ export type ExternalReference = {
|
|
|
30
30
|
*/
|
|
31
31
|
merchantId: string;
|
|
32
32
|
/**
|
|
33
|
-
* The type of Paygentic entity this external reference points at
|
|
33
|
+
* The type of Paygentic entity this external reference points at. `subscriptionProposal` and `subscription` references link a subscription proposal, and the subscription its approval creates, to the CRM record they come from. They are read-only through these endpoints.
|
|
34
34
|
*/
|
|
35
35
|
entityType: EntityType;
|
|
36
36
|
entityId: string;
|
package/src/models/index.ts
CHANGED
|
@@ -41,6 +41,7 @@ export * from "./entitlementlistitem.js";
|
|
|
41
41
|
export * from "./entitlementstatus.js";
|
|
42
42
|
export * from "./entitlementtemplate.js";
|
|
43
43
|
export * from "./entitytype.js";
|
|
44
|
+
export * from "./entitytypeinput.js";
|
|
44
45
|
export * from "./eventresponse.js";
|
|
45
46
|
export * from "./externalreference.js";
|
|
46
47
|
export * from "./feature.js";
|
|
@@ -11,9 +11,9 @@ export type CreateExternalReferenceRequest = {
|
|
|
11
11
|
*/
|
|
12
12
|
merchantId: string;
|
|
13
13
|
/**
|
|
14
|
-
* The type of Paygentic entity
|
|
14
|
+
* The type of Paygentic entity a new external reference points at
|
|
15
15
|
*/
|
|
16
|
-
entityType: models.
|
|
16
|
+
entityType: models.EntityTypeInput;
|
|
17
17
|
/**
|
|
18
18
|
* Paygentic id of the entity, e.g. `itm_xxx`
|
|
19
19
|
*/
|
|
@@ -77,7 +77,7 @@ export const CreateExternalReferenceRequest$outboundSchema: z.ZodType<
|
|
|
77
77
|
CreateExternalReferenceRequest
|
|
78
78
|
> = z.object({
|
|
79
79
|
merchantId: z.string(),
|
|
80
|
-
entityType: models.
|
|
80
|
+
entityType: models.EntityTypeInput$outboundSchema,
|
|
81
81
|
entityId: z.string(),
|
|
82
82
|
provider: z.string(),
|
|
83
83
|
externalId: z.string(),
|
|
@@ -123,7 +123,7 @@ export type CreatePlanRequest = {
|
|
|
123
123
|
*/
|
|
124
124
|
billingVersion?: BillingVersion | undefined;
|
|
125
125
|
/**
|
|
126
|
-
* ISO 8601 datetime reference point for billing period alignment. Must be in the past or present. When set, subscriptions created under this plan align their first billing period to the next recurrence of this anchor
|
|
126
|
+
* ISO 8601 datetime reference point for billing period alignment. Must be in the past or present. When set, subscriptions created under this plan align their first billing period to the next recurrence of this anchor, unless the create names its own `billingAnchor`.
|
|
127
127
|
*/
|
|
128
128
|
billingAnchor?: Date | null | undefined;
|
|
129
129
|
/**
|
|
@@ -101,6 +101,10 @@ export type CreateSubscriptionRequest = {
|
|
|
101
101
|
* Whether a backdated start bills its elapsed periods. A start is backdated when `startedAt` is more than 24 hours before the subscription is created. `none` bills only charges that fall due from the moment of creation, for a customer whose earlier periods another system already billed. `per_period` bills every charge that fell due from `startedAt`, on one first invoice; it refuses a `startedAt` more than 12 months back. Has no effect on a start that is not backdated. Defaults to `none`.
|
|
102
102
|
*/
|
|
103
103
|
elapsedPeriodBilling?: models.ElapsedPeriodBilling | undefined;
|
|
104
|
+
/**
|
|
105
|
+
* A billing anchor for this subscription, in place of the plan's. Any instant, past or future. The subscription's billing anchor is its first recurrence on or after `startedAt`, stepping back or forward by whole billing cadences. Example: on a monthly plan, an anchor of '2027-01-31T00:00:00Z' with a start of '2026-10-10T00:00:00Z' gives '2026-10-31T00:00:00Z'. A create is refused with 400 when the resolved anchor does not line up with the usage period anchor of a feature that credits unused balance. Omit it to use the plan's billing anchor. A repeated create that names an anchor resolving to a different instant than the existing subscription's gets 409.
|
|
106
|
+
*/
|
|
107
|
+
billingAnchor?: Date | undefined;
|
|
104
108
|
/**
|
|
105
109
|
* Test clock identifier for simulating time-based billing scenarios. Sample values: 'tc_abc123xyz', 'tc_789def456'. Restricted to non-production environments (local, dev, sandbox). Must belong to the same merchant organization.
|
|
106
110
|
*/
|
|
@@ -231,6 +235,7 @@ export type CreateSubscriptionRequest$Outbound = {
|
|
|
231
235
|
redirectUrls?: RedirectUrls$Outbound | undefined;
|
|
232
236
|
startedAt: string;
|
|
233
237
|
elapsedPeriodBilling: string;
|
|
238
|
+
billingAnchor?: string | undefined;
|
|
234
239
|
testClockId?: string | undefined;
|
|
235
240
|
renewalReminderEnabled?: boolean | null | undefined;
|
|
236
241
|
renewalReminderDays?: number | null | undefined;
|
|
@@ -265,6 +270,7 @@ export const CreateSubscriptionRequest$outboundSchema: z.ZodType<
|
|
|
265
270
|
elapsedPeriodBilling: models.ElapsedPeriodBilling$outboundSchema.default(
|
|
266
271
|
"none",
|
|
267
272
|
),
|
|
273
|
+
billingAnchor: z.date().transform(v => v.toISOString()).optional(),
|
|
268
274
|
testClockId: z.string().optional(),
|
|
269
275
|
renewalReminderEnabled: z.nullable(z.boolean()).optional(),
|
|
270
276
|
renewalReminderDays: z.nullable(z.number().int()).optional(),
|
package/src/models/permission.ts
CHANGED
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import * as z from "zod/v3";
|
|
6
|
-
import
|
|
6
|
+
import * as openEnums from "../types/enums.js";
|
|
7
|
+
import { OpenEnum } from "../types/enums.js";
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* A permission of the catalog: a resource read or write, or a sensitive action.
|
|
@@ -26,6 +27,7 @@ export const Permission = {
|
|
|
26
27
|
PricingUnitsRead: "pricingUnits:read",
|
|
27
28
|
SubscriptionsRead: "subscriptions:read",
|
|
28
29
|
SubscriptionAdjustmentsRead: "subscriptionAdjustments:read",
|
|
30
|
+
SubscriptionProposalsRead: "subscriptionProposals:read",
|
|
29
31
|
DiscountsRead: "discounts:read",
|
|
30
32
|
GrantsRead: "grants:read",
|
|
31
33
|
EntitlementsRead: "entitlements:read",
|
|
@@ -71,6 +73,7 @@ export const Permission = {
|
|
|
71
73
|
PricingUnitsWrite: "pricingUnits:write",
|
|
72
74
|
SubscriptionsWrite: "subscriptions:write",
|
|
73
75
|
SubscriptionAdjustmentsWrite: "subscriptionAdjustments:write",
|
|
76
|
+
SubscriptionProposalsWrite: "subscriptionProposals:write",
|
|
74
77
|
DiscountsWrite: "discounts:write",
|
|
75
78
|
GrantsWrite: "grants:write",
|
|
76
79
|
EntitlementsWrite: "entitlements:write",
|
|
@@ -113,12 +116,16 @@ export const Permission = {
|
|
|
113
116
|
SubscriptionsTaxExempt: "subscriptions:taxExempt",
|
|
114
117
|
SubscriptionsAutoApprove: "subscriptions:autoApprove",
|
|
115
118
|
OrganizationResetData: "organization:resetData",
|
|
119
|
+
SubscriptionProposalsApprove: "subscriptionProposals:approve",
|
|
116
120
|
} as const;
|
|
117
121
|
/**
|
|
118
122
|
* A permission of the catalog: a resource read or write, or a sensitive action.
|
|
119
123
|
*/
|
|
120
|
-
export type Permission =
|
|
124
|
+
export type Permission = OpenEnum<typeof Permission>;
|
|
121
125
|
|
|
122
126
|
/** @internal */
|
|
123
|
-
export const Permission$inboundSchema: z.
|
|
124
|
-
|
|
127
|
+
export const Permission$inboundSchema: z.ZodType<
|
|
128
|
+
Permission,
|
|
129
|
+
z.ZodTypeDef,
|
|
130
|
+
unknown
|
|
131
|
+
> = openEnums.inboundSchema(Permission);
|
package/src/models/plan.ts
CHANGED
|
@@ -115,7 +115,7 @@ export type Plan = {
|
|
|
115
115
|
*/
|
|
116
116
|
billingVersion?: number | undefined;
|
|
117
117
|
/**
|
|
118
|
-
* ISO 8601 datetime reference point for billing period alignment. Must be in the past or present at the time of creation or update. When set,
|
|
118
|
+
* ISO 8601 datetime reference point for billing period alignment. Must be in the past or present at the time of creation or update. When set, subscriptions created under this plan align their first billing period to the next recurrence of this anchor, unless the create names its own `billingAnchor`. Null means each subscription uses its own start time (hour-rounded) as the anchor, unless the create names one.
|
|
119
119
|
*/
|
|
120
120
|
billingAnchor?: Date | null | undefined;
|
|
121
121
|
/**
|
|
@@ -94,7 +94,7 @@ export class BillableMetrics extends ClientSDK {
|
|
|
94
94
|
* List Meter Events
|
|
95
95
|
*
|
|
96
96
|
* @remarks
|
|
97
|
-
* List raw underlying events for a billable metric from the metering service. Returns events ordered by time descending.
|
|
97
|
+
* List raw underlying events for a billable metric from the metering service. Returns events ordered by time descending. Events before the metric's `eventFrom` are left out, as its usage leaves them out.
|
|
98
98
|
*/
|
|
99
99
|
async listEvents(
|
|
100
100
|
request: operations.ListBillableMetricEventsRequest,
|