diff --git a/CHANGELOG.md b/CHANGELOG.md index 312b1f0..92d9c95 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,18 @@ All notable changes to `sendly-sdk` are documented here. This project follows [Semantic Versioning](https://semver.org/). +## 0.4.0 + +### Removed + +- **`JsonValue` and `JsonObject`**, deprecated in 0.3.1, are gone. They existed + only as a workaround for generated types that were stricter than the API; + that was fixed at the spec level in 0.3.1, after which nothing in the package + referenced them. If you imported either one, replace it with your own type — + the request and response types that used to need them (`events.record()`'s + `data`, `workflows.startExecution()`'s `context`) already accept arbitrary + JSON straight from the generated schema. + ## 0.3.1 ### Fixed diff --git a/dist/index.cjs b/dist/index.cjs index fab769d..1a59a7d 100644 --- a/dist/index.cjs +++ b/dist/index.cjs @@ -1029,7 +1029,7 @@ function errorFromResponse(statusCode, errorCode, message, body, contentType) { } // src/client.ts -var SDK_VERSION = "0.3.1"; +var SDK_VERSION = "0.4.0"; var DEFAULT_BASE_URL = "https://api.sendly.now"; var Sendly = class { emails; diff --git a/dist/index.d.cts b/dist/index.d.cts index 576a6bb..7102a97 100644 --- a/dist/index.d.cts +++ b/dist/index.d.cts @@ -7907,24 +7907,6 @@ interface operations { /** Make `K` optional on `T`, leaving every other member as generated. */ type PartialKeys = Omit & Partial>; -/** - * Any JSON value. - * - * @deprecated No longer needed — the generated spec types accept arbitrary - * JSON since 0.3.1; will be removed in the next minor. - */ -type JsonValue = string | number | boolean | null | JsonValue[] | { - [key: string]: JsonValue; -}; -/** - * A free-form JSON object. - * - * @deprecated No longer needed — the generated spec types accept arbitrary - * JSON since 0.3.1; will be removed in the next minor. - */ -type JsonObject = { - [key: string]: JsonValue; -}; type ErrorEnvelope = components["schemas"]["Error"]; type SuccessEmpty = components["schemas"]["SuccessEmpty"]; /** `{ success, data: { id } }` envelope returned by delete endpoints (formerly the page-based `Pagination` schema, now removed in favor of cursor pagination). */ @@ -8451,7 +8433,7 @@ declare class WorkflowsResource { } /** Build-time package version (kept in sync with package.json). */ -declare const SDK_VERSION = "0.3.1"; +declare const SDK_VERSION = "0.4.0"; /** Default production API base. Override via `baseUrl` for staging or self-hosted deployments. */ declare const DEFAULT_BASE_URL = "https://api.sendly.now"; interface SendlyClientOptions { @@ -8742,4 +8724,4 @@ declare function verifySignature(payload: string | Buffer, signature: string, ti */ declare function constructEvent>(payload: string | Buffer, signature: string, timestamp: string, secret: string, options?: VerifySignatureOptions): T; -export { type AddDomainRequest, type AddSuppressionRequest, type AnalyticsCampaignStatsV1, type AnalyticsCampaignsV1Query, AnalyticsResource, type AnalyticsTimeseriesV1, type AnalyticsTimeseriesV1Query, type AnalyticsTopCampaignsV1, type AnalyticsWindowV1, type BatchEntryResult, type BatchSendRequest, type BatchSendResponse, type BulkCreateContactsRequest, type BulkDeleteContactsRequest, type CampaignDeletedV1, type CampaignListV1, type CampaignStatsV1, type CampaignV1, CampaignsResource, type ContactListResponse, type ContactRecord, ContactsResource, type CreateCampaignV1Request, type CreateContactRequest, type CreateSegmentV1Request, type CreateTemplateRequest, type CreateWebhookRequest, type CreateWorkflowV1Request, type CursorPage, type CursorPageQuery, DEFAULT_BASE_URL, DEFAULT_TOLERANCE_MS, type DomainListResponse, type DomainRecord, type DomainVerificationStatus, DomainsResource, type EmailGetResponse, type EmailListResponse, type EmailRecord, EmailsResource, type ErrorEnvelope, type EventListV1, type EventNamesV1, type EventStatsV1, type EventStatsV1Query, type EventV1, EventsResource, type IdResponse, type IdempotencyOptions, type JsonObject, type JsonValue, type ListCampaignsV1Query, type ListContactsQuery, type ListEmailsQuery, type ListEventsV1Query, type ListSegmentContactsV1Query, type ListSegmentsV1Query, type ListSubscribeData, type ListSubscribeRequest, type ListSubscribeResponse, type ListSuppressionsQuery, type ListTemplatesQuery, type ListTopCampaignsV1Query, type ListUnsubscribeData, type ListUnsubscribeRequest, type ListUnsubscribeResponse, type ListWebhookCallsQuery, type ListWorkflowExecutionsV1Query, type ListWorkflowsV1Query, ListsResource, type Problem, type ProblemDocument, type ProblemFieldError, type RecordEventV1Request, type RequestOptions, SDK_VERSION, type SegmentContactListV1, type SegmentContactV1, type SegmentDeletedV1, type SegmentListV1, type SegmentV1, SegmentsResource, type SendCampaignV1Request, type SendEmailData, type SendEmailRequest, type SendEmailResponse, Sendly, SendlyAuthenticationError, type SendlyClientOptions, SendlyConflictError, SendlyConnectionError, SendlyError, SendlyNotFoundError, SendlyPermissionError, SendlyRateLimitError, SendlyServerError, SendlyValidationError, type StartWorkflowExecutionV1Request, type SuccessEmpty, type SuppressionCheckResponse, type SuppressionListResponse, type SuppressionRecord, SuppressionResource, type TemplateListResponse, type TemplateRecord, TemplatesResource, type TrackEventData, type TrackEventRequest, type TrackEventResponse, type UpdateCampaignV1Request, type UpdateContactRequest, type UpdateSegmentV1Request, type UpdateTemplateRequest, type UpdateWebhookRequest, type UpdateWorkflowV1Request, UsageResource, type UsageV1, type VerifyEmailData, type VerifyEmailRequest, type VerifyEmailResponse, VerifyResource, type VerifySignatureOptions, type WebhookCall, type WebhookCallsListResponse, type WebhookCreateResponse, type WebhookGetResponse, type WebhookListResponse, type WebhookRecord, type WebhookRotateSecretResponse, WebhooksResource, type WorkflowDeletedV1, type WorkflowExecutionListV1, type WorkflowExecutionV1, type WorkflowListV1, type WorkflowStatsV1, type WorkflowStatsV1Query, type WorkflowV1, WorkflowsResource, asProblemDocument, type components, constructEvent, type operations, paginateCursor, type paths, verifySignature }; +export { type AddDomainRequest, type AddSuppressionRequest, type AnalyticsCampaignStatsV1, type AnalyticsCampaignsV1Query, AnalyticsResource, type AnalyticsTimeseriesV1, type AnalyticsTimeseriesV1Query, type AnalyticsTopCampaignsV1, type AnalyticsWindowV1, type BatchEntryResult, type BatchSendRequest, type BatchSendResponse, type BulkCreateContactsRequest, type BulkDeleteContactsRequest, type CampaignDeletedV1, type CampaignListV1, type CampaignStatsV1, type CampaignV1, CampaignsResource, type ContactListResponse, type ContactRecord, ContactsResource, type CreateCampaignV1Request, type CreateContactRequest, type CreateSegmentV1Request, type CreateTemplateRequest, type CreateWebhookRequest, type CreateWorkflowV1Request, type CursorPage, type CursorPageQuery, DEFAULT_BASE_URL, DEFAULT_TOLERANCE_MS, type DomainListResponse, type DomainRecord, type DomainVerificationStatus, DomainsResource, type EmailGetResponse, type EmailListResponse, type EmailRecord, EmailsResource, type ErrorEnvelope, type EventListV1, type EventNamesV1, type EventStatsV1, type EventStatsV1Query, type EventV1, EventsResource, type IdResponse, type IdempotencyOptions, type ListCampaignsV1Query, type ListContactsQuery, type ListEmailsQuery, type ListEventsV1Query, type ListSegmentContactsV1Query, type ListSegmentsV1Query, type ListSubscribeData, type ListSubscribeRequest, type ListSubscribeResponse, type ListSuppressionsQuery, type ListTemplatesQuery, type ListTopCampaignsV1Query, type ListUnsubscribeData, type ListUnsubscribeRequest, type ListUnsubscribeResponse, type ListWebhookCallsQuery, type ListWorkflowExecutionsV1Query, type ListWorkflowsV1Query, ListsResource, type Problem, type ProblemDocument, type ProblemFieldError, type RecordEventV1Request, type RequestOptions, SDK_VERSION, type SegmentContactListV1, type SegmentContactV1, type SegmentDeletedV1, type SegmentListV1, type SegmentV1, SegmentsResource, type SendCampaignV1Request, type SendEmailData, type SendEmailRequest, type SendEmailResponse, Sendly, SendlyAuthenticationError, type SendlyClientOptions, SendlyConflictError, SendlyConnectionError, SendlyError, SendlyNotFoundError, SendlyPermissionError, SendlyRateLimitError, SendlyServerError, SendlyValidationError, type StartWorkflowExecutionV1Request, type SuccessEmpty, type SuppressionCheckResponse, type SuppressionListResponse, type SuppressionRecord, SuppressionResource, type TemplateListResponse, type TemplateRecord, TemplatesResource, type TrackEventData, type TrackEventRequest, type TrackEventResponse, type UpdateCampaignV1Request, type UpdateContactRequest, type UpdateSegmentV1Request, type UpdateTemplateRequest, type UpdateWebhookRequest, type UpdateWorkflowV1Request, UsageResource, type UsageV1, type VerifyEmailData, type VerifyEmailRequest, type VerifyEmailResponse, VerifyResource, type VerifySignatureOptions, type WebhookCall, type WebhookCallsListResponse, type WebhookCreateResponse, type WebhookGetResponse, type WebhookListResponse, type WebhookRecord, type WebhookRotateSecretResponse, WebhooksResource, type WorkflowDeletedV1, type WorkflowExecutionListV1, type WorkflowExecutionV1, type WorkflowListV1, type WorkflowStatsV1, type WorkflowStatsV1Query, type WorkflowV1, WorkflowsResource, asProblemDocument, type components, constructEvent, type operations, paginateCursor, type paths, verifySignature }; diff --git a/dist/index.d.ts b/dist/index.d.ts index 576a6bb..7102a97 100644 --- a/dist/index.d.ts +++ b/dist/index.d.ts @@ -7907,24 +7907,6 @@ interface operations { /** Make `K` optional on `T`, leaving every other member as generated. */ type PartialKeys = Omit & Partial>; -/** - * Any JSON value. - * - * @deprecated No longer needed — the generated spec types accept arbitrary - * JSON since 0.3.1; will be removed in the next minor. - */ -type JsonValue = string | number | boolean | null | JsonValue[] | { - [key: string]: JsonValue; -}; -/** - * A free-form JSON object. - * - * @deprecated No longer needed — the generated spec types accept arbitrary - * JSON since 0.3.1; will be removed in the next minor. - */ -type JsonObject = { - [key: string]: JsonValue; -}; type ErrorEnvelope = components["schemas"]["Error"]; type SuccessEmpty = components["schemas"]["SuccessEmpty"]; /** `{ success, data: { id } }` envelope returned by delete endpoints (formerly the page-based `Pagination` schema, now removed in favor of cursor pagination). */ @@ -8451,7 +8433,7 @@ declare class WorkflowsResource { } /** Build-time package version (kept in sync with package.json). */ -declare const SDK_VERSION = "0.3.1"; +declare const SDK_VERSION = "0.4.0"; /** Default production API base. Override via `baseUrl` for staging or self-hosted deployments. */ declare const DEFAULT_BASE_URL = "https://api.sendly.now"; interface SendlyClientOptions { @@ -8742,4 +8724,4 @@ declare function verifySignature(payload: string | Buffer, signature: string, ti */ declare function constructEvent>(payload: string | Buffer, signature: string, timestamp: string, secret: string, options?: VerifySignatureOptions): T; -export { type AddDomainRequest, type AddSuppressionRequest, type AnalyticsCampaignStatsV1, type AnalyticsCampaignsV1Query, AnalyticsResource, type AnalyticsTimeseriesV1, type AnalyticsTimeseriesV1Query, type AnalyticsTopCampaignsV1, type AnalyticsWindowV1, type BatchEntryResult, type BatchSendRequest, type BatchSendResponse, type BulkCreateContactsRequest, type BulkDeleteContactsRequest, type CampaignDeletedV1, type CampaignListV1, type CampaignStatsV1, type CampaignV1, CampaignsResource, type ContactListResponse, type ContactRecord, ContactsResource, type CreateCampaignV1Request, type CreateContactRequest, type CreateSegmentV1Request, type CreateTemplateRequest, type CreateWebhookRequest, type CreateWorkflowV1Request, type CursorPage, type CursorPageQuery, DEFAULT_BASE_URL, DEFAULT_TOLERANCE_MS, type DomainListResponse, type DomainRecord, type DomainVerificationStatus, DomainsResource, type EmailGetResponse, type EmailListResponse, type EmailRecord, EmailsResource, type ErrorEnvelope, type EventListV1, type EventNamesV1, type EventStatsV1, type EventStatsV1Query, type EventV1, EventsResource, type IdResponse, type IdempotencyOptions, type JsonObject, type JsonValue, type ListCampaignsV1Query, type ListContactsQuery, type ListEmailsQuery, type ListEventsV1Query, type ListSegmentContactsV1Query, type ListSegmentsV1Query, type ListSubscribeData, type ListSubscribeRequest, type ListSubscribeResponse, type ListSuppressionsQuery, type ListTemplatesQuery, type ListTopCampaignsV1Query, type ListUnsubscribeData, type ListUnsubscribeRequest, type ListUnsubscribeResponse, type ListWebhookCallsQuery, type ListWorkflowExecutionsV1Query, type ListWorkflowsV1Query, ListsResource, type Problem, type ProblemDocument, type ProblemFieldError, type RecordEventV1Request, type RequestOptions, SDK_VERSION, type SegmentContactListV1, type SegmentContactV1, type SegmentDeletedV1, type SegmentListV1, type SegmentV1, SegmentsResource, type SendCampaignV1Request, type SendEmailData, type SendEmailRequest, type SendEmailResponse, Sendly, SendlyAuthenticationError, type SendlyClientOptions, SendlyConflictError, SendlyConnectionError, SendlyError, SendlyNotFoundError, SendlyPermissionError, SendlyRateLimitError, SendlyServerError, SendlyValidationError, type StartWorkflowExecutionV1Request, type SuccessEmpty, type SuppressionCheckResponse, type SuppressionListResponse, type SuppressionRecord, SuppressionResource, type TemplateListResponse, type TemplateRecord, TemplatesResource, type TrackEventData, type TrackEventRequest, type TrackEventResponse, type UpdateCampaignV1Request, type UpdateContactRequest, type UpdateSegmentV1Request, type UpdateTemplateRequest, type UpdateWebhookRequest, type UpdateWorkflowV1Request, UsageResource, type UsageV1, type VerifyEmailData, type VerifyEmailRequest, type VerifyEmailResponse, VerifyResource, type VerifySignatureOptions, type WebhookCall, type WebhookCallsListResponse, type WebhookCreateResponse, type WebhookGetResponse, type WebhookListResponse, type WebhookRecord, type WebhookRotateSecretResponse, WebhooksResource, type WorkflowDeletedV1, type WorkflowExecutionListV1, type WorkflowExecutionV1, type WorkflowListV1, type WorkflowStatsV1, type WorkflowStatsV1Query, type WorkflowV1, WorkflowsResource, asProblemDocument, type components, constructEvent, type operations, paginateCursor, type paths, verifySignature }; +export { type AddDomainRequest, type AddSuppressionRequest, type AnalyticsCampaignStatsV1, type AnalyticsCampaignsV1Query, AnalyticsResource, type AnalyticsTimeseriesV1, type AnalyticsTimeseriesV1Query, type AnalyticsTopCampaignsV1, type AnalyticsWindowV1, type BatchEntryResult, type BatchSendRequest, type BatchSendResponse, type BulkCreateContactsRequest, type BulkDeleteContactsRequest, type CampaignDeletedV1, type CampaignListV1, type CampaignStatsV1, type CampaignV1, CampaignsResource, type ContactListResponse, type ContactRecord, ContactsResource, type CreateCampaignV1Request, type CreateContactRequest, type CreateSegmentV1Request, type CreateTemplateRequest, type CreateWebhookRequest, type CreateWorkflowV1Request, type CursorPage, type CursorPageQuery, DEFAULT_BASE_URL, DEFAULT_TOLERANCE_MS, type DomainListResponse, type DomainRecord, type DomainVerificationStatus, DomainsResource, type EmailGetResponse, type EmailListResponse, type EmailRecord, EmailsResource, type ErrorEnvelope, type EventListV1, type EventNamesV1, type EventStatsV1, type EventStatsV1Query, type EventV1, EventsResource, type IdResponse, type IdempotencyOptions, type ListCampaignsV1Query, type ListContactsQuery, type ListEmailsQuery, type ListEventsV1Query, type ListSegmentContactsV1Query, type ListSegmentsV1Query, type ListSubscribeData, type ListSubscribeRequest, type ListSubscribeResponse, type ListSuppressionsQuery, type ListTemplatesQuery, type ListTopCampaignsV1Query, type ListUnsubscribeData, type ListUnsubscribeRequest, type ListUnsubscribeResponse, type ListWebhookCallsQuery, type ListWorkflowExecutionsV1Query, type ListWorkflowsV1Query, ListsResource, type Problem, type ProblemDocument, type ProblemFieldError, type RecordEventV1Request, type RequestOptions, SDK_VERSION, type SegmentContactListV1, type SegmentContactV1, type SegmentDeletedV1, type SegmentListV1, type SegmentV1, SegmentsResource, type SendCampaignV1Request, type SendEmailData, type SendEmailRequest, type SendEmailResponse, Sendly, SendlyAuthenticationError, type SendlyClientOptions, SendlyConflictError, SendlyConnectionError, SendlyError, SendlyNotFoundError, SendlyPermissionError, SendlyRateLimitError, SendlyServerError, SendlyValidationError, type StartWorkflowExecutionV1Request, type SuccessEmpty, type SuppressionCheckResponse, type SuppressionListResponse, type SuppressionRecord, SuppressionResource, type TemplateListResponse, type TemplateRecord, TemplatesResource, type TrackEventData, type TrackEventRequest, type TrackEventResponse, type UpdateCampaignV1Request, type UpdateContactRequest, type UpdateSegmentV1Request, type UpdateTemplateRequest, type UpdateWebhookRequest, type UpdateWorkflowV1Request, UsageResource, type UsageV1, type VerifyEmailData, type VerifyEmailRequest, type VerifyEmailResponse, VerifyResource, type VerifySignatureOptions, type WebhookCall, type WebhookCallsListResponse, type WebhookCreateResponse, type WebhookGetResponse, type WebhookListResponse, type WebhookRecord, type WebhookRotateSecretResponse, WebhooksResource, type WorkflowDeletedV1, type WorkflowExecutionListV1, type WorkflowExecutionV1, type WorkflowListV1, type WorkflowStatsV1, type WorkflowStatsV1Query, type WorkflowV1, WorkflowsResource, asProblemDocument, type components, constructEvent, type operations, paginateCursor, type paths, verifySignature }; diff --git a/dist/index.js b/dist/index.js index 2e94293..f924647 100644 --- a/dist/index.js +++ b/dist/index.js @@ -973,7 +973,7 @@ function errorFromResponse(statusCode, errorCode, message, body, contentType) { } // src/client.ts -var SDK_VERSION = "0.3.1"; +var SDK_VERSION = "0.4.0"; var DEFAULT_BASE_URL = "https://api.sendly.now"; var Sendly = class { emails; diff --git a/package.json b/package.json index c722c9d..8f64152 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "sendly-sdk", - "version": "0.3.1", + "version": "0.4.0", "description": "Official Sendly TypeScript SDK", "license": "MIT", "type": "module", diff --git a/src/client.ts b/src/client.ts index caf479c..f286f3d 100644 --- a/src/client.ts +++ b/src/client.ts @@ -16,7 +16,7 @@ import { errorFromResponse, SendlyConnectionError, SendlyError } from "./errors" import type { ErrorEnvelope } from "./types"; /** Build-time package version (kept in sync with package.json). */ -export const SDK_VERSION = "0.3.1"; +export const SDK_VERSION = "0.4.0"; /** Default production API base. Override via `baseUrl` for staging or self-hosted deployments. */ export const DEFAULT_BASE_URL = "https://api.sendly.now"; diff --git a/src/types.ts b/src/types.ts index a358acc..0ebab86 100644 --- a/src/types.ts +++ b/src/types.ts @@ -14,22 +14,6 @@ import type { components, paths } from "./types.generated"; /** Make `K` optional on `T`, leaving every other member as generated. */ type PartialKeys = Omit & Partial>; -/** - * Any JSON value. - * - * @deprecated No longer needed — the generated spec types accept arbitrary - * JSON since 0.3.1; will be removed in the next minor. - */ -export type JsonValue = string | number | boolean | null | JsonValue[] | { [key: string]: JsonValue }; - -/** - * A free-form JSON object. - * - * @deprecated No longer needed — the generated spec types accept arbitrary - * JSON since 0.3.1; will be removed in the next minor. - */ -export type JsonObject = { [key: string]: JsonValue }; - // ---------- Generic envelopes ---------- export type ErrorEnvelope = components["schemas"]["Error"];