@flexprice/sdk 2.1.11 → 2.1.17
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/docs/sdk/models/changed-subscription.md +7 -5
- package/docs/sdk/models/create-invoice-line-item-request.md +25 -22
- package/docs/sdk/models/create-user-response.md +1 -0
- package/docs/sdk/models/entity-integration-mapping-response.md +1 -0
- package/docs/sdk/models/entity-sync-config.md +16 -0
- package/docs/sdk/models/execute-subscription-modify-request-request.md +1 -1
- package/docs/sdk/models/execute-subscription-modify-request.md +1 -0
- package/docs/sdk/models/get-entity-integration-mappings-request.md +19 -0
- package/docs/sdk/models/integration-config-entry.md +17 -0
- package/docs/sdk/models/integration-config-response.md +15 -0
- package/docs/sdk/models/invoice-billing-reason.md +1 -1
- package/docs/sdk/models/invoice-filter.md +2 -0
- package/docs/sdk/models/invoice-line-item-response.md +38 -36
- package/docs/sdk/models/invoice-sync-settings.md +15 -0
- package/docs/sdk/models/list-entity-integration-mappings-response.md +16 -0
- package/docs/sdk/models/payment-gateway-type.md +1 -1
- package/docs/sdk/models/preview-subscription-modify-request.md +1 -1
- package/docs/sdk/models/price-price.md +43 -42
- package/docs/sdk/models/price-response.md +48 -47
- package/docs/sdk/models/s3-export-config.md +20 -0
- package/docs/sdk/models/secret-provider.md +1 -1
- package/docs/sdk/models/sub-modify-trial-end-request.md +18 -0
- package/docs/sdk/models/subscription-modify-type.md +2 -2
- package/docs/sdk/models/subscription-response-v2.md +2 -0
- package/docs/sdk/models/subscription-response.md +1 -0
- package/docs/sdk/models/sync-config.md +23 -0
- package/docs/sdk/models/trial-end-action.md +15 -0
- package/docs/sdk/models/update-user-request.md +15 -0
- package/docs/sdk/models/update-user-response.md +20 -0
- package/docs/sdk/models/user-response.md +1 -0
- package/docs/sdks/integrations/README.md +143 -0
- package/docs/sdks/subscriptions/README.md +2 -2
- package/docs/sdks/users/README.md +72 -0
- package/esm/funcs/integrations-get-entity-integration-mappings.d.ts +17 -0
- package/esm/funcs/integrations-get-entity-integration-mappings.d.ts.map +1 -0
- package/esm/funcs/integrations-get-entity-integration-mappings.js +91 -0
- package/esm/funcs/integrations-get-entity-integration-mappings.js.map +1 -0
- package/esm/funcs/integrations-get-integration-config.d.ts +17 -0
- package/esm/funcs/integrations-get-integration-config.d.ts.map +1 -0
- package/esm/funcs/integrations-get-integration-config.js +72 -0
- package/esm/funcs/integrations-get-integration-config.js.map +1 -0
- package/esm/funcs/users-update-user.d.ts +17 -0
- package/esm/funcs/users-update-user.d.ts.map +1 -0
- package/esm/funcs/users-update-user.js +83 -0
- package/esm/funcs/users-update-user.js.map +1 -0
- package/esm/lib/config.d.ts +3 -3
- package/esm/lib/config.js +3 -3
- package/esm/sdk/integrations.d.ts +14 -0
- package/esm/sdk/integrations.d.ts.map +1 -1
- package/esm/sdk/integrations.js +20 -0
- package/esm/sdk/integrations.js.map +1 -1
- package/esm/sdk/models/changed-subscription.d.ts +2 -0
- package/esm/sdk/models/changed-subscription.d.ts.map +1 -1
- package/esm/sdk/models/changed-subscription.js +10 -2
- package/esm/sdk/models/changed-subscription.js.map +1 -1
- package/esm/sdk/models/create-invoice-line-item-request.d.ts +18 -0
- package/esm/sdk/models/create-invoice-line-item-request.d.ts.map +1 -1
- package/esm/sdk/models/create-invoice-line-item-request.js +6 -0
- package/esm/sdk/models/create-invoice-line-item-request.js.map +1 -1
- package/esm/sdk/models/create-user-response.d.ts +3 -0
- package/esm/sdk/models/create-user-response.d.ts.map +1 -1
- package/esm/sdk/models/create-user-response.js +1 -0
- package/esm/sdk/models/create-user-response.js.map +1 -1
- package/esm/sdk/models/entity-integration-mapping-response.d.ts +3 -0
- package/esm/sdk/models/entity-integration-mapping-response.d.ts.map +1 -1
- package/esm/sdk/models/entity-integration-mapping-response.js +1 -0
- package/esm/sdk/models/entity-integration-mapping-response.js.map +1 -1
- package/esm/sdk/models/entity-sync-config.d.ts +17 -0
- package/esm/sdk/models/entity-sync-config.d.ts.map +1 -0
- package/esm/sdk/models/entity-sync-config.js +15 -0
- package/esm/sdk/models/entity-sync-config.js.map +1 -0
- package/esm/sdk/models/execute-subscription-modify-request.d.ts +3 -0
- package/esm/sdk/models/execute-subscription-modify-request.d.ts.map +1 -1
- package/esm/sdk/models/execute-subscription-modify-request.js +3 -0
- package/esm/sdk/models/execute-subscription-modify-request.js.map +1 -1
- package/esm/sdk/models/get-entity-integration-mappings-op.d.ts +20 -0
- package/esm/sdk/models/get-entity-integration-mappings-op.d.ts.map +1 -0
- package/esm/sdk/models/get-entity-integration-mappings-op.js +19 -0
- package/esm/sdk/models/get-entity-integration-mappings-op.js.map +1 -0
- package/esm/sdk/models/index.d.ts +12 -0
- package/esm/sdk/models/index.d.ts.map +1 -1
- package/esm/sdk/models/index.js +12 -0
- package/esm/sdk/models/index.js.map +1 -1
- package/esm/sdk/models/integration-config-entry.d.ts +14 -0
- package/esm/sdk/models/integration-config-entry.d.ts.map +1 -0
- package/esm/sdk/models/integration-config-entry.js +24 -0
- package/esm/sdk/models/integration-config-entry.js.map +1 -0
- package/esm/sdk/models/integration-config-response.d.ts +11 -0
- package/esm/sdk/models/integration-config-response.d.ts.map +1 -0
- package/esm/sdk/models/integration-config-response.js +15 -0
- package/esm/sdk/models/integration-config-response.js.map +1 -0
- package/esm/sdk/models/invoice-billing-reason.d.ts +1 -0
- package/esm/sdk/models/invoice-billing-reason.d.ts.map +1 -1
- package/esm/sdk/models/invoice-billing-reason.js +1 -0
- package/esm/sdk/models/invoice-billing-reason.js.map +1 -1
- package/esm/sdk/models/invoice-filter.d.ts +11 -0
- package/esm/sdk/models/invoice-filter.d.ts.map +1 -1
- package/esm/sdk/models/invoice-filter.js +4 -0
- package/esm/sdk/models/invoice-filter.js.map +1 -1
- package/esm/sdk/models/invoice-line-item-response.d.ts +11 -0
- package/esm/sdk/models/invoice-line-item-response.d.ts.map +1 -1
- package/esm/sdk/models/invoice-line-item-response.js +4 -0
- package/esm/sdk/models/invoice-line-item-response.js.map +1 -1
- package/esm/sdk/models/invoice-sync-settings.d.ts +11 -0
- package/esm/sdk/models/invoice-sync-settings.d.ts.map +1 -0
- package/esm/sdk/models/invoice-sync-settings.js +20 -0
- package/esm/sdk/models/invoice-sync-settings.js.map +1 -0
- package/esm/sdk/models/list-entity-integration-mappings-response.d.ts +13 -0
- package/esm/sdk/models/list-entity-integration-mappings-response.d.ts.map +1 -0
- package/esm/sdk/models/list-entity-integration-mappings-response.js +17 -0
- package/esm/sdk/models/list-entity-integration-mappings-response.js.map +1 -0
- package/esm/sdk/models/payment-gateway-type.d.ts +1 -0
- package/esm/sdk/models/payment-gateway-type.d.ts.map +1 -1
- package/esm/sdk/models/payment-gateway-type.js +1 -0
- package/esm/sdk/models/payment-gateway-type.js.map +1 -1
- package/esm/sdk/models/price-price.d.ts +9 -0
- package/esm/sdk/models/price-price.d.ts.map +1 -1
- package/esm/sdk/models/price-price.js +1 -0
- package/esm/sdk/models/price-price.js.map +1 -1
- package/esm/sdk/models/price-response.d.ts +9 -0
- package/esm/sdk/models/price-response.d.ts.map +1 -1
- package/esm/sdk/models/price-response.js +1 -0
- package/esm/sdk/models/price-response.js.map +1 -1
- package/esm/sdk/models/s3-export-config.d.ts +29 -0
- package/esm/sdk/models/s3-export-config.d.ts.map +1 -0
- package/esm/sdk/models/s3-export-config.js +27 -0
- package/esm/sdk/models/s3-export-config.js.map +1 -0
- package/esm/sdk/models/secret-provider.d.ts +1 -0
- package/esm/sdk/models/secret-provider.d.ts.map +1 -1
- package/esm/sdk/models/secret-provider.js +1 -0
- package/esm/sdk/models/secret-provider.js.map +1 -1
- package/esm/sdk/models/sub-modify-trial-end-request.d.ts +18 -0
- package/esm/sdk/models/sub-modify-trial-end-request.d.ts.map +1 -0
- package/esm/sdk/models/sub-modify-trial-end-request.js +19 -0
- package/esm/sdk/models/sub-modify-trial-end-request.js.map +1 -0
- package/esm/sdk/models/subscription-modify-type.d.ts +1 -0
- package/esm/sdk/models/subscription-modify-type.d.ts.map +1 -1
- package/esm/sdk/models/subscription-modify-type.js +1 -0
- package/esm/sdk/models/subscription-modify-type.js.map +1 -1
- package/esm/sdk/models/subscription-response-v2.d.ts +16 -0
- package/esm/sdk/models/subscription-response-v2.d.ts.map +1 -1
- package/esm/sdk/models/subscription-response-v2.js +4 -0
- package/esm/sdk/models/subscription-response-v2.js.map +1 -1
- package/esm/sdk/models/subscription-response.d.ts +8 -0
- package/esm/sdk/models/subscription-response.d.ts.map +1 -1
- package/esm/sdk/models/subscription-response.js +2 -0
- package/esm/sdk/models/subscription-response.js.map +1 -1
- package/esm/sdk/models/sync-config.d.ts +21 -0
- package/esm/sdk/models/sync-config.d.ts.map +1 -0
- package/esm/sdk/models/sync-config.js +31 -0
- package/esm/sdk/models/sync-config.js.map +1 -0
- package/esm/sdk/models/trial-end-action.d.ts +10 -0
- package/esm/sdk/models/trial-end-action.d.ts.map +1 -0
- package/esm/sdk/models/trial-end-action.js +11 -0
- package/esm/sdk/models/trial-end-action.js.map +1 -0
- package/esm/sdk/models/update-user-request.d.ts +16 -0
- package/esm/sdk/models/update-user-request.d.ts.map +1 -0
- package/esm/sdk/models/update-user-request.js +12 -0
- package/esm/sdk/models/update-user-request.js.map +1 -0
- package/esm/sdk/models/update-user-response.d.ts +22 -0
- package/esm/sdk/models/update-user-response.d.ts.map +1 -0
- package/esm/sdk/models/update-user-response.js +21 -0
- package/esm/sdk/models/update-user-response.js.map +1 -0
- package/esm/sdk/models/user-response.d.ts +3 -0
- package/esm/sdk/models/user-response.d.ts.map +1 -1
- package/esm/sdk/models/user-response.js +1 -0
- package/esm/sdk/models/user-response.js.map +1 -1
- package/esm/sdk/users.d.ts +7 -0
- package/esm/sdk/users.d.ts.map +1 -1
- package/esm/sdk/users.js +10 -0
- package/esm/sdk/users.js.map +1 -1
- package/esm/types/async.d.ts.map +1 -1
- package/esm/types/async.js +6 -6
- package/esm/types/async.js.map +1 -1
- package/esm/types/primitives.d.ts +0 -2
- package/esm/types/primitives.d.ts.map +1 -1
- package/esm/types/primitives.js +0 -22
- package/esm/types/primitives.js.map +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/funcs/integrations-get-entity-integration-mappings.ts +186 -0
- package/src/funcs/integrations-get-integration-config.ts +152 -0
- package/src/funcs/users-update-user.ts +172 -0
- package/src/lib/config.ts +3 -3
- package/src/sdk/integrations.ts +36 -0
- package/src/sdk/models/changed-subscription.ts +18 -5
- package/src/sdk/models/create-invoice-line-item-request.ts +24 -0
- package/src/sdk/models/create-user-response.ts +2 -0
- package/src/sdk/models/entity-integration-mapping-response.ts +2 -0
- package/src/sdk/models/entity-sync-config.ts +39 -0
- package/src/sdk/models/execute-subscription-modify-request.ts +9 -0
- package/src/sdk/models/get-entity-integration-mappings-op.ts +50 -0
- package/src/sdk/models/index.ts +12 -0
- package/src/sdk/models/integration-config-entry.ts +49 -0
- package/src/sdk/models/integration-config-response.ts +35 -0
- package/src/sdk/models/invoice-billing-reason.ts +1 -0
- package/src/sdk/models/invoice-filter.ts +17 -0
- package/src/sdk/models/invoice-line-item-response.ts +15 -0
- package/src/sdk/models/invoice-sync-settings.ts +43 -0
- package/src/sdk/models/list-entity-integration-mappings-response.ts +44 -0
- package/src/sdk/models/payment-gateway-type.ts +1 -0
- package/src/sdk/models/price-price.ts +10 -0
- package/src/sdk/models/price-response.ts +10 -0
- package/src/sdk/models/s3-export-config.ts +70 -0
- package/src/sdk/models/secret-provider.ts +1 -0
- package/src/sdk/models/sub-modify-trial-end-request.ts +50 -0
- package/src/sdk/models/subscription-modify-type.ts +1 -0
- package/src/sdk/models/subscription-response-v2.ts +20 -0
- package/src/sdk/models/subscription-response.ts +10 -0
- package/src/sdk/models/sync-config.ts +65 -0
- package/src/sdk/models/trial-end-action.ts +17 -0
- package/src/sdk/models/update-user-request.ts +30 -0
- package/src/sdk/models/update-user-response.ts +49 -0
- package/src/sdk/models/user-response.ts +2 -0
- package/src/sdk/users.ts +18 -0
- package/src/types/async.ts +8 -7
- package/src/types/primitives.ts +0 -26
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import {
|
|
8
|
+
TrialEndAction,
|
|
9
|
+
TrialEndAction$outboundSchema,
|
|
10
|
+
} from "./trial-end-action.js";
|
|
11
|
+
|
|
12
|
+
export type SubModifyTrialEndRequest = {
|
|
13
|
+
action: TrialEndAction;
|
|
14
|
+
/**
|
|
15
|
+
* NewTrialEnd is the new trial end date. Required when action is "scheduled_date".
|
|
16
|
+
*/
|
|
17
|
+
newTrialEnd?: Date | undefined;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
/** @internal */
|
|
21
|
+
export type SubModifyTrialEndRequest$Outbound = {
|
|
22
|
+
action: string;
|
|
23
|
+
new_trial_end?: string | undefined;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
/** @internal */
|
|
27
|
+
export const SubModifyTrialEndRequest$outboundSchema: z.ZodMiniType<
|
|
28
|
+
SubModifyTrialEndRequest$Outbound,
|
|
29
|
+
SubModifyTrialEndRequest
|
|
30
|
+
> = z.pipe(
|
|
31
|
+
z.object({
|
|
32
|
+
action: TrialEndAction$outboundSchema,
|
|
33
|
+
newTrialEnd: z.optional(
|
|
34
|
+
z.pipe(z.date(), z.transform(v => v.toISOString())),
|
|
35
|
+
),
|
|
36
|
+
}),
|
|
37
|
+
z.transform((v) => {
|
|
38
|
+
return remap$(v, {
|
|
39
|
+
newTrialEnd: "new_trial_end",
|
|
40
|
+
});
|
|
41
|
+
}),
|
|
42
|
+
);
|
|
43
|
+
|
|
44
|
+
export function subModifyTrialEndRequestToJSON(
|
|
45
|
+
subModifyTrialEndRequest: SubModifyTrialEndRequest,
|
|
46
|
+
): string {
|
|
47
|
+
return JSON.stringify(
|
|
48
|
+
SubModifyTrialEndRequest$outboundSchema.parse(subModifyTrialEndRequest),
|
|
49
|
+
);
|
|
50
|
+
}
|
|
@@ -9,6 +9,7 @@ export const SubscriptionModifyType = {
|
|
|
9
9
|
Inheritance: "inheritance",
|
|
10
10
|
QuantityChange: "quantity_change",
|
|
11
11
|
GroupedInvoicing: "grouped_invoicing",
|
|
12
|
+
TrialEnd: "trial_end",
|
|
12
13
|
} as const;
|
|
13
14
|
export type SubscriptionModifyType = ClosedEnum<typeof SubscriptionModifyType>;
|
|
14
15
|
|
|
@@ -210,6 +210,14 @@ export type SubscriptionResponseV2 = {
|
|
|
210
210
|
* PlanID is the identifier for the plan in our system
|
|
211
211
|
*/
|
|
212
212
|
planId?: string | undefined;
|
|
213
|
+
/**
|
|
214
|
+
* PlanPricesOutOfSync is true when the subscription's synced_price_sequence
|
|
215
|
+
*
|
|
216
|
+
* @remarks
|
|
217
|
+
* is behind the plan's current max prices.sequence — i.e. plan-price
|
|
218
|
+
* changes have not yet been reconciled into this subscription's line items.
|
|
219
|
+
*/
|
|
220
|
+
planPricesOutOfSync?: boolean | undefined;
|
|
213
221
|
prorationBehavior?: ProrationBehavior | undefined;
|
|
214
222
|
/**
|
|
215
223
|
* StartDate is the start date of the subscription
|
|
@@ -218,6 +226,14 @@ export type SubscriptionResponseV2 = {
|
|
|
218
226
|
status?: Status | undefined;
|
|
219
227
|
subscriptionStatus?: SubscriptionStatus | undefined;
|
|
220
228
|
subscriptionType?: SubscriptionType | undefined;
|
|
229
|
+
/**
|
|
230
|
+
* SyncedPriceSequence is the plan-price sequence up to which this
|
|
231
|
+
*
|
|
232
|
+
* @remarks
|
|
233
|
+
* subscription's line items have been reconciled. Bumped by the
|
|
234
|
+
* plan-price sync after a successful pass.
|
|
235
|
+
*/
|
|
236
|
+
syncedPriceSequence?: number | undefined;
|
|
221
237
|
tenantId?: string | undefined;
|
|
222
238
|
/**
|
|
223
239
|
* TrialEnd is the end date of the trial period
|
|
@@ -288,11 +304,13 @@ export const SubscriptionResponseV2$inboundSchema: z.ZodMiniType<
|
|
|
288
304
|
phases: types.optional(z.array(SubscriptionPhaseResponse$inboundSchema)),
|
|
289
305
|
plan: types.optional(PlanResponse$inboundSchema),
|
|
290
306
|
plan_id: types.optional(types.string()),
|
|
307
|
+
plan_prices_out_of_sync: types.optional(types.boolean()),
|
|
291
308
|
proration_behavior: types.optional(ProrationBehavior$inboundSchema),
|
|
292
309
|
start_date: types.optional(types.date()),
|
|
293
310
|
status: types.optional(Status$inboundSchema),
|
|
294
311
|
subscription_status: types.optional(SubscriptionStatus$inboundSchema),
|
|
295
312
|
subscription_type: types.optional(SubscriptionType$inboundSchema),
|
|
313
|
+
synced_price_sequence: types.optional(types.number()),
|
|
296
314
|
tenant_id: types.optional(types.string()),
|
|
297
315
|
trial_end: types.optional(types.date()),
|
|
298
316
|
trial_start: types.optional(types.date()),
|
|
@@ -336,10 +354,12 @@ export const SubscriptionResponseV2$inboundSchema: z.ZodMiniType<
|
|
|
336
354
|
"payment_behavior": "paymentBehavior",
|
|
337
355
|
"payment_terms": "paymentTerms",
|
|
338
356
|
"plan_id": "planId",
|
|
357
|
+
"plan_prices_out_of_sync": "planPricesOutOfSync",
|
|
339
358
|
"proration_behavior": "prorationBehavior",
|
|
340
359
|
"start_date": "startDate",
|
|
341
360
|
"subscription_status": "subscriptionStatus",
|
|
342
361
|
"subscription_type": "subscriptionType",
|
|
362
|
+
"synced_price_sequence": "syncedPriceSequence",
|
|
343
363
|
"tenant_id": "tenantId",
|
|
344
364
|
"trial_end": "trialEnd",
|
|
345
365
|
"trial_start": "trialStart",
|
|
@@ -214,6 +214,14 @@ export type SubscriptionResponse = {
|
|
|
214
214
|
status?: Status | undefined;
|
|
215
215
|
subscriptionStatus?: SubscriptionStatus | undefined;
|
|
216
216
|
subscriptionType?: SubscriptionType | undefined;
|
|
217
|
+
/**
|
|
218
|
+
* SyncedPriceSequence is the plan-price sequence up to which this
|
|
219
|
+
*
|
|
220
|
+
* @remarks
|
|
221
|
+
* subscription's line items have been reconciled. Bumped by the
|
|
222
|
+
* plan-price sync after a successful pass.
|
|
223
|
+
*/
|
|
224
|
+
syncedPriceSequence?: number | undefined;
|
|
217
225
|
tenantId?: string | undefined;
|
|
218
226
|
/**
|
|
219
227
|
* TrialEnd is the end date of the trial period
|
|
@@ -290,6 +298,7 @@ export const SubscriptionResponse$inboundSchema: z.ZodMiniType<
|
|
|
290
298
|
status: types.optional(Status$inboundSchema),
|
|
291
299
|
subscription_status: types.optional(SubscriptionStatus$inboundSchema),
|
|
292
300
|
subscription_type: types.optional(SubscriptionType$inboundSchema),
|
|
301
|
+
synced_price_sequence: types.optional(types.number()),
|
|
293
302
|
tenant_id: types.optional(types.string()),
|
|
294
303
|
trial_end: types.optional(types.date()),
|
|
295
304
|
trial_start: types.optional(types.date()),
|
|
@@ -338,6 +347,7 @@ export const SubscriptionResponse$inboundSchema: z.ZodMiniType<
|
|
|
338
347
|
"start_date": "startDate",
|
|
339
348
|
"subscription_status": "subscriptionStatus",
|
|
340
349
|
"subscription_type": "subscriptionType",
|
|
350
|
+
"synced_price_sequence": "syncedPriceSequence",
|
|
341
351
|
"tenant_id": "tenantId",
|
|
342
352
|
"trial_end": "trialEnd",
|
|
343
353
|
"trial_start": "trialStart",
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
|
+
import * as types from "../../types/primitives.js";
|
|
10
|
+
import {
|
|
11
|
+
EntitySyncConfig,
|
|
12
|
+
EntitySyncConfig$inboundSchema,
|
|
13
|
+
} from "./entity-sync-config.js";
|
|
14
|
+
import {
|
|
15
|
+
InvoiceSyncSettings,
|
|
16
|
+
InvoiceSyncSettings$inboundSchema,
|
|
17
|
+
} from "./invoice-sync-settings.js";
|
|
18
|
+
import {
|
|
19
|
+
S3ExportConfig,
|
|
20
|
+
S3ExportConfig$inboundSchema,
|
|
21
|
+
} from "./s3-export-config.js";
|
|
22
|
+
import { SDKValidationError } from "./sdk-validation-error.js";
|
|
23
|
+
|
|
24
|
+
export type SyncConfig = {
|
|
25
|
+
customer?: EntitySyncConfig | undefined;
|
|
26
|
+
deal?: EntitySyncConfig | undefined;
|
|
27
|
+
invoice?: EntitySyncConfig | undefined;
|
|
28
|
+
invoiceSyncSettings?: InvoiceSyncSettings | undefined;
|
|
29
|
+
payment?: EntitySyncConfig | undefined;
|
|
30
|
+
plan?: EntitySyncConfig | undefined;
|
|
31
|
+
quote?: EntitySyncConfig | undefined;
|
|
32
|
+
s3?: S3ExportConfig | undefined;
|
|
33
|
+
subscription?: EntitySyncConfig | undefined;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
/** @internal */
|
|
37
|
+
export const SyncConfig$inboundSchema: z.ZodMiniType<SyncConfig, unknown> = z
|
|
38
|
+
.pipe(
|
|
39
|
+
z.object({
|
|
40
|
+
customer: types.optional(EntitySyncConfig$inboundSchema),
|
|
41
|
+
deal: types.optional(EntitySyncConfig$inboundSchema),
|
|
42
|
+
invoice: types.optional(EntitySyncConfig$inboundSchema),
|
|
43
|
+
invoice_sync_settings: types.optional(InvoiceSyncSettings$inboundSchema),
|
|
44
|
+
payment: types.optional(EntitySyncConfig$inboundSchema),
|
|
45
|
+
plan: types.optional(EntitySyncConfig$inboundSchema),
|
|
46
|
+
quote: types.optional(EntitySyncConfig$inboundSchema),
|
|
47
|
+
s3: types.optional(S3ExportConfig$inboundSchema),
|
|
48
|
+
subscription: types.optional(EntitySyncConfig$inboundSchema),
|
|
49
|
+
}),
|
|
50
|
+
z.transform((v) => {
|
|
51
|
+
return remap$(v, {
|
|
52
|
+
"invoice_sync_settings": "invoiceSyncSettings",
|
|
53
|
+
});
|
|
54
|
+
}),
|
|
55
|
+
);
|
|
56
|
+
|
|
57
|
+
export function syncConfigFromJSON(
|
|
58
|
+
jsonString: string,
|
|
59
|
+
): SafeParseResult<SyncConfig, SDKValidationError> {
|
|
60
|
+
return safeParse(
|
|
61
|
+
jsonString,
|
|
62
|
+
(x) => SyncConfig$inboundSchema.parse(JSON.parse(x)),
|
|
63
|
+
`Failed to parse 'SyncConfig' from JSON`,
|
|
64
|
+
);
|
|
65
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
import { ClosedEnum } from "../../types/enums.js";
|
|
7
|
+
|
|
8
|
+
export const TrialEndAction = {
|
|
9
|
+
Immediate: "immediate",
|
|
10
|
+
ScheduledDate: "scheduled_date",
|
|
11
|
+
} as const;
|
|
12
|
+
export type TrialEndAction = ClosedEnum<typeof TrialEndAction>;
|
|
13
|
+
|
|
14
|
+
/** @internal */
|
|
15
|
+
export const TrialEndAction$outboundSchema: z.ZodMiniEnum<
|
|
16
|
+
typeof TrialEndAction
|
|
17
|
+
> = z.enum(TrialEndAction);
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
|
|
7
|
+
export type UpdateUserRequest = {
|
|
8
|
+
metadata?: { [k: string]: string } | undefined;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
/** @internal */
|
|
12
|
+
export type UpdateUserRequest$Outbound = {
|
|
13
|
+
metadata?: { [k: string]: string } | undefined;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
/** @internal */
|
|
17
|
+
export const UpdateUserRequest$outboundSchema: z.ZodMiniType<
|
|
18
|
+
UpdateUserRequest$Outbound,
|
|
19
|
+
UpdateUserRequest
|
|
20
|
+
> = z.object({
|
|
21
|
+
metadata: z.optional(z.record(z.string(), z.string())),
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
export function updateUserRequestToJSON(
|
|
25
|
+
updateUserRequest: UpdateUserRequest,
|
|
26
|
+
): string {
|
|
27
|
+
return JSON.stringify(
|
|
28
|
+
UpdateUserRequest$outboundSchema.parse(updateUserRequest),
|
|
29
|
+
);
|
|
30
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
7
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
8
|
+
import * as types from "../../types/primitives.js";
|
|
9
|
+
import { SDKValidationError } from "./sdk-validation-error.js";
|
|
10
|
+
import {
|
|
11
|
+
TenantResponse,
|
|
12
|
+
TenantResponse$inboundSchema,
|
|
13
|
+
} from "./tenant-response.js";
|
|
14
|
+
import { UserType, UserType$inboundSchema } from "./user-type.js";
|
|
15
|
+
|
|
16
|
+
export type UpdateUserResponse = {
|
|
17
|
+
/**
|
|
18
|
+
* Empty for service accounts
|
|
19
|
+
*/
|
|
20
|
+
email?: string | undefined;
|
|
21
|
+
id?: string | undefined;
|
|
22
|
+
metadata?: { [k: string]: string } | undefined;
|
|
23
|
+
roles?: Array<string> | undefined;
|
|
24
|
+
tenant?: TenantResponse | undefined;
|
|
25
|
+
type?: UserType | undefined;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
/** @internal */
|
|
29
|
+
export const UpdateUserResponse$inboundSchema: z.ZodMiniType<
|
|
30
|
+
UpdateUserResponse,
|
|
31
|
+
unknown
|
|
32
|
+
> = z.object({
|
|
33
|
+
email: types.optional(types.string()),
|
|
34
|
+
id: types.optional(types.string()),
|
|
35
|
+
metadata: types.optional(z.record(z.string(), types.string())),
|
|
36
|
+
roles: types.optional(z.array(types.string())),
|
|
37
|
+
tenant: types.optional(TenantResponse$inboundSchema),
|
|
38
|
+
type: types.optional(UserType$inboundSchema),
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
export function updateUserResponseFromJSON(
|
|
42
|
+
jsonString: string,
|
|
43
|
+
): SafeParseResult<UpdateUserResponse, SDKValidationError> {
|
|
44
|
+
return safeParse(
|
|
45
|
+
jsonString,
|
|
46
|
+
(x) => UpdateUserResponse$inboundSchema.parse(JSON.parse(x)),
|
|
47
|
+
`Failed to parse 'UpdateUserResponse' from JSON`,
|
|
48
|
+
);
|
|
49
|
+
}
|
|
@@ -19,6 +19,7 @@ export type UserResponse = {
|
|
|
19
19
|
*/
|
|
20
20
|
email?: string | undefined;
|
|
21
21
|
id?: string | undefined;
|
|
22
|
+
metadata?: { [k: string]: string } | undefined;
|
|
22
23
|
roles?: Array<string> | undefined;
|
|
23
24
|
tenant?: TenantResponse | undefined;
|
|
24
25
|
type?: UserType | undefined;
|
|
@@ -29,6 +30,7 @@ export const UserResponse$inboundSchema: z.ZodMiniType<UserResponse, unknown> =
|
|
|
29
30
|
z.object({
|
|
30
31
|
email: types.optional(types.string()),
|
|
31
32
|
id: types.optional(types.string()),
|
|
33
|
+
metadata: types.optional(z.record(z.string(), types.string())),
|
|
32
34
|
roles: types.optional(z.array(types.string())),
|
|
33
35
|
tenant: types.optional(TenantResponse$inboundSchema),
|
|
34
36
|
type: types.optional(UserType$inboundSchema),
|
package/src/sdk/users.ts
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
import { usersCreateUser } from "../funcs/users-create-user.js";
|
|
6
6
|
import { usersGetUserInfo } from "../funcs/users-get-user-info.js";
|
|
7
7
|
import { usersQueryUser } from "../funcs/users-query-user.js";
|
|
8
|
+
import { usersUpdateUser } from "../funcs/users-update-user.js";
|
|
8
9
|
import { ClientSDK, RequestOptions } from "../lib/sdks.js";
|
|
9
10
|
import { unwrapAsync } from "../types/fp.js";
|
|
10
11
|
import * as models from "./models/index.js";
|
|
@@ -42,6 +43,23 @@ export class Users extends ClientSDK {
|
|
|
42
43
|
));
|
|
43
44
|
}
|
|
44
45
|
|
|
46
|
+
/**
|
|
47
|
+
* Update current user
|
|
48
|
+
*
|
|
49
|
+
* @remarks
|
|
50
|
+
* Update the current authenticated user. Only metadata updates are supported.
|
|
51
|
+
*/
|
|
52
|
+
async updateUser(
|
|
53
|
+
request: models.UpdateUserRequest,
|
|
54
|
+
options?: RequestOptions,
|
|
55
|
+
): Promise<models.UpdateUserResponse> {
|
|
56
|
+
return unwrapAsync(usersUpdateUser(
|
|
57
|
+
this,
|
|
58
|
+
request,
|
|
59
|
+
options,
|
|
60
|
+
));
|
|
61
|
+
}
|
|
62
|
+
|
|
45
63
|
/**
|
|
46
64
|
* Query users
|
|
47
65
|
*
|
package/src/types/async.ts
CHANGED
|
@@ -21,16 +21,17 @@ export type APICall =
|
|
|
21
21
|
|
|
22
22
|
export class APIPromise<T> implements Promise<T> {
|
|
23
23
|
readonly #promise: Promise<[T, APICall]>;
|
|
24
|
-
|
|
24
|
+
#unwrapped: Promise<T> | null;
|
|
25
25
|
|
|
26
26
|
readonly [Symbol.toStringTag] = "APIPromise";
|
|
27
27
|
|
|
28
28
|
constructor(p: [T, APICall] | Promise<[T, APICall]>) {
|
|
29
29
|
this.#promise = p instanceof Promise ? p : Promise.resolve(p);
|
|
30
|
-
this.#unwrapped =
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
this.#unwrapped = p instanceof Promise ? null : Promise.resolve(p[0]);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
#getUnwrapped(): Promise<T> {
|
|
34
|
+
return (this.#unwrapped ??= this.#promise.then(([value]) => value));
|
|
34
35
|
}
|
|
35
36
|
|
|
36
37
|
then<TResult1 = T, TResult2 = never>(
|
|
@@ -55,11 +56,11 @@ export class APIPromise<T> implements Promise<T> {
|
|
|
55
56
|
| null
|
|
56
57
|
| undefined,
|
|
57
58
|
): Promise<T | TResult> {
|
|
58
|
-
return this.#
|
|
59
|
+
return this.#getUnwrapped().catch(onrejected);
|
|
59
60
|
}
|
|
60
61
|
|
|
61
62
|
finally(onfinally?: (() => void) | null | undefined): Promise<T> {
|
|
62
|
-
return this.#
|
|
63
|
+
return this.#getUnwrapped().finally(onfinally);
|
|
63
64
|
}
|
|
64
65
|
|
|
65
66
|
$inspect(): Promise<[T, APICall]> {
|
package/src/types/primitives.ts
CHANGED
|
@@ -70,28 +70,6 @@ export function number(): z.ZodMiniType<number> {
|
|
|
70
70
|
]);
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
-
export function bigint(): z.ZodMiniType<bigint> {
|
|
74
|
-
return z.union([
|
|
75
|
-
z.pipe(
|
|
76
|
-
z.string(),
|
|
77
|
-
z.transform((x, ctx) => {
|
|
78
|
-
try {
|
|
79
|
-
return BigInt(x);
|
|
80
|
-
} catch (error) {
|
|
81
|
-
ctx.issues.push({
|
|
82
|
-
input: x,
|
|
83
|
-
code: "invalid_type",
|
|
84
|
-
expected: "bigint",
|
|
85
|
-
received: "string",
|
|
86
|
-
});
|
|
87
|
-
return z.NEVER;
|
|
88
|
-
}
|
|
89
|
-
}),
|
|
90
|
-
),
|
|
91
|
-
zodDefaultToZeroValue(0n),
|
|
92
|
-
]);
|
|
93
|
-
}
|
|
94
|
-
|
|
95
73
|
export function date(): z.ZodMiniType<Date> {
|
|
96
74
|
return z.union([
|
|
97
75
|
z.pipe(
|
|
@@ -126,10 +104,6 @@ export function literal<T extends string | number | boolean>(
|
|
|
126
104
|
return z.union([z.literal(value), zodDefaultToZeroValue(value)]);
|
|
127
105
|
}
|
|
128
106
|
|
|
129
|
-
export function literalBigInt<T extends bigint>(value: T): z.ZodMiniType<T> {
|
|
130
|
-
return z.pipe(z.literal(String(value)), z.transform((x) => BigInt(x))) as any;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
107
|
export function optional<T extends z.ZodMiniType>(t: T) {
|
|
134
108
|
return z.optional(z.union([
|
|
135
109
|
// Null -> undefined
|