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
42 changes: 42 additions & 0 deletions src/alphalib/types/assembliesGet.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import z from 'zod'

import { assemblyAuthInstructionsSchema } from './template.ts'

export const assembliesGetSchema = z
.object({
auth: assemblyAuthInstructionsSchema,
page: z
.number()
.int()
.default(1)
.describe('Specifies the current page, within the current pagination'),
pagesize: z
.number()
.int()
.min(1)
.max(5000)
.default(50)
.describe(
'Specifies how many Assemblies to be received per API request, which is useful for pagination.',
),
type: z
.enum(['all', 'uploading', 'executing', 'canceled', 'completed', 'failed', 'request_aborted'])
.describe('Specifies the types of Assemblies to be retrieved.'),
fromdate: z
.string()
.describe(
'Specifies the minimum Assembly UTC creation date/time. Only Assemblies after this time will be retrieved. Use the format `Y-m-d H:i:s`.',
),
todate: z
.string()
.default('NOW()')
.describe(
'Specifies the maximum Assembly UTC creation date/time. Only Assemblies before this time will be retrieved. Use the format `Y-m-d H:i:s`.',
),
keywords: z
.array(z.string())
.describe(
'Specifies keywords to be matched in the Assembly Status. The Assembly fields checked include the `id`, `redirect_url`, `fields`, and `notify_url`, as well as error messages and files used.',
),
})
.strict()
24 changes: 24 additions & 0 deletions src/alphalib/types/assemblyReplay.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { z } from 'zod'

import {
assemblyAuthInstructionsSchema,
fieldsSchema,
notifyUrlSchema,
optionalStepsSchema,
templateIdSchema,
} from './template.ts'

export const assemblyReplaySchema = z
.object({
auth: assemblyAuthInstructionsSchema,
steps: optionalStepsSchema as typeof optionalStepsSchema,
template_id: templateIdSchema,
notify_url: notifyUrlSchema,
fields: fieldsSchema,
reparse_template: z
.union([z.literal(0), z.literal(1)])
.describe(
'Specify `1` to reparse the Template used in your Assembly (useful if the Template changed in the meantime). Alternatively, `0` replays the identical Steps used in the Assembly.',
),
})
.strict()
16 changes: 16 additions & 0 deletions src/alphalib/types/assemblyReplayNotification.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { z } from 'zod'

import { assemblyAuthInstructionsSchema, optionalStepsSchema } from './template.ts'

export const assemblyReplayNotificationSchema = z
.object({
auth: assemblyAuthInstructionsSchema,
steps: optionalStepsSchema as typeof optionalStepsSchema,
wait: z
.boolean()
.default(true)
.describe(
'If it is provided with the value `false`, then the API request will return immediately even though the Notification is still in progress. This can be useful if your server takes some time to respond, but you do not want the replay API request to hang.',
),
})
.strict()
9 changes: 9 additions & 0 deletions src/alphalib/types/bill.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { z } from 'zod'

import { assemblyAuthInstructionsSchema } from './template.ts'

export const billSchema = z
.object({
auth: assemblyAuthInstructionsSchema,
})
.strict()
Loading