Skip to content

Commit

Permalink
auto: apply newest APITable commit
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Nov 21, 2023
1 parent 9dffafd commit 9204ecd
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 215 deletions.
10 changes: 1 addition & 9 deletions lib/apitable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { IHttpResponse, IVikaClientConfig } from "./interface";
import { NodeManager } from "./node";
import { SpaceManager } from "./space";
import { mergeConfig, QPSController, isBrowser, subBeforeIfHaving } from "./utils";
import {IframeManager} from "./iframe";

// axios.defaults.adapter = mpAdapter;
export class Vika {
Expand Down Expand Up @@ -119,7 +118,7 @@ export class Vika {
datasheet(datasheetId: string) {
if (!datasheetId) {
throw new Error(
'Please pass the datasheet id, which can be retrieved from the datasheet url, ' +
'Please pass the datasheet id, which can be retrieved from the datasheet url, ' +
'the datasheet id usually starts with dst, for example dstRzy7alM1mkuy1Y3'
);
}
Expand All @@ -146,11 +145,4 @@ export class Vika {
space(spaceId: string) {
return new SpaceManager(this, spaceId);
}

/**
* 获取 iframe 通信
*/
getIframe() {
return new IframeManager();
}
}
24 changes: 0 additions & 24 deletions lib/enums.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,27 +70,3 @@ export enum APIMetaFieldPropertyFormatEnums {
Percent = 'Percent',
Currency = 'Currency',
}

export enum IframeMessageName {
Collaborators = "collaborators",
SocketStatus = "socketStatus",
SocketError = "socketError",
ChangeView = "changeView",
ChangeNodeName = 'changeNodeName',
PageLoaded = 'pageLoaded',
EmbedLinkFail = 'embedLinkFail',
PageCrash = 'pageCrash',
ChangeViewName = 'changeViewName',
TriggerEventResult = 'triggerEventResult',
}

export enum TriggerIframeMessageName {
ExportData = "exportData",
}

export enum Network {
Online = "online",
Offline = "offline",
Sync = "sync",
Loading = "loading"
}
76 changes: 0 additions & 76 deletions lib/iframe.ts

This file was deleted.

101 changes: 0 additions & 101 deletions lib/interface/iframe.ts

This file was deleted.

10 changes: 5 additions & 5 deletions test/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe('full pipeline', () => {
const folderId = process.env.FOLDER_ID as string;
const spaceId = process.env.SPACE_ID as string;
const viewId = process.env.VIEW_ID as string;

const apitable = new Vika({
token,
host,
Expand Down Expand Up @@ -102,9 +102,9 @@ describe('full pipeline', () => {

expect(result.success).toBeTruthy();
expect(result.data!.records.length).toEqual(recordsToUpdate.length);
// const all = await datasheet.records.query();
const all = await datasheet.records.query();
// The length should be the same as the original datasheet.
// expect(all.data!.records.length).toEqual(records.length);
expect(all.data!.records.length).toEqual(records.length);
});

it('upload buffer attachment', async () => {
Expand Down Expand Up @@ -134,7 +134,7 @@ describe('full pipeline', () => {
expect(result.success).toBeTruthy();
spaceIds = result.data!.spaces.map(item => item.id);
});
// nodes list
// nodes list
it('get node list', async () => {
const result = await apitable.nodes.list({ spaceId: spaceIds[0] });
expect(result.success).toBeTruthy();
Expand All @@ -147,7 +147,7 @@ describe('full pipeline', () => {
expect(result.success).toBeTruthy();
expect(result.data?.id).toEqual(firstNode.id);
});
// nodes search
// nodes search
it('search node', async () => {
const firstNode = nodes[0];
const result = await apitable.nodes.search({ spaceId: spaceIds[0], type: firstNode.type, query: firstNode.name });
Expand Down

0 comments on commit 9204ecd

Please sign in to comment.