@schematichq/schematic-typescript-node 1.5.9 → 1.5.10

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.
Files changed (69) hide show
  1. package/dist/BaseClient.d.ts +12 -0
  2. package/dist/Client.d.ts +3 -0
  3. package/dist/api/errors/BadRequestError.d.ts +1 -0
  4. package/dist/api/errors/ForbiddenError.d.ts +1 -0
  5. package/dist/api/errors/InternalServerError.d.ts +1 -0
  6. package/dist/api/errors/NotFoundError.d.ts +1 -0
  7. package/dist/api/errors/UnauthorizedError.d.ts +1 -0
  8. package/dist/api/resources/accesstokens/client/Client.d.ts +2 -0
  9. package/dist/api/resources/accounts/client/Client.d.ts +42 -0
  10. package/dist/api/resources/billing/client/Client.d.ts +48 -0
  11. package/dist/api/resources/catalogs/client/Client.d.ts +28 -0
  12. package/dist/api/resources/checkout/client/Client.d.ts +18 -0
  13. package/dist/api/resources/companies/client/Client.d.ts +86 -0
  14. package/dist/api/resources/components/client/Client.d.ts +16 -0
  15. package/dist/api/resources/componentspublic/client/Client.d.ts +2 -0
  16. package/dist/api/resources/credits/client/Client.d.ts +60 -0
  17. package/dist/api/resources/dataexports/client/Client.d.ts +8 -0
  18. package/dist/api/resources/entitlements/client/Client.d.ts +50 -0
  19. package/dist/api/resources/events/client/Client.d.ts +12 -0
  20. package/dist/api/resources/features/client/Client.d.ts +34 -0
  21. package/dist/api/resources/insights/client/Client.d.ts +12 -0
  22. package/dist/api/resources/integrationsapi/client/Client.d.ts +18 -0
  23. package/dist/api/resources/licenses/client/Client.d.ts +6 -0
  24. package/dist/api/resources/planbundle/client/Client.d.ts +6 -2
  25. package/dist/api/resources/planbundle/client/requests/CreateCustomPlanBundleRequestBody.d.ts +0 -1
  26. package/dist/api/resources/planbundle/client/requests/CreatePlanBundleRequestBody.d.ts +0 -1
  27. package/dist/api/resources/plangroups/client/Client.d.ts +6 -0
  28. package/dist/api/resources/planmigrations/client/Client.d.ts +18 -0
  29. package/dist/api/resources/plans/client/Client.d.ts +36 -3
  30. package/dist/api/resources/plans/client/requests/CreateBillingLinkedPlanRequestBody.d.ts +1 -2
  31. package/dist/api/resources/plans/client/requests/CreateCustomPlanRequestBody.d.ts +1 -2
  32. package/dist/api/resources/scheduledcheckout/client/Client.d.ts +8 -0
  33. package/dist/api/resources/webhooks/client/Client.d.ts +20 -0
  34. package/dist/api/types/AuditLogResponseData.d.ts +1 -0
  35. package/dist/api/types/BillingPlanCreditGrantResponseData.d.ts +1 -1
  36. package/dist/api/types/ComponentHydrateResponseData.d.ts +1 -1
  37. package/dist/api/types/ComponentPreviewResponseData.d.ts +1 -1
  38. package/dist/api/types/CreateBillingPlanCreditGrantRequestBody.d.ts +1 -0
  39. package/dist/api/types/CreateCustomPlanBundlePlanRequestBody.d.ts +1 -1
  40. package/dist/api/types/CreatePlanRequestBody.d.ts +1 -1
  41. package/dist/api/types/OnboardingRequirementView.d.ts +1 -0
  42. package/dist/api/types/PlanChangeResponseData.d.ts +6 -0
  43. package/dist/api/types/PreviewSubscriptionFinanceResponseData.d.ts +1 -0
  44. package/dist/api/types/StripeIntegrationConfig.d.ts +2 -0
  45. package/dist/api/types/UpcomingInvoiceResponseData.d.ts +23 -0
  46. package/dist/api/types/UpdateBillingPlanCreditGrantRequestBody.d.ts +1 -0
  47. package/dist/api/types/index.d.ts +1 -0
  48. package/dist/core/fetcher/redactUrl.d.ts +2 -0
  49. package/dist/core/requestBody.d.ts +12 -0
  50. package/dist/core/runtime/index.d.ts +1 -1
  51. package/dist/core/runtime/runtime.d.ts +19 -0
  52. package/dist/errors/SchematicError.d.ts +1 -0
  53. package/dist/errors/SchematicTimeoutError.d.ts +2 -2
  54. package/dist/events.d.ts +6 -0
  55. package/dist/index.js +9 -9
  56. package/dist/serialization/resources/plans/client/requests/CreateBillingLinkedPlanRequestBody.d.ts +1 -1
  57. package/dist/serialization/resources/plans/client/requests/CreateCustomPlanRequestBody.d.ts +1 -1
  58. package/dist/serialization/types/AuditLogResponseData.d.ts +1 -0
  59. package/dist/serialization/types/ComponentHydrateResponseData.d.ts +2 -2
  60. package/dist/serialization/types/ComponentPreviewResponseData.d.ts +2 -1
  61. package/dist/serialization/types/CreateCustomPlanBundlePlanRequestBody.d.ts +1 -1
  62. package/dist/serialization/types/CreatePlanRequestBody.d.ts +1 -1
  63. package/dist/serialization/types/OnboardingRequirementView.d.ts +1 -0
  64. package/dist/serialization/types/PlanChangeResponseData.d.ts +4 -0
  65. package/dist/serialization/types/PreviewSubscriptionFinanceResponseData.d.ts +1 -0
  66. package/dist/serialization/types/StripeIntegrationConfig.d.ts +1 -0
  67. package/dist/serialization/types/UpcomingInvoiceResponseData.d.ts +30 -0
  68. package/dist/serialization/types/index.d.ts +1 -0
  69. package/package.json +1 -1
