@seamapi/http 0.7.0 → 0.7.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 +11 -32
- package/dist/connect.cjs +2 -2
- package/dist/connect.cjs.map +1 -1
- package/lib/seam/connect/{api-error-type.js → api-error-types.js} +1 -1
- package/lib/seam/connect/api-error-types.js.map +1 -0
- package/lib/seam/connect/auth.js +2 -2
- package/lib/seam/connect/auth.js.map +1 -1
- package/lib/seam/connect/seam-http-error.d.ts +1 -1
- 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 +2 -2
- package/src/lib/seam/connect/error-interceptor.ts +1 -1
- package/src/lib/seam/connect/seam-http-error.ts +1 -1
- package/src/lib/version.ts +1 -1
- package/lib/seam/connect/api-error-type.js.map +0 -1
- /package/lib/seam/connect/{api-error-type.d.ts → api-error-types.d.ts} +0 -0
- /package/src/lib/seam/connect/{api-error-type.ts → api-error-types.ts} +0 -0
package/README.md
CHANGED
|
@@ -59,27 +59,17 @@ or with the more ergonomic static factory methods.
|
|
|
59
59
|
An API key is scoped to a single workspace and should only be used on the server.
|
|
60
60
|
Obtain one from the Seam Console.
|
|
61
61
|
|
|
62
|
-
##### Set the `SEAM_API_KEY` environment variable
|
|
63
|
-
|
|
64
62
|
```ts
|
|
63
|
+
// Set the `SEAM_API_KEY` environment variable
|
|
65
64
|
const seam = new SeamHttp()
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
##### Pass as the first argument to the constructor
|
|
69
65
|
|
|
70
|
-
|
|
66
|
+
// Pass as the first argument to the constructor
|
|
71
67
|
const seam = new SeamHttp('your-api-key')
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
##### Pass as an option the constructor
|
|
75
68
|
|
|
76
|
-
|
|
69
|
+
// Pass as an option the constructor
|
|
77
70
|
const seam = new SeamHttp({ apiKey: 'your-api-key' })
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
##### Use the factory method
|
|
81
71
|
|
|
82
|
-
|
|
72
|
+
// Use the factory method
|
|
83
73
|
const seam = SeamHttp.fromApiKey('your-api-key')
|
|
84
74
|
```
|
|
85
75
|
|
|
@@ -87,15 +77,11 @@ const seam = SeamHttp.fromApiKey('your-api-key')
|
|
|
87
77
|
|
|
88
78
|
A Client Session Token is scoped to a client session and should only be used on the client.
|
|
89
79
|
|
|
90
|
-
##### Pass as an option the constructor
|
|
91
|
-
|
|
92
80
|
```ts
|
|
81
|
+
// Pass as an option the constructor
|
|
93
82
|
const seam = new SeamHttp({ clientSessionToken: 'some-client-session-token' })
|
|
94
|
-
```
|
|
95
83
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
```ts
|
|
84
|
+
// Use the factory method
|
|
99
85
|
const seam = SeamHttp.fromClientSessionToken('some-client-session-token')
|
|
100
86
|
```
|
|
101
87
|
|
|
@@ -123,18 +109,15 @@ Obtain one from the Seam Console.
|
|
|
123
109
|
A workspace id must be provided when using this method
|
|
124
110
|
and all requests will be scoped to that workspace.
|
|
125
111
|
|
|
126
|
-
##### Pass as an option the constructor
|
|
127
|
-
|
|
128
112
|
```ts
|
|
113
|
+
// Pass as an option the constructor
|
|
114
|
+
|
|
129
115
|
const seam = new SeamHttp({
|
|
130
116
|
personalAccessToken: 'your-personal-access-token',
|
|
131
117
|
workspaceId: 'your-workspace-id',
|
|
132
118
|
})
|
|
133
|
-
```
|
|
134
|
-
|
|
135
|
-
##### Use the factory method
|
|
136
119
|
|
|
137
|
-
|
|
120
|
+
// Use the factory method
|
|
138
121
|
const seam = SeamHttp.fromPersonalAccessToken(
|
|
139
122
|
'some-console-session-token',
|
|
140
123
|
'your-workspace-id',
|
|
@@ -148,18 +131,14 @@ This authentication method is only used by internal Seam applications.
|
|
|
148
131
|
A workspace id must be provided when using this method
|
|
149
132
|
and all requests will be scoped to that workspace.
|
|
150
133
|
|
|
151
|
-
##### Pass as an option the constructor
|
|
152
|
-
|
|
153
134
|
```ts
|
|
135
|
+
// Pass as an option the constructor
|
|
154
136
|
const seam = new SeamHttp({
|
|
155
137
|
consoleSessionToken: 'some-console-session-token',
|
|
156
138
|
workspaceId: 'your-workspace-id',
|
|
157
139
|
})
|
|
158
|
-
```
|
|
159
140
|
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
```ts
|
|
141
|
+
// Use the factory method
|
|
163
142
|
const seam = SeamHttp.fromConsoleSessionToken(
|
|
164
143
|
'some-console-session-token',
|
|
165
144
|
'your-workspace-id',
|
package/dist/connect.cjs
CHANGED
|
@@ -260,7 +260,7 @@ var getAuthHeadersForConsoleSessionToken = ({
|
|
|
260
260
|
}
|
|
261
261
|
return {
|
|
262
262
|
authorization: `Bearer ${consoleSessionToken}`,
|
|
263
|
-
...workspaceId != null ? { "seam-workspace
|
|
263
|
+
...workspaceId != null ? { "seam-workspace": workspaceId } : {}
|
|
264
264
|
};
|
|
265
265
|
};
|
|
266
266
|
var getAuthHeadersForPersonalAccessToken = ({
|
|
@@ -290,7 +290,7 @@ var getAuthHeadersForPersonalAccessToken = ({
|
|
|
290
290
|
}
|
|
291
291
|
return {
|
|
292
292
|
authorization: `Bearer ${personalAccessToken}`,
|
|
293
|
-
...workspaceId != null ? { "seam-workspace
|
|
293
|
+
...workspaceId != null ? { "seam-workspace": workspaceId } : {}
|
|
294
294
|
};
|
|
295
295
|
};
|
|
296
296
|
var getAuthHeadersForPublishableKey = (publishableKey) => {
|