diff --git a/packages/js/package.json b/packages/js/package.json index 9430839..4ecb448 100644 --- a/packages/js/package.json +++ b/packages/js/package.json @@ -1,7 +1,7 @@ { "name": "@axiomhq/js", "description": "The official javascript bindings for the Axiom API", - "version": "1.0.0", + "version": "1.1.0", "author": "Axiom, Inc.", "license": "MIT", "contributors": [ @@ -52,4 +52,4 @@ "require": "./dist/cjs/index.cjs", "default": "./dist/esm/index.js" } -} +} \ No newline at end of file diff --git a/packages/js/src/datasets.ts b/packages/js/src/datasets.ts index b4af4dd..aeadd0e 100644 --- a/packages/js/src/datasets.ts +++ b/packages/js/src/datasets.ts @@ -26,6 +26,10 @@ export namespace datasets { description?: string; } + export interface CreateOptions { + referrer?: string; + } + export interface UpdateRequest { description: string; } @@ -41,7 +45,12 @@ export namespace datasets { get = (id: string): Promise => this.client.get(this.localPath + '/' + id); - create = (req: CreateRequest): Promise => this.client.post(this.localPath, { body: JSON.stringify(req) }); + create = (req: CreateRequest, opts?: CreateOptions): Promise => { + const params = new URLSearchParams(); + params.set('referrer', opts?.referrer ?? ''); + let path = `/v2/datasets?${params.toString()}`; + return this.client.post(path, { body: JSON.stringify(req) }); + }; update = (id: string, req: UpdateRequest): Promise => this.client.put(this.localPath + '/' + id, { body: JSON.stringify(req) }); diff --git a/turbo.json b/turbo.json index 1c29bc9..b92f6ac 100644 --- a/turbo.json +++ b/turbo.json @@ -28,8 +28,7 @@ "integration": { "dependsOn": [ "^build", - "^build:cjs", - "^test" + "^build:cjs" ] }, "e2e": {