diff --git a/src/lib/seam/connect/models/custom-metadata.ts b/src/lib/seam/connect/models/custom-metadata.ts index 9a3bc9ec..88462d37 100644 --- a/src/lib/seam/connect/models/custom-metadata.ts +++ b/src/lib/seam/connect/models/custom-metadata.ts @@ -31,10 +31,21 @@ export const custom_metadata_input = z 'Set of up to 50 key:value pairs, with key names up to 40 characters long that cannot contain a period (.). Accepts string or Boolean values. Strings are limited to 500 characters. Adding custom metadata to a resource, such as a [Connect Webview](https://docs.seam.co/core-concepts/connect-webviews/attaching-custom-data-to-the-connect-webview), [connected account](https://docs.seam.co/core-concepts/connected-accounts/adding-custom-metadata-to-a-connected-account), or [device](https://docs.seam.co/core-concepts/devices/adding-custom-metadata-to-a-device), enables you to store custom information, like customer details or internal IDs from your application. Set a key to `null` or to an empty string to remove that key from the custom metadata.', ) +// A query string can only carry `null` for an unset value — the serializer drops +// an empty string — so `""` is dropped here rather than given a meaning it could +// not keep on a GET. It has to be the schema and not a handler: lib/api/pagination.ts +// serializes req.commonParams for next_page_url and the cursor hash. export const custom_metadata_has = z - .record(custom_metadata_has_key, z.union([z.string(), z.boolean()])) + .record(custom_metadata_has_key, z.union([z.string(), z.boolean(), z.null()])) + .transform((custom_metadata_has_filter) => + Object.fromEntries( + Object.entries(custom_metadata_has_filter).filter( + ([, metadata_value]) => metadata_value !== '', + ), + ), + ) .describe( - 'Set of key:value pairs by which to filter. Key names cannot contain a period (.). Accepts string or Boolean values. Specify an empty string to match a key that is unset or set to an empty string.', + 'Set of key:value pairs by which to filter. Key names cannot contain a period (.). Accepts string or Boolean values, or `null` to match a key that is unset. A key given an empty string is omitted from the filter.', ) export const custom_metadata = z @@ -46,3 +57,5 @@ export const custom_metadata = z export type CustomMetadata = z.output export type CustomMetadataInput = z.input + +export type CustomMetadataHas = z.output diff --git a/src/lib/seam/connect/openapi.ts b/src/lib/seam/connect/openapi.ts index c695b13f..25abdaa7 100644 --- a/src/lib/seam/connect/openapi.ts +++ b/src/lib/seam/connect/openapi.ts @@ -51244,10 +51244,11 @@ const openapi: OpenAPISpec = { name: 'custom_metadata_has', schema: { additionalProperties: { + nullable: true, oneOf: [{ type: 'string' }, { type: 'boolean' }], }, description: - 'Custom metadata pairs by which you want to [filter Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews/filtering-connect-webviews-by-custom-metadata). Returns Connect Webviews with `custom_metadata` that contains all of the provided key:value pairs. Key names cannot contain a period (.). Specify an empty string to match a key that is unset or set to an empty string.', + 'Custom metadata pairs by which you want to [filter Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews/filtering-connect-webviews-by-custom-metadata). Returns Connect Webviews with `custom_metadata` that contains all of the provided key:value pairs. Key names cannot contain a period (.). Specify `null` to match a key that is unset. A key given an empty string is omitted from the filter.', type: 'object', }, }, @@ -51333,10 +51334,11 @@ const openapi: OpenAPISpec = { properties: { custom_metadata_has: { additionalProperties: { + nullable: true, oneOf: [{ type: 'string' }, { type: 'boolean' }], }, description: - 'Custom metadata pairs by which you want to [filter Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews/filtering-connect-webviews-by-custom-metadata). Returns Connect Webviews with `custom_metadata` that contains all of the provided key:value pairs. Key names cannot contain a period (.). Specify an empty string to match a key that is unset or set to an empty string.', + 'Custom metadata pairs by which you want to [filter Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews/filtering-connect-webviews-by-custom-metadata). Returns Connect Webviews with `custom_metadata` that contains all of the provided key:value pairs. Key names cannot contain a period (.). Specify `null` to match a key that is unset. A key given an empty string is omitted from the filter.', type: 'object', }, customer_key: { @@ -51672,10 +51674,11 @@ const openapi: OpenAPISpec = { name: 'custom_metadata_has', schema: { additionalProperties: { + nullable: true, oneOf: [{ type: 'string' }, { type: 'boolean' }], }, description: - 'Custom metadata pairs by which you want to filter connected accounts. Returns connected accounts with `custom_metadata` that contains all of the provided key:value pairs. Key names cannot contain a period (.). Specify an empty string to match a key that is unset or set to an empty string.', + 'Custom metadata pairs by which you want to filter connected accounts. Returns connected accounts with `custom_metadata` that contains all of the provided key:value pairs. Key names cannot contain a period (.). Specify `null` to match a key that is unset. A key given an empty string is omitted from the filter.', type: 'object', }, }, @@ -51781,10 +51784,11 @@ const openapi: OpenAPISpec = { properties: { custom_metadata_has: { additionalProperties: { + nullable: true, oneOf: [{ type: 'string' }, { type: 'boolean' }], }, description: - 'Custom metadata pairs by which you want to filter connected accounts. Returns connected accounts with `custom_metadata` that contains all of the provided key:value pairs. Key names cannot contain a period (.). Specify an empty string to match a key that is unset or set to an empty string.', + 'Custom metadata pairs by which you want to filter connected accounts. Returns connected accounts with `custom_metadata` that contains all of the provided key:value pairs. Key names cannot contain a period (.). Specify `null` to match a key that is unset. A key given an empty string is omitted from the filter.', type: 'object', }, customer_key: { @@ -55498,10 +55502,11 @@ const openapi: OpenAPISpec = { name: 'custom_metadata_has', schema: { additionalProperties: { + nullable: true, oneOf: [{ type: 'string' }, { type: 'boolean' }], }, description: - 'Set of key:value [custom metadata](https://docs.seam.co/core-concepts/devices/adding-custom-metadata-to-a-device) pairs for which you want to list devices. Key names cannot contain a period (.). Specify an empty string to match a key that is unset or set to an empty string.', + 'Set of key:value [custom metadata](https://docs.seam.co/core-concepts/devices/adding-custom-metadata-to-a-device) pairs for which you want to list devices. Key names cannot contain a period (.). Specify `null` to match a key that is unset. A key given an empty string is omitted from the filter.', type: 'object', }, }, @@ -55688,10 +55693,11 @@ const openapi: OpenAPISpec = { }, custom_metadata_has: { additionalProperties: { + nullable: true, oneOf: [{ type: 'string' }, { type: 'boolean' }], }, description: - 'Set of key:value [custom metadata](https://docs.seam.co/core-concepts/devices/adding-custom-metadata-to-a-device) pairs for which you want to list devices. Key names cannot contain a period (.). Specify an empty string to match a key that is unset or set to an empty string.', + 'Set of key:value [custom metadata](https://docs.seam.co/core-concepts/devices/adding-custom-metadata-to-a-device) pairs for which you want to list devices. Key names cannot contain a period (.). Specify `null` to match a key that is unset. A key given an empty string is omitted from the filter.', type: 'object', }, customer_key: { diff --git a/src/lib/seam/connect/route-types.ts b/src/lib/seam/connect/route-types.ts index 799dd8bc..bcda2da1 100644 --- a/src/lib/seam/connect/route-types.ts +++ b/src/lib/seam/connect/route-types.ts @@ -48415,10 +48415,10 @@ export type Routes = { customer_key?: string | undefined /** Your user ID for the user by which you want to filter Connect Webviews. */ user_identifier_key?: string | undefined - /** Custom metadata pairs by which you want to [filter Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews/filtering-connect-webviews-by-custom-metadata). Returns Connect Webviews with `custom_metadata` that contains all of the provided key:value pairs. Key names cannot contain a period (.). Specify an empty string to match a key that is unset or set to an empty string. */ + /** Custom metadata pairs by which you want to [filter Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews/filtering-connect-webviews-by-custom-metadata). Returns Connect Webviews with `custom_metadata` that contains all of the provided key:value pairs. Key names cannot contain a period (.). Specify `null` to match a key that is unset. A key given an empty string is omitted from the filter. */ custom_metadata_has?: | { - [x: string]: string | boolean + [x: string]: string | boolean | null } | undefined /** String for which to search. Filters returned Connect Webviews to include all records that satisfy a partial match using `connect_webview_id`, `accepted_providers`, `custom_metadata`, or `customer_key`. */ @@ -48747,10 +48747,10 @@ export type Routes = { commonParams: { /** Your user ID for the user by which you want to filter connected accounts. */ user_identifier_key?: string | undefined - /** Custom metadata pairs by which you want to filter connected accounts. Returns connected accounts with `custom_metadata` that contains all of the provided key:value pairs. Key names cannot contain a period (.). Specify an empty string to match a key that is unset or set to an empty string. */ + /** Custom metadata pairs by which you want to filter connected accounts. Returns connected accounts with `custom_metadata` that contains all of the provided key:value pairs. Key names cannot contain a period (.). Specify `null` to match a key that is unset. A key given an empty string is omitted from the filter. */ custom_metadata_has?: | { - [x: string]: string | boolean + [x: string]: string | boolean | null } | undefined /** Customer key by which you want to filter connected accounts. */ @@ -52363,10 +52363,10 @@ export type Routes = { created_before?: Date | undefined /** Your own internal user ID for the user for which you want to list devices. */ user_identifier_key?: string | undefined - /** Set of key:value [custom metadata](https://docs.seam.co/core-concepts/devices/adding-custom-metadata-to-a-device) pairs for which you want to list devices. Key names cannot contain a period (.). Specify an empty string to match a key that is unset or set to an empty string. */ + /** Set of key:value [custom metadata](https://docs.seam.co/core-concepts/devices/adding-custom-metadata-to-a-device) pairs for which you want to list devices. Key names cannot contain a period (.). Specify `null` to match a key that is unset. A key given an empty string is omitted from the filter. */ custom_metadata_has?: | { - [x: string]: string | boolean + [x: string]: string | boolean | null } | undefined /** Identifies the specific page of results to return, obtained from the previous page's `next_page_cursor`. */