@seamapi/http 1.39.1 → 1.40.0
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/README.md +8 -8
- package/dist/connect.cjs +86 -25
- package/dist/connect.cjs.map +1 -1
- package/dist/connect.d.cts +41 -20
- package/lib/seam/connect/auth.js +3 -3
- package/lib/seam/connect/auth.js.map +1 -1
- package/lib/seam/connect/index.d.ts +0 -1
- package/lib/seam/connect/index.js +0 -1
- package/lib/seam/connect/index.js.map +1 -1
- package/lib/seam/connect/options.d.ts +9 -9
- package/lib/seam/connect/options.js +7 -7
- package/lib/seam/connect/options.js.map +1 -1
- package/lib/seam/connect/parse-options.d.ts +2 -2
- package/lib/seam/connect/parse-options.js +2 -2
- package/lib/seam/connect/parse-options.js.map +1 -1
- package/lib/seam/connect/routes/index.d.ts +2 -0
- package/lib/seam/connect/routes/index.js +2 -0
- package/lib/seam/connect/routes/index.js.map +1 -1
- package/lib/seam/connect/routes/seam-http-endpoints-without-workspace.d.ts +17 -0
- package/lib/seam/connect/routes/seam-http-endpoints-without-workspace.js +54 -0
- package/lib/seam/connect/routes/seam-http-endpoints-without-workspace.js.map +1 -0
- package/lib/seam/connect/routes/seam-http-without-workspace.d.ts +18 -0
- package/lib/seam/connect/routes/seam-http-without-workspace.js +47 -0
- package/lib/seam/connect/routes/seam-http-without-workspace.js.map +1 -0
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +2 -2
- package/src/lib/seam/connect/auth.ts +8 -8
- package/src/lib/seam/connect/index.ts +0 -1
- package/src/lib/seam/connect/options.ts +19 -19
- package/src/lib/seam/connect/parse-options.ts +4 -4
- package/src/lib/seam/connect/routes/index.ts +2 -0
- package/src/lib/seam/connect/routes/seam-http-endpoints-without-workspace.ts +126 -0
- package/src/lib/seam/connect/routes/seam-http-without-workspace.ts +96 -0
- package/src/lib/version.ts +1 -1
- package/lib/seam/connect/seam-http-multi-workspace.d.ts +0 -12
- package/lib/seam/connect/seam-http-multi-workspace.js +0 -36
- package/lib/seam/connect/seam-http-multi-workspace.js.map +0 -1
- package/src/lib/seam/connect/seam-http-multi-workspace.ts +0 -80
|
@@ -20,6 +20,8 @@ export * from './phones/index.js';
|
|
|
20
20
|
export * from './seam/index.js';
|
|
21
21
|
export * from './seam-http.js';
|
|
22
22
|
export * from './seam-http-endpoints.js';
|
|
23
|
+
export * from './seam-http-endpoints-without-workspace.js';
|
|
24
|
+
export * from './seam-http-without-workspace.js';
|
|
23
25
|
export * from './spaces/index.js';
|
|
24
26
|
export * from './thermostats/index.js';
|
|
25
27
|
export * from './unstable-access-grants/index.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/seam/connect/routes/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,cAAc,yBAAyB,CAAA;AACvC,cAAc,0BAA0B,CAAA;AACxC,cAAc,2BAA2B,CAAA;AACzC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,4BAA4B,CAAA;AAC1C,cAAc,oBAAoB,CAAA;AAClC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,6BAA6B,CAAA;AAC3C,cAAc,+BAA+B,CAAA;AAC7C,cAAc,oBAAoB,CAAA;AAClC,cAAc,mBAAmB,CAAA;AACjC,cAAc,kBAAkB,CAAA;AAChC,cAAc,qBAAqB,CAAA;AACnC,cAAc,0BAA0B,CAAA;AACxC,cAAc,mBAAmB,CAAA;AACjC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,0BAA0B,CAAA;AACxC,cAAc,mBAAmB,CAAA;AACjC,cAAc,wBAAwB,CAAA;AACtC,cAAc,mCAAmC,CAAA;AACjD,cAAc,oCAAoC,CAAA;AAClD,cAAc,+BAA+B,CAAA;AAC7C,cAAc,6BAA6B,CAAA;AAC3C,cAAc,4BAA4B,CAAA;AAC1C,cAAc,qBAAqB,CAAA;AACnC,cAAc,uBAAuB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/seam/connect/routes/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,cAAc,yBAAyB,CAAA;AACvC,cAAc,0BAA0B,CAAA;AACxC,cAAc,2BAA2B,CAAA;AACzC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,4BAA4B,CAAA;AAC1C,cAAc,oBAAoB,CAAA;AAClC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,6BAA6B,CAAA;AAC3C,cAAc,+BAA+B,CAAA;AAC7C,cAAc,oBAAoB,CAAA;AAClC,cAAc,mBAAmB,CAAA;AACjC,cAAc,kBAAkB,CAAA;AAChC,cAAc,qBAAqB,CAAA;AACnC,cAAc,0BAA0B,CAAA;AACxC,cAAc,mBAAmB,CAAA;AACjC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,0BAA0B,CAAA;AACxC,cAAc,4CAA4C,CAAA;AAC1D,cAAc,kCAAkC,CAAA;AAChD,cAAc,mBAAmB,CAAA;AACjC,cAAc,wBAAwB,CAAA;AACtC,cAAc,mCAAmC,CAAA;AACjD,cAAc,oCAAoC,CAAA;AAClD,cAAc,+BAA+B,CAAA;AAC7C,cAAc,6BAA6B,CAAA;AAC3C,cAAc,4BAA4B,CAAA;AAC1C,cAAc,qBAAqB,CAAA;AACnC,cAAc,uBAAuB,CAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type Client } from '../../../../lib/seam/connect/client.js';
|
|
2
|
+
import { type SeamHttpRequestOptions, type SeamHttpWithoutWorkspaceOptions, type SeamHttpWithoutWorkspaceOptionsWithClient, type SeamHttpWithoutWorkspaceOptionsWithConsoleSessionToken, type SeamHttpWithoutWorkspaceOptionsWithPersonalAccessToken } from '../../../../lib/seam/connect/options.js';
|
|
3
|
+
import { type WorkspacesCreateOptions, type WorkspacesCreateParameters, type WorkspacesCreateRequest, type WorkspacesListOptions, type WorkspacesListParameters, type WorkspacesListRequest } from './workspaces/index.js';
|
|
4
|
+
export declare class SeamHttpEndpointsWithoutWorkspace {
|
|
5
|
+
client: Client;
|
|
6
|
+
readonly defaults: Required<SeamHttpRequestOptions>;
|
|
7
|
+
readonly ltsVersion = "1.0.0";
|
|
8
|
+
static ltsVersion: string;
|
|
9
|
+
constructor(options?: SeamHttpWithoutWorkspaceOptions);
|
|
10
|
+
static fromClient(client: SeamHttpWithoutWorkspaceOptionsWithClient['client'], options?: Omit<SeamHttpWithoutWorkspaceOptionsWithClient, 'client'>): SeamHttpEndpointsWithoutWorkspace;
|
|
11
|
+
static fromConsoleSessionToken(consoleSessionToken: SeamHttpWithoutWorkspaceOptionsWithConsoleSessionToken['consoleSessionToken'], options?: Omit<SeamHttpWithoutWorkspaceOptionsWithConsoleSessionToken, 'consoleSessionToken'>): SeamHttpEndpointsWithoutWorkspace;
|
|
12
|
+
static fromPersonalAccessToken(personalAccessToken: SeamHttpWithoutWorkspaceOptionsWithPersonalAccessToken['personalAccessToken'], options?: Omit<SeamHttpWithoutWorkspaceOptionsWithPersonalAccessToken, 'personalAccessToken'>): SeamHttpEndpointsWithoutWorkspace;
|
|
13
|
+
get ['/workspaces/create'](): (parameters?: WorkspacesCreateParameters, options?: WorkspacesCreateOptions) => WorkspacesCreateRequest;
|
|
14
|
+
get ['/workspaces/list'](): (parameters?: WorkspacesListParameters, options?: WorkspacesListOptions) => WorkspacesListRequest;
|
|
15
|
+
}
|
|
16
|
+
export type SeamHttpEndpointWithoutWorkspaceQueryPaths = '/workspaces/list';
|
|
17
|
+
export type SeamHttpEndpointWithoutWorkspaceMutationPaths = '/workspaces/create';
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Automatically generated by codegen/smith.ts.
|
|
3
|
+
* Do not edit this file or add other files to this directory.
|
|
4
|
+
*/
|
|
5
|
+
import { seamApiLtsVersion } from '../../../../lib/lts-version.js';
|
|
6
|
+
import { createClient } from '../../../../lib/seam/connect/client.js';
|
|
7
|
+
import { isSeamHttpWithoutWorkspaceOptionsWithClient, isSeamHttpWithoutWorkspaceOptionsWithConsoleSessionToken, isSeamHttpWithoutWorkspaceOptionsWithPersonalAccessToken, SeamHttpWithoutWorkspaceInvalidOptionsError, } from '../../../../lib/seam/connect/options.js';
|
|
8
|
+
import { limitToSeamHttpRequestOptions, parseOptions, } from '../../../../lib/seam/connect/parse-options.js';
|
|
9
|
+
import { SeamHttpWorkspaces, } from './workspaces/index.js';
|
|
10
|
+
export class SeamHttpEndpointsWithoutWorkspace {
|
|
11
|
+
constructor(options = {}) {
|
|
12
|
+
this.ltsVersion = seamApiLtsVersion;
|
|
13
|
+
const opts = parseOptions(options);
|
|
14
|
+
this.client = 'client' in opts ? opts.client : createClient(opts);
|
|
15
|
+
this.defaults = limitToSeamHttpRequestOptions(opts);
|
|
16
|
+
}
|
|
17
|
+
static fromClient(client, options = {}) {
|
|
18
|
+
const constructorOptions = { ...options, client };
|
|
19
|
+
if (!isSeamHttpWithoutWorkspaceOptionsWithClient(constructorOptions)) {
|
|
20
|
+
throw new SeamHttpWithoutWorkspaceInvalidOptionsError('Missing client');
|
|
21
|
+
}
|
|
22
|
+
return new SeamHttpEndpointsWithoutWorkspace(constructorOptions);
|
|
23
|
+
}
|
|
24
|
+
static fromConsoleSessionToken(consoleSessionToken, options = {}) {
|
|
25
|
+
const constructorOptions = { ...options, consoleSessionToken };
|
|
26
|
+
if (!isSeamHttpWithoutWorkspaceOptionsWithConsoleSessionToken(constructorOptions)) {
|
|
27
|
+
throw new SeamHttpWithoutWorkspaceInvalidOptionsError('Missing consoleSessionToken');
|
|
28
|
+
}
|
|
29
|
+
return new SeamHttpEndpointsWithoutWorkspace(constructorOptions);
|
|
30
|
+
}
|
|
31
|
+
static fromPersonalAccessToken(personalAccessToken, options = {}) {
|
|
32
|
+
const constructorOptions = { ...options, personalAccessToken };
|
|
33
|
+
if (!isSeamHttpWithoutWorkspaceOptionsWithPersonalAccessToken(constructorOptions)) {
|
|
34
|
+
throw new SeamHttpWithoutWorkspaceInvalidOptionsError('Missing personalAccessToken');
|
|
35
|
+
}
|
|
36
|
+
return new SeamHttpEndpointsWithoutWorkspace(constructorOptions);
|
|
37
|
+
}
|
|
38
|
+
get ['/workspaces/create']() {
|
|
39
|
+
const { client, defaults } = this;
|
|
40
|
+
return function workspacesCreate(...args) {
|
|
41
|
+
const seam = SeamHttpWorkspaces.fromClient(client, defaults);
|
|
42
|
+
return seam.create(...args);
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
get ['/workspaces/list']() {
|
|
46
|
+
const { client, defaults } = this;
|
|
47
|
+
return function workspacesList(...args) {
|
|
48
|
+
const seam = SeamHttpWorkspaces.fromClient(client, defaults);
|
|
49
|
+
return seam.list(...args);
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
SeamHttpEndpointsWithoutWorkspace.ltsVersion = seamApiLtsVersion;
|
|
54
|
+
//# sourceMappingURL=seam-http-endpoints-without-workspace.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"seam-http-endpoints-without-workspace.js","sourceRoot":"","sources":["../../../../src/lib/seam/connect/routes/seam-http-endpoints-without-workspace.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AACtD,OAAO,EAAe,YAAY,EAAE,MAAM,4BAA4B,CAAA;AACtE,OAAO,EACL,2CAA2C,EAC3C,wDAAwD,EACxD,wDAAwD,EAExD,2CAA2C,GAK5C,MAAM,6BAA6B,CAAA;AACpC,OAAO,EACL,6BAA6B,EAC7B,YAAY,GACb,MAAM,mCAAmC,CAAA;AAE1C,OAAO,EACL,kBAAkB,GAOnB,MAAM,uBAAuB,CAAA;AAE9B,MAAM,OAAO,iCAAiC;IAM5C,YAAY,UAA2C,EAAE;QAHhD,eAAU,GAAG,iBAAiB,CAAA;QAIrC,MAAM,IAAI,GAAG,YAAY,CAAC,OAAO,CAAC,CAAA;QAClC,IAAI,CAAC,MAAM,GAAG,QAAQ,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,YAAY,CAAC,IAAI,CAAC,CAAA;QACjE,IAAI,CAAC,QAAQ,GAAG,6BAA6B,CAAC,IAAI,CAAC,CAAA;IACrD,CAAC;IAED,MAAM,CAAC,UAAU,CACf,MAA2D,EAC3D,UAAqE,EAAE;QAEvE,MAAM,kBAAkB,GAAG,EAAE,GAAG,OAAO,EAAE,MAAM,EAAE,CAAA;QACjD,IAAI,CAAC,2CAA2C,CAAC,kBAAkB,CAAC,EAAE,CAAC;YACrE,MAAM,IAAI,2CAA2C,CAAC,gBAAgB,CAAC,CAAA;QACzE,CAAC;QACD,OAAO,IAAI,iCAAiC,CAAC,kBAAkB,CAAC,CAAA;IAClE,CAAC;IAED,MAAM,CAAC,uBAAuB,CAC5B,mBAAkG,EAClG,UAGI,EAAE;QAEN,MAAM,kBAAkB,GAAG,EAAE,GAAG,OAAO,EAAE,mBAAmB,EAAE,CAAA;QAC9D,IACE,CAAC,wDAAwD,CACvD,kBAAkB,CACnB,EACD,CAAC;YACD,MAAM,IAAI,2CAA2C,CACnD,6BAA6B,CAC9B,CAAA;QACH,CAAC;QACD,OAAO,IAAI,iCAAiC,CAAC,kBAAkB,CAAC,CAAA;IAClE,CAAC;IAED,MAAM,CAAC,uBAAuB,CAC5B,mBAAkG,EAClG,UAGI,EAAE;QAEN,MAAM,kBAAkB,GAAG,EAAE,GAAG,OAAO,EAAE,mBAAmB,EAAE,CAAA;QAC9D,IACE,CAAC,wDAAwD,CACvD,kBAAkB,CACnB,EACD,CAAC;YACD,MAAM,IAAI,2CAA2C,CACnD,6BAA6B,CAC9B,CAAA;QACH,CAAC;QACD,OAAO,IAAI,iCAAiC,CAAC,kBAAkB,CAAC,CAAA;IAClE,CAAC;IAED,IAAI,CAAC,oBAAoB,CAAC;QAIxB,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAA;QACjC,OAAO,SAAS,gBAAgB,CAC9B,GAAG,IAA8C;YAEjD,MAAM,IAAI,GAAG,kBAAkB,CAAC,UAAU,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAA;YAC5D,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,CAAA;QAC7B,CAAC,CAAA;IACH,CAAC;IAED,IAAI,CAAC,kBAAkB,CAAC;QAItB,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAA;QACjC,OAAO,SAAS,cAAc,CAC5B,GAAG,IAA4C;YAE/C,MAAM,IAAI,GAAG,kBAAkB,CAAC,UAAU,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAA;YAC5D,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,CAAA;QAC3B,CAAC,CAAA;IACH,CAAC;;AAnFM,4CAAU,GAAG,iBAAiB,AAApB,CAAoB"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type Client } from '../../../../lib/seam/connect/client.js';
|
|
2
|
+
import { type SeamHttpRequestOptions, type SeamHttpWithoutWorkspaceOptions, type SeamHttpWithoutWorkspaceOptionsWithClient, type SeamHttpWithoutWorkspaceOptionsWithConsoleSessionToken, type SeamHttpWithoutWorkspaceOptionsWithPersonalAccessToken } from '../../../../lib/seam/connect/options.js';
|
|
3
|
+
import { SeamHttpWorkspaces } from '../../../../lib/seam/connect/routes/workspaces/index.js';
|
|
4
|
+
export declare class SeamHttpWithoutWorkspace {
|
|
5
|
+
client: Client;
|
|
6
|
+
readonly defaults: Required<SeamHttpRequestOptions>;
|
|
7
|
+
readonly ltsVersion = "1.0.0";
|
|
8
|
+
static ltsVersion: string;
|
|
9
|
+
constructor(options?: SeamHttpWithoutWorkspaceOptions);
|
|
10
|
+
static fromClient(client: SeamHttpWithoutWorkspaceOptionsWithClient['client'], options?: Omit<SeamHttpWithoutWorkspaceOptionsWithClient, 'client'>): SeamHttpWithoutWorkspace;
|
|
11
|
+
static fromConsoleSessionToken(consoleSessionToken: SeamHttpWithoutWorkspaceOptionsWithConsoleSessionToken['consoleSessionToken'], options?: Omit<SeamHttpWithoutWorkspaceOptionsWithConsoleSessionToken, 'consoleSessionToken'>): SeamHttpWithoutWorkspace;
|
|
12
|
+
static fromPersonalAccessToken(personalAccessToken: SeamHttpWithoutWorkspaceOptionsWithPersonalAccessToken['personalAccessToken'], options?: Omit<SeamHttpWithoutWorkspaceOptionsWithPersonalAccessToken, 'personalAccessToken'>): SeamHttpWithoutWorkspace;
|
|
13
|
+
get workspaces(): Pick<SeamHttpWorkspaces, 'create' | 'list'>;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* @deprecated Use SeamHttpWithoutWorkspace instead.
|
|
17
|
+
*/
|
|
18
|
+
export declare const SeamHttpMultiWorkspace: typeof SeamHttpWithoutWorkspace;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Automatically generated by codegen/smith.ts.
|
|
3
|
+
* Do not edit this file or add other files to this directory.
|
|
4
|
+
*/
|
|
5
|
+
import { seamApiLtsVersion } from '../../../../lib/lts-version.js';
|
|
6
|
+
import { createClient } from '../../../../lib/seam/connect/client.js';
|
|
7
|
+
import { isSeamHttpWithoutWorkspaceOptionsWithClient, isSeamHttpWithoutWorkspaceOptionsWithConsoleSessionToken, isSeamHttpWithoutWorkspaceOptionsWithPersonalAccessToken, SeamHttpWithoutWorkspaceInvalidOptionsError, } from '../../../../lib/seam/connect/options.js';
|
|
8
|
+
import { limitToSeamHttpRequestOptions, parseOptions, } from '../../../../lib/seam/connect/parse-options.js';
|
|
9
|
+
import { SeamHttpWorkspaces } from '../../../../lib/seam/connect/routes/workspaces/index.js';
|
|
10
|
+
export class SeamHttpWithoutWorkspace {
|
|
11
|
+
constructor(options = {}) {
|
|
12
|
+
this.ltsVersion = seamApiLtsVersion;
|
|
13
|
+
const opts = parseOptions(options);
|
|
14
|
+
this.client = 'client' in opts ? opts.client : createClient(opts);
|
|
15
|
+
this.defaults = limitToSeamHttpRequestOptions(opts);
|
|
16
|
+
}
|
|
17
|
+
static fromClient(client, options = {}) {
|
|
18
|
+
const constructorOptions = { ...options, client };
|
|
19
|
+
if (!isSeamHttpWithoutWorkspaceOptionsWithClient(constructorOptions)) {
|
|
20
|
+
throw new SeamHttpWithoutWorkspaceInvalidOptionsError('Missing client');
|
|
21
|
+
}
|
|
22
|
+
return new SeamHttpWithoutWorkspace(constructorOptions);
|
|
23
|
+
}
|
|
24
|
+
static fromConsoleSessionToken(consoleSessionToken, options = {}) {
|
|
25
|
+
const constructorOptions = { ...options, consoleSessionToken };
|
|
26
|
+
if (!isSeamHttpWithoutWorkspaceOptionsWithConsoleSessionToken(constructorOptions)) {
|
|
27
|
+
throw new SeamHttpWithoutWorkspaceInvalidOptionsError('Missing consoleSessionToken');
|
|
28
|
+
}
|
|
29
|
+
return new SeamHttpWithoutWorkspace(constructorOptions);
|
|
30
|
+
}
|
|
31
|
+
static fromPersonalAccessToken(personalAccessToken, options = {}) {
|
|
32
|
+
const constructorOptions = { ...options, personalAccessToken };
|
|
33
|
+
if (!isSeamHttpWithoutWorkspaceOptionsWithPersonalAccessToken(constructorOptions)) {
|
|
34
|
+
throw new SeamHttpWithoutWorkspaceInvalidOptionsError('Missing personalAccessToken');
|
|
35
|
+
}
|
|
36
|
+
return new SeamHttpWithoutWorkspace(constructorOptions);
|
|
37
|
+
}
|
|
38
|
+
get workspaces() {
|
|
39
|
+
return SeamHttpWorkspaces.fromClient(this.client, this.defaults);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
SeamHttpWithoutWorkspace.ltsVersion = seamApiLtsVersion;
|
|
43
|
+
/**
|
|
44
|
+
* @deprecated Use SeamHttpWithoutWorkspace instead.
|
|
45
|
+
*/
|
|
46
|
+
export const SeamHttpMultiWorkspace = SeamHttpWithoutWorkspace;
|
|
47
|
+
//# sourceMappingURL=seam-http-without-workspace.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"seam-http-without-workspace.js","sourceRoot":"","sources":["../../../../src/lib/seam/connect/routes/seam-http-without-workspace.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AACtD,OAAO,EAAe,YAAY,EAAE,MAAM,4BAA4B,CAAA;AACtE,OAAO,EACL,2CAA2C,EAC3C,wDAAwD,EACxD,wDAAwD,EAExD,2CAA2C,GAK5C,MAAM,6BAA6B,CAAA;AACpC,OAAO,EACL,6BAA6B,EAC7B,YAAY,GACb,MAAM,mCAAmC,CAAA;AAC1C,OAAO,EAAE,kBAAkB,EAAE,MAAM,6CAA6C,CAAA;AAEhF,MAAM,OAAO,wBAAwB;IAMnC,YAAY,UAA2C,EAAE;QAHhD,eAAU,GAAG,iBAAiB,CAAA;QAIrC,MAAM,IAAI,GAAG,YAAY,CAAC,OAAO,CAAC,CAAA;QAClC,IAAI,CAAC,MAAM,GAAG,QAAQ,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,YAAY,CAAC,IAAI,CAAC,CAAA;QACjE,IAAI,CAAC,QAAQ,GAAG,6BAA6B,CAAC,IAAI,CAAC,CAAA;IACrD,CAAC;IAED,MAAM,CAAC,UAAU,CACf,MAA2D,EAC3D,UAAqE,EAAE;QAEvE,MAAM,kBAAkB,GAAG,EAAE,GAAG,OAAO,EAAE,MAAM,EAAE,CAAA;QACjD,IAAI,CAAC,2CAA2C,CAAC,kBAAkB,CAAC,EAAE,CAAC;YACrE,MAAM,IAAI,2CAA2C,CAAC,gBAAgB,CAAC,CAAA;QACzE,CAAC;QACD,OAAO,IAAI,wBAAwB,CAAC,kBAAkB,CAAC,CAAA;IACzD,CAAC;IAED,MAAM,CAAC,uBAAuB,CAC5B,mBAAkG,EAClG,UAGI,EAAE;QAEN,MAAM,kBAAkB,GAAG,EAAE,GAAG,OAAO,EAAE,mBAAmB,EAAE,CAAA;QAC9D,IACE,CAAC,wDAAwD,CACvD,kBAAkB,CACnB,EACD,CAAC;YACD,MAAM,IAAI,2CAA2C,CACnD,6BAA6B,CAC9B,CAAA;QACH,CAAC;QACD,OAAO,IAAI,wBAAwB,CAAC,kBAAkB,CAAC,CAAA;IACzD,CAAC;IAED,MAAM,CAAC,uBAAuB,CAC5B,mBAAkG,EAClG,UAGI,EAAE;QAEN,MAAM,kBAAkB,GAAG,EAAE,GAAG,OAAO,EAAE,mBAAmB,EAAE,CAAA;QAC9D,IACE,CAAC,wDAAwD,CACvD,kBAAkB,CACnB,EACD,CAAC;YACD,MAAM,IAAI,2CAA2C,CACnD,6BAA6B,CAC9B,CAAA;QACH,CAAC;QACD,OAAO,IAAI,wBAAwB,CAAC,kBAAkB,CAAC,CAAA;IACzD,CAAC;IAED,IAAI,UAAU;QACZ,OAAO,kBAAkB,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAA;IAClE,CAAC;;AA7DM,mCAAU,GAAG,iBAAiB,AAApB,CAAoB;AAgEvC;;GAEG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,wBAAwB,CAAA"}
|
package/lib/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const seamapiJavascriptHttpVersion = "1.
|
|
1
|
+
declare const seamapiJavascriptHttpVersion = "1.40.0";
|
|
2
2
|
export default seamapiJavascriptHttpVersion;
|
package/lib/version.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@seamapi/http",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.40.0",
|
|
4
4
|
"description": "JavaScript HTTP client for the Seam API written in TypeScript.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|
|
@@ -98,7 +98,7 @@
|
|
|
98
98
|
"axios-retry": "^4.4.2"
|
|
99
99
|
},
|
|
100
100
|
"devDependencies": {
|
|
101
|
-
"@seamapi/blueprint": "^0.51.
|
|
101
|
+
"@seamapi/blueprint": "^0.51.1",
|
|
102
102
|
"@seamapi/fake-seam-connect": "^1.77.0",
|
|
103
103
|
"@seamapi/smith": "^0.4.4",
|
|
104
104
|
"@seamapi/types": "1.420.2",
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
|
-
isSeamHttpMultiWorkspaceOptionsWithConsoleSessionToken,
|
|
3
|
-
isSeamHttpMultiWorkspaceOptionsWithPersonalAccessToken,
|
|
4
2
|
isSeamHttpOptionsWithApiKey,
|
|
5
3
|
isSeamHttpOptionsWithClientSessionToken,
|
|
6
4
|
isSeamHttpOptionsWithConsoleSessionToken,
|
|
7
5
|
isSeamHttpOptionsWithPersonalAccessToken,
|
|
6
|
+
isSeamHttpWithoutWorkspaceOptionsWithConsoleSessionToken,
|
|
7
|
+
isSeamHttpWithoutWorkspaceOptionsWithPersonalAccessToken,
|
|
8
8
|
SeamHttpInvalidOptionsError,
|
|
9
|
-
type SeamHttpMultiWorkspaceOptionsWithConsoleSessionToken,
|
|
10
|
-
type SeamHttpMultiWorkspaceOptionsWithPersonalAccessToken,
|
|
11
9
|
type SeamHttpOptionsWithApiKey,
|
|
12
10
|
type SeamHttpOptionsWithClientSessionToken,
|
|
13
11
|
type SeamHttpOptionsWithConsoleSessionToken,
|
|
14
12
|
type SeamHttpOptionsWithPersonalAccessToken,
|
|
13
|
+
type SeamHttpWithoutWorkspaceOptionsWithConsoleSessionToken,
|
|
14
|
+
type SeamHttpWithoutWorkspaceOptionsWithPersonalAccessToken,
|
|
15
15
|
} from './options.js'
|
|
16
16
|
import type { Options } from './parse-options.js'
|
|
17
17
|
import {
|
|
@@ -43,14 +43,14 @@ export const getAuthHeaders = (options: Options): Headers => {
|
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
if (
|
|
46
|
-
|
|
46
|
+
isSeamHttpWithoutWorkspaceOptionsWithConsoleSessionToken(options) ||
|
|
47
47
|
isSeamHttpOptionsWithConsoleSessionToken(options)
|
|
48
48
|
) {
|
|
49
49
|
return getAuthHeadersForConsoleSessionToken(options)
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
if (
|
|
53
|
-
|
|
53
|
+
isSeamHttpWithoutWorkspaceOptionsWithPersonalAccessToken(options) ||
|
|
54
54
|
isSeamHttpOptionsWithPersonalAccessToken(options)
|
|
55
55
|
) {
|
|
56
56
|
return getAuthHeadersForPersonalAccessToken(options)
|
|
@@ -142,7 +142,7 @@ const getAuthHeadersForConsoleSessionToken = ({
|
|
|
142
142
|
consoleSessionToken,
|
|
143
143
|
...options
|
|
144
144
|
}:
|
|
145
|
-
|
|
|
145
|
+
| SeamHttpWithoutWorkspaceOptionsWithConsoleSessionToken
|
|
146
146
|
| SeamHttpOptionsWithConsoleSessionToken): Headers => {
|
|
147
147
|
const workspaceId = 'workspaceId' in options ? options.workspaceId : undefined
|
|
148
148
|
|
|
@@ -180,7 +180,7 @@ const getAuthHeadersForPersonalAccessToken = ({
|
|
|
180
180
|
personalAccessToken,
|
|
181
181
|
...options
|
|
182
182
|
}:
|
|
183
|
-
|
|
|
183
|
+
| SeamHttpWithoutWorkspaceOptionsWithPersonalAccessToken
|
|
184
184
|
| SeamHttpOptionsWithPersonalAccessToken): Headers => {
|
|
185
185
|
const workspaceId = 'workspaceId' in options ? options.workspaceId : undefined
|
|
186
186
|
|
|
@@ -12,7 +12,6 @@ export {
|
|
|
12
12
|
} from './resolve-action-attempt.js'
|
|
13
13
|
export * from './routes/index.js'
|
|
14
14
|
export * from './seam-http-error.js'
|
|
15
|
-
export * from './seam-http-multi-workspace.js'
|
|
16
15
|
export * from './seam-http-request.js'
|
|
17
16
|
export * from './seam-paginator.js'
|
|
18
17
|
export * from './seam-paginator.js'
|
|
@@ -2,11 +2,11 @@ import type { Client, ClientOptions } from './client.js'
|
|
|
2
2
|
import { isSeamHttpRequestOption } from './parse-options.js'
|
|
3
3
|
import type { ResolveActionAttemptOptions } from './resolve-action-attempt.js'
|
|
4
4
|
|
|
5
|
-
export type
|
|
6
|
-
|
|
|
7
|
-
|
|
|
8
|
-
|
|
|
9
|
-
|
|
|
5
|
+
export type SeamHttpWithoutWorkspaceOptions =
|
|
6
|
+
| SeamHttpWithoutWorkspaceOptionsFromEnv
|
|
7
|
+
| SeamHttpWithoutWorkspaceOptionsWithClient
|
|
8
|
+
| SeamHttpWithoutWorkspaceOptionsWithConsoleSessionToken
|
|
9
|
+
| SeamHttpWithoutWorkspaceOptionsWithPersonalAccessToken
|
|
10
10
|
|
|
11
11
|
export type SeamHttpOptions =
|
|
12
12
|
| SeamHttpOptionsFromEnv
|
|
@@ -30,17 +30,17 @@ export interface SeamHttpFromPublishableKeyOptions
|
|
|
30
30
|
|
|
31
31
|
export interface SeamHttpOptionsFromEnv extends SeamHttpCommonOptions {}
|
|
32
32
|
|
|
33
|
-
export interface
|
|
33
|
+
export interface SeamHttpWithoutWorkspaceOptionsFromEnv
|
|
34
34
|
extends SeamHttpCommonOptions {}
|
|
35
35
|
|
|
36
|
-
export interface
|
|
36
|
+
export interface SeamHttpWithoutWorkspaceOptionsWithClient
|
|
37
37
|
extends SeamHttpCommonOptions {
|
|
38
38
|
client: Client
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
export const
|
|
41
|
+
export const isSeamHttpWithoutWorkspaceOptionsWithClient = (
|
|
42
42
|
options: SeamHttpOptions,
|
|
43
|
-
): options is
|
|
43
|
+
): options is SeamHttpWithoutWorkspaceOptionsWithClient =>
|
|
44
44
|
isSeamHttpOptionsWithClient(options)
|
|
45
45
|
|
|
46
46
|
export interface SeamHttpOptionsWithClient extends SeamHttpRequestOptions {
|
|
@@ -128,14 +128,14 @@ export const isSeamHttpOptionsWithClientSessionToken = (
|
|
|
128
128
|
return true
|
|
129
129
|
}
|
|
130
130
|
|
|
131
|
-
export interface
|
|
131
|
+
export interface SeamHttpWithoutWorkspaceOptionsWithConsoleSessionToken
|
|
132
132
|
extends SeamHttpCommonOptions {
|
|
133
133
|
consoleSessionToken: string
|
|
134
134
|
}
|
|
135
135
|
|
|
136
|
-
export const
|
|
136
|
+
export const isSeamHttpWithoutWorkspaceOptionsWithConsoleSessionToken = (
|
|
137
137
|
options: SeamHttpOptions,
|
|
138
|
-
): options is
|
|
138
|
+
): options is SeamHttpWithoutWorkspaceOptionsWithConsoleSessionToken => {
|
|
139
139
|
if (!('consoleSessionToken' in options)) return false
|
|
140
140
|
if (options.consoleSessionToken == null) return false
|
|
141
141
|
|
|
@@ -169,7 +169,7 @@ export interface SeamHttpOptionsWithConsoleSessionToken
|
|
|
169
169
|
export const isSeamHttpOptionsWithConsoleSessionToken = (
|
|
170
170
|
options: SeamHttpOptions,
|
|
171
171
|
): options is SeamHttpOptionsWithConsoleSessionToken => {
|
|
172
|
-
if (!
|
|
172
|
+
if (!isSeamHttpWithoutWorkspaceOptionsWithConsoleSessionToken(options)) {
|
|
173
173
|
return false
|
|
174
174
|
}
|
|
175
175
|
|
|
@@ -182,14 +182,14 @@ export const isSeamHttpOptionsWithConsoleSessionToken = (
|
|
|
182
182
|
return true
|
|
183
183
|
}
|
|
184
184
|
|
|
185
|
-
export interface
|
|
185
|
+
export interface SeamHttpWithoutWorkspaceOptionsWithPersonalAccessToken
|
|
186
186
|
extends SeamHttpCommonOptions {
|
|
187
187
|
personalAccessToken: string
|
|
188
188
|
}
|
|
189
189
|
|
|
190
|
-
export const
|
|
190
|
+
export const isSeamHttpWithoutWorkspaceOptionsWithPersonalAccessToken = (
|
|
191
191
|
options: SeamHttpOptions,
|
|
192
|
-
): options is
|
|
192
|
+
): options is SeamHttpWithoutWorkspaceOptionsWithPersonalAccessToken => {
|
|
193
193
|
if (!('personalAccessToken' in options)) return false
|
|
194
194
|
if (options.personalAccessToken == null) return false
|
|
195
195
|
|
|
@@ -223,7 +223,7 @@ export interface SeamHttpOptionsWithPersonalAccessToken
|
|
|
223
223
|
export const isSeamHttpOptionsWithPersonalAccessToken = (
|
|
224
224
|
options: SeamHttpOptions,
|
|
225
225
|
): options is SeamHttpOptionsWithPersonalAccessToken => {
|
|
226
|
-
if (!
|
|
226
|
+
if (!isSeamHttpWithoutWorkspaceOptionsWithPersonalAccessToken(options)) {
|
|
227
227
|
return false
|
|
228
228
|
}
|
|
229
229
|
|
|
@@ -243,9 +243,9 @@ export class SeamHttpInvalidOptionsError extends Error {
|
|
|
243
243
|
}
|
|
244
244
|
}
|
|
245
245
|
|
|
246
|
-
export class
|
|
246
|
+
export class SeamHttpWithoutWorkspaceInvalidOptionsError extends Error {
|
|
247
247
|
constructor(message: string) {
|
|
248
|
-
super(`
|
|
248
|
+
super(`SeamHttpWithoutWorkspace received invalid options: ${message}`)
|
|
249
249
|
this.name = this.constructor.name
|
|
250
250
|
}
|
|
251
251
|
}
|
|
@@ -4,13 +4,13 @@ import version from 'lib/version.js'
|
|
|
4
4
|
import { getAuthHeaders } from './auth.js'
|
|
5
5
|
import type { Client, ClientOptions } from './client.js'
|
|
6
6
|
import {
|
|
7
|
-
isSeamHttpMultiWorkspaceOptionsWithClient,
|
|
8
7
|
isSeamHttpOptionsWithClient,
|
|
9
8
|
isSeamHttpOptionsWithClientSessionToken,
|
|
9
|
+
isSeamHttpWithoutWorkspaceOptionsWithClient,
|
|
10
10
|
SeamHttpInvalidOptionsError,
|
|
11
|
-
type SeamHttpMultiWorkspaceOptions,
|
|
12
11
|
type SeamHttpOptions,
|
|
13
12
|
type SeamHttpRequestOptions,
|
|
13
|
+
type SeamHttpWithoutWorkspaceOptions,
|
|
14
14
|
} from './options.js'
|
|
15
15
|
|
|
16
16
|
export const defaultEndpoint = 'https://connect.getseam.com'
|
|
@@ -22,7 +22,7 @@ export const sdkHeaders = {
|
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
export type Options =
|
|
25
|
-
|
|
|
25
|
+
| SeamHttpWithoutWorkspaceOptions
|
|
26
26
|
| (SeamHttpOptions & { publishableKey?: string })
|
|
27
27
|
|
|
28
28
|
type ParsedOptions = Required<
|
|
@@ -35,7 +35,7 @@ export const parseOptions = (
|
|
|
35
35
|
const options = getNormalizedOptions(apiKeyOrOptions)
|
|
36
36
|
|
|
37
37
|
if (isSeamHttpOptionsWithClient(options)) return options
|
|
38
|
-
if (
|
|
38
|
+
if (isSeamHttpWithoutWorkspaceOptionsWithClient(options)) return options
|
|
39
39
|
|
|
40
40
|
return {
|
|
41
41
|
...options,
|
|
@@ -21,6 +21,8 @@ export * from './phones/index.js'
|
|
|
21
21
|
export * from './seam/index.js'
|
|
22
22
|
export * from './seam-http.js'
|
|
23
23
|
export * from './seam-http-endpoints.js'
|
|
24
|
+
export * from './seam-http-endpoints-without-workspace.js'
|
|
25
|
+
export * from './seam-http-without-workspace.js'
|
|
24
26
|
export * from './spaces/index.js'
|
|
25
27
|
export * from './thermostats/index.js'
|
|
26
28
|
export * from './unstable-access-grants/index.js'
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Automatically generated by codegen/smith.ts.
|
|
3
|
+
* Do not edit this file or add other files to this directory.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { seamApiLtsVersion } from 'lib/lts-version.js'
|
|
7
|
+
import { type Client, createClient } from 'lib/seam/connect/client.js'
|
|
8
|
+
import {
|
|
9
|
+
isSeamHttpWithoutWorkspaceOptionsWithClient,
|
|
10
|
+
isSeamHttpWithoutWorkspaceOptionsWithConsoleSessionToken,
|
|
11
|
+
isSeamHttpWithoutWorkspaceOptionsWithPersonalAccessToken,
|
|
12
|
+
type SeamHttpRequestOptions,
|
|
13
|
+
SeamHttpWithoutWorkspaceInvalidOptionsError,
|
|
14
|
+
type SeamHttpWithoutWorkspaceOptions,
|
|
15
|
+
type SeamHttpWithoutWorkspaceOptionsWithClient,
|
|
16
|
+
type SeamHttpWithoutWorkspaceOptionsWithConsoleSessionToken,
|
|
17
|
+
type SeamHttpWithoutWorkspaceOptionsWithPersonalAccessToken,
|
|
18
|
+
} from 'lib/seam/connect/options.js'
|
|
19
|
+
import {
|
|
20
|
+
limitToSeamHttpRequestOptions,
|
|
21
|
+
parseOptions,
|
|
22
|
+
} from 'lib/seam/connect/parse-options.js'
|
|
23
|
+
|
|
24
|
+
import {
|
|
25
|
+
SeamHttpWorkspaces,
|
|
26
|
+
type WorkspacesCreateOptions,
|
|
27
|
+
type WorkspacesCreateParameters,
|
|
28
|
+
type WorkspacesCreateRequest,
|
|
29
|
+
type WorkspacesListOptions,
|
|
30
|
+
type WorkspacesListParameters,
|
|
31
|
+
type WorkspacesListRequest,
|
|
32
|
+
} from './workspaces/index.js'
|
|
33
|
+
|
|
34
|
+
export class SeamHttpEndpointsWithoutWorkspace {
|
|
35
|
+
client: Client
|
|
36
|
+
readonly defaults: Required<SeamHttpRequestOptions>
|
|
37
|
+
readonly ltsVersion = seamApiLtsVersion
|
|
38
|
+
static ltsVersion = seamApiLtsVersion
|
|
39
|
+
|
|
40
|
+
constructor(options: SeamHttpWithoutWorkspaceOptions = {}) {
|
|
41
|
+
const opts = parseOptions(options)
|
|
42
|
+
this.client = 'client' in opts ? opts.client : createClient(opts)
|
|
43
|
+
this.defaults = limitToSeamHttpRequestOptions(opts)
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
static fromClient(
|
|
47
|
+
client: SeamHttpWithoutWorkspaceOptionsWithClient['client'],
|
|
48
|
+
options: Omit<SeamHttpWithoutWorkspaceOptionsWithClient, 'client'> = {},
|
|
49
|
+
): SeamHttpEndpointsWithoutWorkspace {
|
|
50
|
+
const constructorOptions = { ...options, client }
|
|
51
|
+
if (!isSeamHttpWithoutWorkspaceOptionsWithClient(constructorOptions)) {
|
|
52
|
+
throw new SeamHttpWithoutWorkspaceInvalidOptionsError('Missing client')
|
|
53
|
+
}
|
|
54
|
+
return new SeamHttpEndpointsWithoutWorkspace(constructorOptions)
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
static fromConsoleSessionToken(
|
|
58
|
+
consoleSessionToken: SeamHttpWithoutWorkspaceOptionsWithConsoleSessionToken['consoleSessionToken'],
|
|
59
|
+
options: Omit<
|
|
60
|
+
SeamHttpWithoutWorkspaceOptionsWithConsoleSessionToken,
|
|
61
|
+
'consoleSessionToken'
|
|
62
|
+
> = {},
|
|
63
|
+
): SeamHttpEndpointsWithoutWorkspace {
|
|
64
|
+
const constructorOptions = { ...options, consoleSessionToken }
|
|
65
|
+
if (
|
|
66
|
+
!isSeamHttpWithoutWorkspaceOptionsWithConsoleSessionToken(
|
|
67
|
+
constructorOptions,
|
|
68
|
+
)
|
|
69
|
+
) {
|
|
70
|
+
throw new SeamHttpWithoutWorkspaceInvalidOptionsError(
|
|
71
|
+
'Missing consoleSessionToken',
|
|
72
|
+
)
|
|
73
|
+
}
|
|
74
|
+
return new SeamHttpEndpointsWithoutWorkspace(constructorOptions)
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
static fromPersonalAccessToken(
|
|
78
|
+
personalAccessToken: SeamHttpWithoutWorkspaceOptionsWithPersonalAccessToken['personalAccessToken'],
|
|
79
|
+
options: Omit<
|
|
80
|
+
SeamHttpWithoutWorkspaceOptionsWithPersonalAccessToken,
|
|
81
|
+
'personalAccessToken'
|
|
82
|
+
> = {},
|
|
83
|
+
): SeamHttpEndpointsWithoutWorkspace {
|
|
84
|
+
const constructorOptions = { ...options, personalAccessToken }
|
|
85
|
+
if (
|
|
86
|
+
!isSeamHttpWithoutWorkspaceOptionsWithPersonalAccessToken(
|
|
87
|
+
constructorOptions,
|
|
88
|
+
)
|
|
89
|
+
) {
|
|
90
|
+
throw new SeamHttpWithoutWorkspaceInvalidOptionsError(
|
|
91
|
+
'Missing personalAccessToken',
|
|
92
|
+
)
|
|
93
|
+
}
|
|
94
|
+
return new SeamHttpEndpointsWithoutWorkspace(constructorOptions)
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
get ['/workspaces/create'](): (
|
|
98
|
+
parameters?: WorkspacesCreateParameters,
|
|
99
|
+
options?: WorkspacesCreateOptions,
|
|
100
|
+
) => WorkspacesCreateRequest {
|
|
101
|
+
const { client, defaults } = this
|
|
102
|
+
return function workspacesCreate(
|
|
103
|
+
...args: Parameters<SeamHttpWorkspaces['create']>
|
|
104
|
+
): ReturnType<SeamHttpWorkspaces['create']> {
|
|
105
|
+
const seam = SeamHttpWorkspaces.fromClient(client, defaults)
|
|
106
|
+
return seam.create(...args)
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
get ['/workspaces/list'](): (
|
|
111
|
+
parameters?: WorkspacesListParameters,
|
|
112
|
+
options?: WorkspacesListOptions,
|
|
113
|
+
) => WorkspacesListRequest {
|
|
114
|
+
const { client, defaults } = this
|
|
115
|
+
return function workspacesList(
|
|
116
|
+
...args: Parameters<SeamHttpWorkspaces['list']>
|
|
117
|
+
): ReturnType<SeamHttpWorkspaces['list']> {
|
|
118
|
+
const seam = SeamHttpWorkspaces.fromClient(client, defaults)
|
|
119
|
+
return seam.list(...args)
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
export type SeamHttpEndpointWithoutWorkspaceQueryPaths = '/workspaces/list'
|
|
125
|
+
|
|
126
|
+
export type SeamHttpEndpointWithoutWorkspaceMutationPaths = '/workspaces/create'
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Automatically generated by codegen/smith.ts.
|
|
3
|
+
* Do not edit this file or add other files to this directory.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { seamApiLtsVersion } from 'lib/lts-version.js'
|
|
7
|
+
import { type Client, createClient } from 'lib/seam/connect/client.js'
|
|
8
|
+
import {
|
|
9
|
+
isSeamHttpWithoutWorkspaceOptionsWithClient,
|
|
10
|
+
isSeamHttpWithoutWorkspaceOptionsWithConsoleSessionToken,
|
|
11
|
+
isSeamHttpWithoutWorkspaceOptionsWithPersonalAccessToken,
|
|
12
|
+
type SeamHttpRequestOptions,
|
|
13
|
+
SeamHttpWithoutWorkspaceInvalidOptionsError,
|
|
14
|
+
type SeamHttpWithoutWorkspaceOptions,
|
|
15
|
+
type SeamHttpWithoutWorkspaceOptionsWithClient,
|
|
16
|
+
type SeamHttpWithoutWorkspaceOptionsWithConsoleSessionToken,
|
|
17
|
+
type SeamHttpWithoutWorkspaceOptionsWithPersonalAccessToken,
|
|
18
|
+
} from 'lib/seam/connect/options.js'
|
|
19
|
+
import {
|
|
20
|
+
limitToSeamHttpRequestOptions,
|
|
21
|
+
parseOptions,
|
|
22
|
+
} from 'lib/seam/connect/parse-options.js'
|
|
23
|
+
import { SeamHttpWorkspaces } from 'lib/seam/connect/routes/workspaces/index.js'
|
|
24
|
+
|
|
25
|
+
export class SeamHttpWithoutWorkspace {
|
|
26
|
+
client: Client
|
|
27
|
+
readonly defaults: Required<SeamHttpRequestOptions>
|
|
28
|
+
readonly ltsVersion = seamApiLtsVersion
|
|
29
|
+
static ltsVersion = seamApiLtsVersion
|
|
30
|
+
|
|
31
|
+
constructor(options: SeamHttpWithoutWorkspaceOptions = {}) {
|
|
32
|
+
const opts = parseOptions(options)
|
|
33
|
+
this.client = 'client' in opts ? opts.client : createClient(opts)
|
|
34
|
+
this.defaults = limitToSeamHttpRequestOptions(opts)
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
static fromClient(
|
|
38
|
+
client: SeamHttpWithoutWorkspaceOptionsWithClient['client'],
|
|
39
|
+
options: Omit<SeamHttpWithoutWorkspaceOptionsWithClient, 'client'> = {},
|
|
40
|
+
): SeamHttpWithoutWorkspace {
|
|
41
|
+
const constructorOptions = { ...options, client }
|
|
42
|
+
if (!isSeamHttpWithoutWorkspaceOptionsWithClient(constructorOptions)) {
|
|
43
|
+
throw new SeamHttpWithoutWorkspaceInvalidOptionsError('Missing client')
|
|
44
|
+
}
|
|
45
|
+
return new SeamHttpWithoutWorkspace(constructorOptions)
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
static fromConsoleSessionToken(
|
|
49
|
+
consoleSessionToken: SeamHttpWithoutWorkspaceOptionsWithConsoleSessionToken['consoleSessionToken'],
|
|
50
|
+
options: Omit<
|
|
51
|
+
SeamHttpWithoutWorkspaceOptionsWithConsoleSessionToken,
|
|
52
|
+
'consoleSessionToken'
|
|
53
|
+
> = {},
|
|
54
|
+
): SeamHttpWithoutWorkspace {
|
|
55
|
+
const constructorOptions = { ...options, consoleSessionToken }
|
|
56
|
+
if (
|
|
57
|
+
!isSeamHttpWithoutWorkspaceOptionsWithConsoleSessionToken(
|
|
58
|
+
constructorOptions,
|
|
59
|
+
)
|
|
60
|
+
) {
|
|
61
|
+
throw new SeamHttpWithoutWorkspaceInvalidOptionsError(
|
|
62
|
+
'Missing consoleSessionToken',
|
|
63
|
+
)
|
|
64
|
+
}
|
|
65
|
+
return new SeamHttpWithoutWorkspace(constructorOptions)
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
static fromPersonalAccessToken(
|
|
69
|
+
personalAccessToken: SeamHttpWithoutWorkspaceOptionsWithPersonalAccessToken['personalAccessToken'],
|
|
70
|
+
options: Omit<
|
|
71
|
+
SeamHttpWithoutWorkspaceOptionsWithPersonalAccessToken,
|
|
72
|
+
'personalAccessToken'
|
|
73
|
+
> = {},
|
|
74
|
+
): SeamHttpWithoutWorkspace {
|
|
75
|
+
const constructorOptions = { ...options, personalAccessToken }
|
|
76
|
+
if (
|
|
77
|
+
!isSeamHttpWithoutWorkspaceOptionsWithPersonalAccessToken(
|
|
78
|
+
constructorOptions,
|
|
79
|
+
)
|
|
80
|
+
) {
|
|
81
|
+
throw new SeamHttpWithoutWorkspaceInvalidOptionsError(
|
|
82
|
+
'Missing personalAccessToken',
|
|
83
|
+
)
|
|
84
|
+
}
|
|
85
|
+
return new SeamHttpWithoutWorkspace(constructorOptions)
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
get workspaces(): Pick<SeamHttpWorkspaces, 'create' | 'list'> {
|
|
89
|
+
return SeamHttpWorkspaces.fromClient(this.client, this.defaults)
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* @deprecated Use SeamHttpWithoutWorkspace instead.
|
|
95
|
+
*/
|
|
96
|
+
export const SeamHttpMultiWorkspace = SeamHttpWithoutWorkspace
|
package/src/lib/version.ts
CHANGED