From 8a1789f436e37067fb578f3696ef26a47a692bd8 Mon Sep 17 00:00:00 2001 From: ziqiang <1694392889@qq.com> Date: Fri, 24 Nov 2023 14:09:02 +0800 Subject: [PATCH] feat: add new v3 version --- .github/workflows/npm-publish.yml | 2 +- lib/apitable.ts | 4 ++++ lib/const.ts | 2 +- package.json | 2 +- test/index.spec.ts | 2 ++ 5 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml index 9e6c3e3..3cb3d87 100644 --- a/.github/workflows/npm-publish.yml +++ b/.github/workflows/npm-publish.yml @@ -40,6 +40,6 @@ jobs: registry-url: https://registry.npmjs.org/ - run: | yarn - yarn publish --access public + yarn publish --access public --tag beta env: NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN }} diff --git a/lib/apitable.ts b/lib/apitable.ts index 9d7125f..2588456 100644 --- a/lib/apitable.ts +++ b/lib/apitable.ts @@ -145,4 +145,8 @@ export class Vika { space(spaceId: string) { return new SpaceManager(this, spaceId); } + + public isV3() { + return true; + } } diff --git a/lib/const.ts b/lib/const.ts index bae0e9e..044f436 100644 --- a/lib/const.ts +++ b/lib/const.ts @@ -6,7 +6,7 @@ export const MIN_TIME_GAP = 1000 / QPS; // Maximum concurrency, 5 requests per s export const DST_MAX_RECORDS = 50000; // Maximum number of records in a single datasheet. export const DEFAULT_HOST = 'https://api.vika.cn'; export const FUSION_PATH_PREFIX = '/fusion'; -export const DEFAULT_VERSION_PREFIX = '/fusion/v1'; +export const DEFAULT_VERSION_PREFIX = '/fusion/v3'; export const DEFAULT_REQUEST_TIMEOUT = 60000; export const MAX_WRITE_SIZE_PER_REQ = 10; diff --git a/package.json b/package.json index 2983946..e07a2d5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@vikadata/vika", - "version": "1.4.0", + "version": "2.0.0-beta.1", "description": "维格表官方 JavaScript SDK", "main": "./es/index.js", "scripts": { diff --git a/test/index.spec.ts b/test/index.spec.ts index 0a190f7..5afcfd8 100644 --- a/test/index.spec.ts +++ b/test/index.spec.ts @@ -39,6 +39,8 @@ describe('full pipeline', () => { host, fieldKey: 'id', }); + + console.log('api version is v3 ', apitable.isV3()); const datasheet = apitable.datasheet(datasheetId); console.time('list records'); const result = await datasheet.records.query();