Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions src/lib/seam/connect/models/custom-metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -46,3 +57,5 @@ export const custom_metadata = z
export type CustomMetadata = z.output<typeof custom_metadata>

export type CustomMetadataInput = z.input<typeof custom_metadata_input>

export type CustomMetadataHas = z.output<typeof custom_metadata_has>
18 changes: 12 additions & 6 deletions src/lib/seam/connect/openapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
},
},
Expand Down Expand Up @@ -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: {
Expand Down Expand Up @@ -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',
},
},
Expand Down Expand Up @@ -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: {
Expand Down Expand Up @@ -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',
},
},
Expand Down Expand Up @@ -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: {
Expand Down
12 changes: 6 additions & 6 deletions src/lib/seam/connect/route-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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`. */
Expand Down Expand Up @@ -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. */
Expand Down Expand Up @@ -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`. */
Expand Down
Loading