@@ -19,6 +19,8 @@ export declare class ScheduledcheckoutClient {
19
19
  * @throws {@link Schematic.ForbiddenError}
20
20
  * @throws {@link Schematic.NotFoundError}
21
21
  * @throws {@link Schematic.InternalServerError}
22
+ * @throws {@link errors.SchematicError}
23
+ * @throws {@link errors.SchematicTimeoutError}
22
24
  *
23
25
  * @example
24
26
  * await client.scheduledcheckout.listScheduledCheckouts({
@@ -39,6 +41,8 @@ export declare class ScheduledcheckoutClient {
39
41
  * @throws {@link Schematic.ForbiddenError}
40
42
  * @throws {@link Schematic.NotFoundError}
41
43
  * @throws {@link Schematic.InternalServerError}
44
+ * @throws {@link errors.SchematicError}
45
+ * @throws {@link errors.SchematicTimeoutError}
42
46
  *
43
47
  * @example
44
48
  * await client.scheduledcheckout.createScheduledCheckout({
@@ -58,6 +62,8 @@ export declare class ScheduledcheckoutClient {
58
62
  * @throws {@link Schematic.ForbiddenError}
59
63
  * @throws {@link Schematic.NotFoundError}
60
64
  * @throws {@link Schematic.InternalServerError}
65
+ * @throws {@link errors.SchematicError}
66
+ * @throws {@link errors.SchematicTimeoutError}
61
67
  *
62
68
  * @example
63
69
  * await client.scheduledcheckout.getScheduledCheckout("scheduled_checkout_id")
@@ -74,6 +80,8 @@ export declare class ScheduledcheckoutClient {
74
80
  * @throws {@link Schematic.ForbiddenError}
75
81
  * @throws {@link Schematic.NotFoundError}
76
82
  * @throws {@link Schematic.InternalServerError}
83
+ * @throws {@link errors.SchematicError}
84
+ * @throws {@link errors.SchematicTimeoutError}
77
85
  *
78
86
  * @example
79
87
  * await client.scheduledcheckout.updateScheduledCheckout("scheduled_checkout_id")
@@ -19,6 +19,8 @@ export declare class WebhooksClient {
19
19
  * @throws {@link Schematic.ForbiddenError}
20
20
  * @throws {@link Schematic.NotFoundError}
21
21
  * @throws {@link Schematic.InternalServerError}
22
+ * @throws {@link errors.SchematicError}
23
+ * @throws {@link errors.SchematicTimeoutError}
22
24
  *
23
25
  * @example
24
26
  * await client.webhooks.listWebhookEvents({
@@ -39,6 +41,8 @@ export declare class WebhooksClient {
39
41
  * @throws {@link Schematic.ForbiddenError}
40
42
  * @throws {@link Schematic.NotFoundError}
41
43
  * @throws {@link Schematic.InternalServerError}
44
+ * @throws {@link errors.SchematicError}
45
+ * @throws {@link errors.SchematicTimeoutError}
42
46
  *
43
47
  * @example
44
48
  * await client.webhooks.getWebhookEvent("webhook_event_id")
@@ -54,6 +58,8 @@ export declare class WebhooksClient {
54
58
  * @throws {@link Schematic.ForbiddenError}
55
59
  * @throws {@link Schematic.NotFoundError}
56
60
  * @throws {@link Schematic.InternalServerError}
61
+ * @throws {@link errors.SchematicError}
62
+ * @throws {@link errors.SchematicTimeoutError}
57
63
  *
58
64
  * @example
59
65
  * await client.webhooks.countWebhookEvents({
@@ -75,6 +81,8 @@ export declare class WebhooksClient {
75
81
  * @throws {@link Schematic.ForbiddenError}
76
82
  * @throws {@link Schematic.NotFoundError}
77
83
  * @throws {@link Schematic.InternalServerError}
84
+ * @throws {@link errors.SchematicError}
85
+ * @throws {@link errors.SchematicTimeoutError}
78
86
  *
79
87
  * @example
80
88
  * await client.webhooks.listWebhooks({
@@ -94,6 +102,8 @@ export declare class WebhooksClient {
94
102
  * @throws {@link Schematic.ForbiddenError}
95
103
  * @throws {@link Schematic.NotFoundError}
96
104
  * @throws {@link Schematic.InternalServerError}
105
+ * @throws {@link errors.SchematicError}
106
+ * @throws {@link errors.SchematicTimeoutError}
97
107
  *
98
108
  * @example
99
109
  * await client.webhooks.createWebhook({
@@ -112,6 +122,8 @@ export declare class WebhooksClient {
112
122
  * @throws {@link Schematic.ForbiddenError}
113
123
  * @throws {@link Schematic.NotFoundError}
114
124
  * @throws {@link Schematic.InternalServerError}
125
+ * @throws {@link errors.SchematicError}
126
+ * @throws {@link errors.SchematicTimeoutError}
115
127
  *
116
128
  * @example
117
129
  * await client.webhooks.getWebhook("webhook_id")
@@ -128,6 +140,8 @@ export declare class WebhooksClient {
128
140
  * @throws {@link Schematic.ForbiddenError}
129
141
  * @throws {@link Schematic.NotFoundError}
130
142
  * @throws {@link Schematic.InternalServerError}
143
+ * @throws {@link errors.SchematicError}
144
+ * @throws {@link errors.SchematicTimeoutError}
131
145
  *
132
146
  * @example
133
147
  * await client.webhooks.updateWebhook("webhook_id")
@@ -143,6 +157,8 @@ export declare class WebhooksClient {
143
157
  * @throws {@link Schematic.ForbiddenError}
144
158
  * @throws {@link Schematic.NotFoundError}
145
159
  * @throws {@link Schematic.InternalServerError}
160
+ * @throws {@link errors.SchematicError}
161
+ * @throws {@link errors.SchematicTimeoutError}
146
162
  *
147
163
  * @example
148
164
  * await client.webhooks.deleteWebhook("webhook_id")
@@ -159,6 +175,8 @@ export declare class WebhooksClient {
159
175
  * @throws {@link Schematic.ForbiddenError}
160
176
  * @throws {@link Schematic.NotFoundError}
161
177
  * @throws {@link Schematic.InternalServerError}
178
+ * @throws {@link errors.SchematicError}
179
+ * @throws {@link errors.SchematicTimeoutError}
162
180
  *
163
181
  * @example
164
182
  * await client.webhooks.sendTestWebhookAction("webhook_id", {
@@ -176,6 +194,8 @@ export declare class WebhooksClient {
176
194
  * @throws {@link Schematic.ForbiddenError}
177
195
  * @throws {@link Schematic.NotFoundError}
178
196
  * @throws {@link Schematic.InternalServerError}
197
+ * @throws {@link errors.SchematicError}
198
+ * @throws {@link errors.SchematicTimeoutError}
179
199
  *
180
200
  * @example
181
201
  * await client.webhooks.countWebhooks({
@@ -1,5 +1,6 @@
1
1
  import type * as Schematic from "../index";
2
2
  export interface AuditLogResponseData {
3
+ accountMemberId?: string;
3
4
  actorType: Schematic.ActorType;
4
5
  apiKey?: Schematic.ApiKeyResponseData;
5
6
  apiKeyId?: string;
@@ -12,7 +12,7 @@ export interface BillingPlanCreditGrantResponseData {
12
12
  autoTopupSelfService: boolean;
13
13
  autoTopupThresholdCredits?: number;
14
14
  autoTopupThresholdPercent?: number;
15
- /** Whether buyers can purchase one-time credit bundles on this grant, independent of auto top-up availability. */
15
+ /** Deprecated: bundle availability is a per-bundle plan compatibility set now; use compatible_plan_ids on credit bundles instead. */
16
16
  canBuyBundles: boolean;
17
17
  /** Credits granted once per company on top of the per-license amount. Always 0 when scaling is fixed. */
18
18
  companyCreditAmount: number;
@@ -26,5 +26,5 @@ export interface ComponentHydrateResponseData {
26
26
  stripeEmbed?: Schematic.StripeEmbedInfo;
27
27
  subscription?: Schematic.CompanySubscriptionResponseData;
28
28
  trialPaymentMethodRequired?: boolean;
29
- upcomingInvoice?: Schematic.InvoiceResponseData;
29
+ upcomingInvoice?: Schematic.UpcomingInvoiceResponseData;
30
30
  }
@@ -27,5 +27,5 @@ export interface ComponentPreviewResponseData {
27
27
  stripeEmbed?: Schematic.StripeEmbedInfo;
28
28
  subscription?: Schematic.CompanySubscriptionResponseData;
29
29
  trialPaymentMethodRequired?: boolean;
30
- upcomingInvoice?: Schematic.InvoiceResponseData;
30
+ upcomingInvoice?: Schematic.UpcomingInvoiceResponseData;
31
31
  }
@@ -11,6 +11,7 @@ export interface CreateBillingPlanCreditGrantRequestBody {
11
11
  autoTopupSelfService?: boolean;
12
12
  autoTopupThresholdCredits?: number;
13
13
  autoTopupThresholdPercent?: number;
14
+ /** Deprecated: use compatible_plan_ids on credit bundles instead. Still accepted; writes through to the credit's bundle compatibility. */
14
15
  canBuyBundles?: boolean;
15
16
  /** Credits granted once per company on top of the per-license amount. Only valid when scaling is per_license. Defaults to 0. */
16
17
  companyCreditAmount?: number;
@@ -1,7 +1,7 @@
1
1
  import type * as Schematic from "../index";
2
2
  export interface CreateCustomPlanBundlePlanRequestBody {
3
3
  companyId: string;
4
- description: string;
4
+ description?: string;
5
5
  icon?: Schematic.PlanIcon;
6
6
  name: string;
7
7
  }
@@ -1,6 +1,6 @@
1
1
  import type * as Schematic from "../index";
2
2
  export interface CreatePlanRequestBody {
3
- description: string;
3
+ description?: string;
4
4
  icon?: Schematic.PlanIcon;
5
5
  name: string;
6
6
  planType: Schematic.PlanType;
@@ -2,6 +2,7 @@ import type * as Schematic from "../index";
2
2
  export interface OnboardingRequirementView {
3
3
  blockedBy?: Schematic.OnboardingRequirement[];
4
4
  id: Schematic.OnboardingRequirement;
5
+ reachedAt?: Date;
5
6
  satisfiedBy?: string;
6
7
  status: Schematic.OnboardingRequirementStatus;
7
8
  }
@@ -28,6 +28,12 @@ export interface PlanChangeResponseData {
28
28
  subscriptionChangeAction?: Schematic.PlanChangeSubscriptionAction;
29
29
  /** Any traits were updated as part of this plan change (via pay-in-advance entitlements). */
30
30
  traitsUpdated: Schematic.SubscriptionTraitUpdate[];
31
+ /** When the company's trial had converted to a paid subscription as of this change. Null when the trial had not converted, or for changes recorded before trial status was tracked. */
32
+ trialConvertedAt?: Date;
33
+ /** When the company's trial was set to end as of this change. Null when the company had never trialed, or for changes recorded before trial status was tracked. */
34
+ trialExpiresAt?: Date;
35
+ /** The company's trial status. Null when the company had never trialed, or for changes recorded before trial status was tracked. */
36
+ trialStatus?: Schematic.TrialStatus;
31
37
  updatedAt: Date;
32
38
  userId?: string;
33
39
  userName?: string;
@@ -10,6 +10,7 @@ export interface PreviewSubscriptionFinanceResponseData {
10
10
  periodStart: Date;
11
11
  promoCodeApplied: boolean;
12
12
  proration: number;
13
+ prorationBilledAt?: Date;
13
14
  taxAmount?: number;
14
15
  taxDisplayName?: string;
15
16
  taxRequireBillingDetails: boolean;
@@ -11,4 +11,6 @@ export interface StripeIntegrationConfig {
11
11
  liveMode: boolean;
12
12
  /** Onboarding URL returned during the v2 (Connect) install flow before activation */
13
13
  onboardUrl?: string;
14
+ /** App location that started the connect flow; the OAuth callback redirects back there on success */
15
+ returnTo?: string;
14
16
  }
@@ -0,0 +1,23 @@
1
+ import type * as Schematic from "../index";
2
+ export interface UpcomingInvoiceResponseData {
3
+ amountDue: number;
4
+ amountPaid: number;
5
+ amountRemaining: number;
6
+ collectionMethod: string;
7
+ companyId?: string;
8
+ createdAt: Date;
9
+ currency: string;
10
+ customerExternalId: string;
11
+ dueDate?: Date;
12
+ endingBalance: number;
13
+ environmentId: string;
14
+ externalId?: string;
15
+ paymentMethodExternalId?: string;
16
+ providerType: Schematic.BillingProviderType;
17
+ startingBalance: number;
18
+ status?: Schematic.InvoiceStatus;
19
+ subscriptionExternalId?: string;
20
+ subtotal: number;
21
+ updatedAt: Date;
22
+ url?: string;
23
+ }
@@ -11,6 +11,7 @@ export interface UpdateBillingPlanCreditGrantRequestBody {
11
11
  autoTopupSelfService?: boolean;
12
12
  autoTopupThresholdCredits?: number;
13
13
  autoTopupThresholdPercent?: number;
14
+ /** Deprecated: use compatible_plan_ids on credit bundles instead. Still accepted; writes through to the credit's bundle compatibility. */
14
15
  canBuyBundles?: boolean;
15
16
  /** Credits granted once per company on top of the per-license amount. Only valid when the grant scales per license. */
16
17
  companyCreditAmount?: number;
@@ -407,6 +407,7 @@ export * from "./TraitDefinition";
407
407
  export * from "./TraitDefinitionComparableType";
408
408
  export * from "./TraitType";
409
409
  export * from "./TrialStatus";
410
+ export * from "./UpcomingInvoiceResponseData";
410
411
  export * from "./UpdateAddOnRequestBody";
411
412
  export * from "./UpdateAutoTopupOverrideRequestBody";
412
413
  export * from "./UpdateBillingPlanCreditGrantRequestBody";
@@ -0,0 +1,2 @@
1
+ export declare const SENSITIVE_QUERY_PARAMS: Set<string>;
2
+ export declare function redactUrl(url: string): string;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Spreads caller-supplied `additionalBodyParameters` (from `requestOptions.additionalBodyParameters`)
3
+ * on top of the request body. Caller-supplied properties win over the endpoint body. When no
4
+ * additional body parameters are provided, the original body is returned unchanged so serialization
5
+ * is unaffected.
6
+ *
7
+ * The merge only applies to plain-object (JSON object) bodies. When the body is `null`/`undefined`
8
+ * the additional parameters become the body; when the body is an array or a primitive JSON value it
9
+ * is returned unchanged, since object properties cannot be spread into it. This mirrors the Python
10
+ * SDK, which only merges additional body parameters into mapping bodies.
11
+ */
12
+ export declare function mergeAdditionalBodyParameters(body: unknown, additionalBodyParameters: Record<string, unknown> | undefined): unknown;
@@ -1 +1 @@
1
- export { RUNTIME } from "./runtime";
1
+ export { getUserAgent, RUNTIME } from "./runtime";
@@ -6,4 +6,23 @@ export interface Runtime {
6
6
  type: "browser" | "web-worker" | "deno" | "bun" | "node" | "react-native" | "unknown" | "workerd" | "edge-runtime";
7
7
  version?: string;
8
8
  parsedVersion?: number;
9
+ /**
10
+ * The operating system the SDK is running on, when it can be determined
11
+ * (e.g. "linux", "darwin", "win32" on server runtimes). Undefined in
12
+ * environments where the OS is not observable (e.g. browsers).
13
+ */
14
+ os?: string;
15
+ /**
16
+ * The CPU architecture the SDK is running on, when it can be determined
17
+ * (e.g. "x64", "arm64" on server runtimes). Undefined in environments where
18
+ * the architecture is not observable (e.g. browsers).
19
+ */
20
+ arch?: string;
9
21
  }
22
+ /**
23
+ * Builds a structured User-Agent string of the form
24
+ * `{sdkName}/{sdkVersion} ({os}; {arch}) {runtime}/{runtimeVersion}`
25
+ * where the platform group and runtime segment are omitted gracefully when the
26
+ * underlying values cannot be determined (e.g. in a browser).
27
+ */
28
+ export declare function getUserAgent(sdkName: string, sdkVersion: string): string;
@@ -11,4 +11,5 @@ export declare class SchematicError extends Error {
11
11
  rawResponse?: core.RawResponse;
12
12
  cause?: unknown;
13
13
  });
14
+ get requestId(): string | undefined;
14
15
  }
@@ -1,5 +1,5 @@
1
- export declare class SchematicTimeoutError extends Error {
2
- readonly cause?: unknown;
1
+ import * as errors from "./index";
2
+ export declare class SchematicTimeoutError extends errors.SchematicError {
3
3
  constructor(message: string, opts?: {
4
4
  cause?: unknown;
5
5
  });
package/dist/events.d.ts CHANGED
@@ -24,6 +24,12 @@ declare class EventBuffer {
24
24
  private flushing;
25
25
  constructor(captureClient: EventCaptureClient, opts?: EventBufferOptions);
26
26
  flush(): Promise<void>;
27
+ /**
28
+ * Sends a single request's worth of events, retrying with exponential
29
+ * backoff. Failures are logged and the chunk is dropped, matching the
30
+ * buffer's contract that tracking never throws to the caller.
31
+ */
32
+ private sendChunk;
27
33
  push(event: CreateEventRequestBody): Promise<void>;
28
34
  stop(): Promise<void>;
29
35
  private startPeriodicFlush;