@basetime/a2w-api-ts
Version:
Client library that communicates with the addtowallet API.
63 lines (62 loc) • 2.03 kB
TypeScript
import { z } from 'zod';
/**
* Schema for the source of a data store.
*
* `key-value` stores embed their data inline; other source types pull from an external
* system identified by `config`. Backend support is intentionally open-ended; the
* schema accepts any string while the common ones autocomplete on the TypeScript side
* via the union below.
*/
export declare const DataStoreSourceSchema: z.ZodString;
/**
* The source of a data store. Common values: `key-value`, `sftp`, `http`.
*/
export type DataStoreSource = 'key-value' | 'sftp' | 'http' | (string & {});
/**
* Schema for a single key/value pair on a `key-value` data store.
*/
export declare const DataStoreKeyValueSchema: z.ZodObject<{
key: z.ZodString;
value: z.ZodOptional<z.ZodString>;
}, z.core.$loose>;
/**
* A single key/value pair on a `key-value` data store.
*/
export type DataStoreKeyValue = z.infer<typeof DataStoreKeyValueSchema>;
/**
* Schema for the body accepted by create/update on the data stores sub-endpoint.
*/
export declare const DataStoreInputSchema: z.ZodObject<{
name: z.ZodString;
source: z.ZodString;
keyValue: z.ZodOptional<z.ZodArray<z.ZodObject<{
key: z.ZodString;
value: z.ZodOptional<z.ZodString>;
}, z.core.$loose>>>;
}, z.core.$loose>;
/**
* Body accepted by create/update on the data stores sub-endpoint.
*/
export type DataStoreInput = z.infer<typeof DataStoreInputSchema> & {
source: DataStoreSource;
};
/**
* Schema for a data store owned by an organization.
*/
export declare const DataStoreSchema: z.ZodObject<{
name: z.ZodString;
source: z.ZodString;
keyValue: z.ZodOptional<z.ZodArray<z.ZodObject<{
key: z.ZodString;
value: z.ZodOptional<z.ZodString>;
}, z.core.$loose>>>;
id: z.ZodString;
organization: z.ZodString;
createdDate: z.ZodCoercedDate<unknown>;
}, z.core.$loose>;
/**
* A data store owned by an organization.
*/
export type DataStore = z.infer<typeof DataStoreSchema> & {
source: DataStoreSource;
};