@truestamp/client
Version:
## Description
33 lines (23 loc) • 838 B
text/typescript
// Copyright © 2020-2023 Truestamp Inc. All rights reserved.
// import { describe, test, expect } from 'vitest'
// import { TruestampClient } from '../src/index'
// import { dotenvLoad } from 'dotenv-mono'
// dotenvLoad()
// import { ApiKeyBody, ApiKeyResponseSchema } from 'types'
// describe('createApiKey', () => {
// test('returns a key', async () => {
// const t = new TruestampClient({
// apiKey: process.env.TRUESTAMP_API_KEY ?? '',
// apiBaseUrl: process.env.TRUESTAMP_API_BASE_URL,
// })
// const newKey: ApiKeyBody = {
// refreshToken: 'myrefreshtoken',
// description: 'mydescription',
// ttl: 60,
// }
// const r = await t.createApiKey(newKey)
// // throws if not valid
// ApiKeyResponseSchema.parse(r)
// expect(r.apiKey).toContain('_')
// })
// })