@layer-ai/sdk 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@layer-ai/sdk",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Configure multiple AI models at runtime without code changes or deployments",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,15 +0,0 @@
1
- import type { Layer } from '../client.js';
2
- import type { Gate } from '../types/index.js';
3
- export declare class GatesResource {
4
- private client;
5
- constructor(client: Layer);
6
- /**
7
- * Lists all gates
8
- */
9
- list(): Promise<Gate[]>;
10
- /**
11
- * Gets a specific gate by ID
12
- */
13
- get(id: string): Promise<Gate>;
14
- }
15
- //# sourceMappingURL=gates.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"gates.d.ts","sourceRoot":"","sources":["../../src/resources/gates.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAE9C,qBAAa,aAAa;IACZ,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,KAAK;IAEjC;;OAEG;IACG,IAAI,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;IAO7B;;OAEG;IACG,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAMrC"}
@@ -1,23 +0,0 @@
1
- export class GatesResource {
2
- constructor(client) {
3
- this.client = client;
4
- }
5
- /**
6
- * Lists all gates
7
- */
8
- async list() {
9
- return this.client.request({
10
- method: 'GET',
11
- path: '/v1/gates',
12
- });
13
- }
14
- /**
15
- * Gets a specific gate by ID
16
- */
17
- async get(id) {
18
- return this.client.request({
19
- method: 'GET',
20
- path: `/v1/gates/${id}`,
21
- });
22
- }
23
- }
@@ -1,30 +0,0 @@
1
- import type { Layer } from '../client.js';
2
- import type { ApiKey, CreateKeyRequest, CreateKeyResponse } from '../types/index.js';
3
- export declare class KeysResource {
4
- private client;
5
- constructor(client: Layer);
6
- /**
7
- * Create a new API key.
8
- *
9
- * Requires `adminMode: true` in Layer constructor.
10
- *
11
- * @throws Error if adminMode is not enabled
12
- * @see https://docs.uselayer.ai/sdk/admin-mode
13
- */
14
- create(data: CreateKeyRequest): Promise<CreateKeyResponse>;
15
- /**
16
- * List all API keys.
17
- * No admin mode required.
18
- */
19
- list(): Promise<ApiKey[]>;
20
- /**
21
- * Delete an existint key.
22
- *
23
- * Requires `adminMode: true` in Layer constructor.
24
- *
25
- * @throws Error if adminMode is not enabled
26
- * @see https://docs.uselayer.ai/sdk/admin-mode
27
- */
28
- delete(id: string): Promise<void>;
29
- }
30
- //# sourceMappingURL=keys.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"keys.d.ts","sourceRoot":"","sources":["../../src/resources/keys.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,KAAK,EAAE,MAAM,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAErF,qBAAa,YAAY;IACX,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,KAAK;IAEjC;;;;;;;OAOG;IACG,MAAM,CAAC,IAAI,EAAE,gBAAgB,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAShE;;;OAGG;IACG,IAAI,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;IAO9B;;;;;;;MAOE;IACG,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAOxC"}
@@ -1,46 +0,0 @@
1
- export class KeysResource {
2
- constructor(client) {
3
- this.client = client;
4
- }
5
- /**
6
- * Create a new API key.
7
- *
8
- * Requires `adminMode: true` in Layer constructor.
9
- *
10
- * @throws Error if adminMode is not enabled
11
- * @see https://docs.uselayer.ai/sdk/admin-mode
12
- */
13
- async create(data) {
14
- this.client.checkAdminMode();
15
- return this.client.request({
16
- method: 'POST',
17
- path: '/v1/keys',
18
- body: data,
19
- });
20
- }
21
- /**
22
- * List all API keys.
23
- * No admin mode required.
24
- */
25
- async list() {
26
- return this.client.request({
27
- method: 'GET',
28
- path: '/v1/keys',
29
- });
30
- }
31
- /**
32
- * Delete an existint key.
33
- *
34
- * Requires `adminMode: true` in Layer constructor.
35
- *
36
- * @throws Error if adminMode is not enabled
37
- * @see https://docs.uselayer.ai/sdk/admin-mode
38
- */
39
- async delete(id) {
40
- this.client.checkAdminMode();
41
- await this.client.request({
42
- method: 'DELETE',
43
- path: `/v1/keys/${id}`,
44
- });
45
- }
46
- }
@@ -1,8 +0,0 @@
1
- import type { Layer } from '../client.js';
2
- import type { Log, ListLogOptions } from '../types/index.js';
3
- export declare class LogsResource {
4
- private client;
5
- constructor(client: Layer);
6
- list(options?: ListLogOptions): Promise<Log[]>;
7
- }
8
- //# sourceMappingURL=logs.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"logs.d.ts","sourceRoot":"","sources":["../../src/resources/logs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,KAAK,EAAE,GAAG,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAG7D,qBAAa,YAAY;IACX,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,KAAK;IAE3B,IAAI,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;CAcrD"}
@@ -1,20 +0,0 @@
1
- export class LogsResource {
2
- constructor(client) {
3
- this.client = client;
4
- }
5
- async list(options) {
6
- const params = new URLSearchParams();
7
- if (options?.limit)
8
- params.set('limit', options.limit.toString());
9
- if (options?.gate)
10
- params.set('gate', options.gate);
11
- if (options?.offset)
12
- params.set('offset', options.offset.toString());
13
- const query = params.toString();
14
- const path = query ? `/v1/logs?${query}` : '/v1/logs';
15
- return this.client.request({
16
- method: 'GET',
17
- path
18
- });
19
- }
20
- }
package/dist/types.d.ts DELETED
@@ -1,28 +0,0 @@
1
- export interface LayerConfig {
2
- apiKey: string;
3
- baseUrl?: string;
4
- /**
5
- * Enable admin mode for mutation operations.
6
- *
7
- * WARNING: Only set to true in setup scripts and IaC (infrastructure as code), and not in runtime code.
8
- *
9
- * Admin mode enables:
10
- * - layer.gates.create/udpate/delete()
11
- * - layer.keys.create/delete()
12
- *
13
- * Read operations are always available without admin mode:
14
- * - layer.gates.list/get()
15
- * - layer.keys.list()
16
- * - layer.complete()
17
- *
18
- * @default false
19
- * @see https://docs.uselayer.ai/sdk/admin-mode
20
- */
21
- adminMode?: boolean;
22
- }
23
- export interface RequestOptions {
24
- method: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
25
- path: string;
26
- body?: unknown;
27
- }
28
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;;;;;;;;;;;;;OAgBG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,OAAO,GAAG,QAAQ,CAAC;IACpD,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB"}
package/dist/types.js DELETED
@@ -1 +0,0 @@
1
- export {};