@seamapi/http 1.39.1 → 1.40.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/README.md +8 -8
- package/dist/connect.cjs +86 -25
- package/dist/connect.cjs.map +1 -1
- package/dist/connect.d.cts +43 -22
- 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 -2
- package/lib/seam/connect/index.js +0 -2
- 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/seam/connect/seam-paginator.d.ts +2 -2
- 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 -2
- 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/seam/connect/seam-paginator.ts +3 -3
- 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
|
@@ -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
|
|
@@ -9,11 +9,11 @@ interface SeamPaginatorParent {
|
|
|
9
9
|
|
|
10
10
|
declare const $brand: unique symbol
|
|
11
11
|
|
|
12
|
-
type
|
|
12
|
+
export type SeamPageCursor = string & { [$brand]: 'SeamPageCursor' }
|
|
13
13
|
|
|
14
14
|
interface Pagination {
|
|
15
15
|
readonly hasNextPage: boolean
|
|
16
|
-
readonly nextPageCursor:
|
|
16
|
+
readonly nextPageCursor: SeamPageCursor | null
|
|
17
17
|
readonly nextPageUrl: string | null
|
|
18
18
|
}
|
|
19
19
|
|
|
@@ -150,6 +150,6 @@ type EnsureMutableArray<T> = T extends any[] ? T : never
|
|
|
150
150
|
|
|
151
151
|
interface PaginationData {
|
|
152
152
|
has_next_page: boolean
|
|
153
|
-
next_page_cursor:
|
|
153
|
+
next_page_cursor: SeamPageCursor | null
|
|
154
154
|
next_page_url: string | null
|
|
155
155
|
}
|
package/src/lib/version.ts
CHANGED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { type Client } from './client.js';
|
|
2
|
-
import { type SeamHttpMultiWorkspaceOptions, type SeamHttpMultiWorkspaceOptionsWithClient, type SeamHttpMultiWorkspaceOptionsWithConsoleSessionToken, type SeamHttpMultiWorkspaceOptionsWithPersonalAccessToken, type SeamHttpRequestOptions } from './options.js';
|
|
3
|
-
import { SeamHttpWorkspaces } from './routes/index.js';
|
|
4
|
-
export declare class SeamHttpMultiWorkspace {
|
|
5
|
-
client: Client;
|
|
6
|
-
readonly defaults: Required<SeamHttpRequestOptions>;
|
|
7
|
-
constructor(options?: SeamHttpMultiWorkspaceOptions);
|
|
8
|
-
static fromClient(client: SeamHttpMultiWorkspaceOptionsWithClient['client'], options?: Omit<SeamHttpMultiWorkspaceOptionsWithClient, 'client'>): SeamHttpMultiWorkspace;
|
|
9
|
-
static fromConsoleSessionToken(consoleSessionToken: SeamHttpMultiWorkspaceOptionsWithConsoleSessionToken['consoleSessionToken'], options?: Omit<SeamHttpMultiWorkspaceOptionsWithConsoleSessionToken, 'consoleSessionToken'>): SeamHttpMultiWorkspace;
|
|
10
|
-
static fromPersonalAccessToken(personalAccessToken: SeamHttpMultiWorkspaceOptionsWithPersonalAccessToken['personalAccessToken'], options?: Omit<SeamHttpMultiWorkspaceOptionsWithPersonalAccessToken, 'personalAccessToken'>): SeamHttpMultiWorkspace;
|
|
11
|
-
get workspaces(): Pick<SeamHttpWorkspaces, 'create' | 'list'>;
|
|
12
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { createClient } from './client.js';
|
|
2
|
-
import { isSeamHttpMultiWorkspaceOptionsWithClient, isSeamHttpMultiWorkspaceOptionsWithConsoleSessionToken, isSeamHttpMultiWorkspaceOptionsWithPersonalAccessToken, SeamHttpMultiWorkspaceInvalidOptionsError, } from './options.js';
|
|
3
|
-
import { limitToSeamHttpRequestOptions, parseOptions } from './parse-options.js';
|
|
4
|
-
import { SeamHttpWorkspaces } from './routes/index.js';
|
|
5
|
-
export class SeamHttpMultiWorkspace {
|
|
6
|
-
constructor(options = {}) {
|
|
7
|
-
const opts = parseOptions(options);
|
|
8
|
-
this.client = 'client' in opts ? opts.client : createClient(opts);
|
|
9
|
-
this.defaults = limitToSeamHttpRequestOptions(opts);
|
|
10
|
-
}
|
|
11
|
-
static fromClient(client, options = {}) {
|
|
12
|
-
const constructorOptions = { ...options, client };
|
|
13
|
-
if (!isSeamHttpMultiWorkspaceOptionsWithClient(constructorOptions)) {
|
|
14
|
-
throw new SeamHttpMultiWorkspaceInvalidOptionsError('Missing client');
|
|
15
|
-
}
|
|
16
|
-
return new SeamHttpMultiWorkspace(constructorOptions);
|
|
17
|
-
}
|
|
18
|
-
static fromConsoleSessionToken(consoleSessionToken, options = {}) {
|
|
19
|
-
const constructorOptions = { ...options, consoleSessionToken };
|
|
20
|
-
if (!isSeamHttpMultiWorkspaceOptionsWithConsoleSessionToken(constructorOptions)) {
|
|
21
|
-
throw new SeamHttpMultiWorkspaceInvalidOptionsError('Missing consoleSessionToken');
|
|
22
|
-
}
|
|
23
|
-
return new SeamHttpMultiWorkspace(constructorOptions);
|
|
24
|
-
}
|
|
25
|
-
static fromPersonalAccessToken(personalAccessToken, options = {}) {
|
|
26
|
-
const constructorOptions = { ...options, personalAccessToken };
|
|
27
|
-
if (!isSeamHttpMultiWorkspaceOptionsWithPersonalAccessToken(constructorOptions)) {
|
|
28
|
-
throw new SeamHttpMultiWorkspaceInvalidOptionsError('Missing personalAccessToken');
|
|
29
|
-
}
|
|
30
|
-
return new SeamHttpMultiWorkspace(constructorOptions);
|
|
31
|
-
}
|
|
32
|
-
get workspaces() {
|
|
33
|
-
return SeamHttpWorkspaces.fromClient(this.client, this.defaults);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
//# sourceMappingURL=seam-http-multi-workspace.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"seam-http-multi-workspace.js","sourceRoot":"","sources":["../../../src/lib/seam/connect/seam-http-multi-workspace.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,YAAY,EAAE,MAAM,aAAa,CAAA;AACvD,OAAO,EACL,yCAAyC,EACzC,sDAAsD,EACtD,sDAAsD,EACtD,yCAAyC,GAM1C,MAAM,cAAc,CAAA;AACrB,OAAO,EAAE,6BAA6B,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAChF,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AAEtD,MAAM,OAAO,sBAAsB;IAIjC,YAAY,UAAyC,EAAE;QACrD,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,MAAyD,EACzD,UAAmE,EAAE;QAErE,MAAM,kBAAkB,GAAG,EAAE,GAAG,OAAO,EAAE,MAAM,EAAE,CAAA;QACjD,IAAI,CAAC,yCAAyC,CAAC,kBAAkB,CAAC,EAAE,CAAC;YACnE,MAAM,IAAI,yCAAyC,CAAC,gBAAgB,CAAC,CAAA;QACvE,CAAC;QACD,OAAO,IAAI,sBAAsB,CAAC,kBAAkB,CAAC,CAAA;IACvD,CAAC;IAED,MAAM,CAAC,uBAAuB,CAC5B,mBAAgG,EAChG,UAGI,EAAE;QAEN,MAAM,kBAAkB,GAAG,EAAE,GAAG,OAAO,EAAE,mBAAmB,EAAE,CAAA;QAC9D,IACE,CAAC,sDAAsD,CACrD,kBAAkB,CACnB,EACD,CAAC;YACD,MAAM,IAAI,yCAAyC,CACjD,6BAA6B,CAC9B,CAAA;QACH,CAAC;QACD,OAAO,IAAI,sBAAsB,CAAC,kBAAkB,CAAC,CAAA;IACvD,CAAC;IAED,MAAM,CAAC,uBAAuB,CAC5B,mBAAgG,EAChG,UAGI,EAAE;QAEN,MAAM,kBAAkB,GAAG,EAAE,GAAG,OAAO,EAAE,mBAAmB,EAAE,CAAA;QAC9D,IACE,CAAC,sDAAsD,CACrD,kBAAkB,CACnB,EACD,CAAC;YACD,MAAM,IAAI,yCAAyC,CACjD,6BAA6B,CAC9B,CAAA;QACH,CAAC;QACD,OAAO,IAAI,sBAAsB,CAAC,kBAAkB,CAAC,CAAA;IACvD,CAAC;IAED,IAAI,UAAU;QACZ,OAAO,kBAAkB,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAA;IAClE,CAAC;CACF"}
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import { type Client, createClient } from './client.js'
|
|
2
|
-
import {
|
|
3
|
-
isSeamHttpMultiWorkspaceOptionsWithClient,
|
|
4
|
-
isSeamHttpMultiWorkspaceOptionsWithConsoleSessionToken,
|
|
5
|
-
isSeamHttpMultiWorkspaceOptionsWithPersonalAccessToken,
|
|
6
|
-
SeamHttpMultiWorkspaceInvalidOptionsError,
|
|
7
|
-
type SeamHttpMultiWorkspaceOptions,
|
|
8
|
-
type SeamHttpMultiWorkspaceOptionsWithClient,
|
|
9
|
-
type SeamHttpMultiWorkspaceOptionsWithConsoleSessionToken,
|
|
10
|
-
type SeamHttpMultiWorkspaceOptionsWithPersonalAccessToken,
|
|
11
|
-
type SeamHttpRequestOptions,
|
|
12
|
-
} from './options.js'
|
|
13
|
-
import { limitToSeamHttpRequestOptions, parseOptions } from './parse-options.js'
|
|
14
|
-
import { SeamHttpWorkspaces } from './routes/index.js'
|
|
15
|
-
|
|
16
|
-
export class SeamHttpMultiWorkspace {
|
|
17
|
-
client: Client
|
|
18
|
-
readonly defaults: Required<SeamHttpRequestOptions>
|
|
19
|
-
|
|
20
|
-
constructor(options: SeamHttpMultiWorkspaceOptions = {}) {
|
|
21
|
-
const opts = parseOptions(options)
|
|
22
|
-
this.client = 'client' in opts ? opts.client : createClient(opts)
|
|
23
|
-
this.defaults = limitToSeamHttpRequestOptions(opts)
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
static fromClient(
|
|
27
|
-
client: SeamHttpMultiWorkspaceOptionsWithClient['client'],
|
|
28
|
-
options: Omit<SeamHttpMultiWorkspaceOptionsWithClient, 'client'> = {},
|
|
29
|
-
): SeamHttpMultiWorkspace {
|
|
30
|
-
const constructorOptions = { ...options, client }
|
|
31
|
-
if (!isSeamHttpMultiWorkspaceOptionsWithClient(constructorOptions)) {
|
|
32
|
-
throw new SeamHttpMultiWorkspaceInvalidOptionsError('Missing client')
|
|
33
|
-
}
|
|
34
|
-
return new SeamHttpMultiWorkspace(constructorOptions)
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
static fromConsoleSessionToken(
|
|
38
|
-
consoleSessionToken: SeamHttpMultiWorkspaceOptionsWithConsoleSessionToken['consoleSessionToken'],
|
|
39
|
-
options: Omit<
|
|
40
|
-
SeamHttpMultiWorkspaceOptionsWithConsoleSessionToken,
|
|
41
|
-
'consoleSessionToken'
|
|
42
|
-
> = {},
|
|
43
|
-
): SeamHttpMultiWorkspace {
|
|
44
|
-
const constructorOptions = { ...options, consoleSessionToken }
|
|
45
|
-
if (
|
|
46
|
-
!isSeamHttpMultiWorkspaceOptionsWithConsoleSessionToken(
|
|
47
|
-
constructorOptions,
|
|
48
|
-
)
|
|
49
|
-
) {
|
|
50
|
-
throw new SeamHttpMultiWorkspaceInvalidOptionsError(
|
|
51
|
-
'Missing consoleSessionToken',
|
|
52
|
-
)
|
|
53
|
-
}
|
|
54
|
-
return new SeamHttpMultiWorkspace(constructorOptions)
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
static fromPersonalAccessToken(
|
|
58
|
-
personalAccessToken: SeamHttpMultiWorkspaceOptionsWithPersonalAccessToken['personalAccessToken'],
|
|
59
|
-
options: Omit<
|
|
60
|
-
SeamHttpMultiWorkspaceOptionsWithPersonalAccessToken,
|
|
61
|
-
'personalAccessToken'
|
|
62
|
-
> = {},
|
|
63
|
-
): SeamHttpMultiWorkspace {
|
|
64
|
-
const constructorOptions = { ...options, personalAccessToken }
|
|
65
|
-
if (
|
|
66
|
-
!isSeamHttpMultiWorkspaceOptionsWithPersonalAccessToken(
|
|
67
|
-
constructorOptions,
|
|
68
|
-
)
|
|
69
|
-
) {
|
|
70
|
-
throw new SeamHttpMultiWorkspaceInvalidOptionsError(
|
|
71
|
-
'Missing personalAccessToken',
|
|
72
|
-
)
|
|
73
|
-
}
|
|
74
|
-
return new SeamHttpMultiWorkspace(constructorOptions)
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
get workspaces(): Pick<SeamHttpWorkspaces, 'create' | 'list'> {
|
|
78
|
-
return SeamHttpWorkspaces.fromClient(this.client, this.defaults)
|
|
79
|
-
}
|
|
80
|
-
}
|