@settlemint/sdk-js 1.0.5-prbafc120d → 1.0.5-pre7d08cee
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 +17 -36
- package/dist/settlemint.cjs +2 -9
- package/dist/settlemint.cjs.map +1 -1
- package/dist/settlemint.d.cts +2 -9
- package/dist/settlemint.d.ts +2 -9
- package/dist/settlemint.mjs +2 -9
- package/dist/settlemint.mjs.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -32,7 +32,6 @@
|
|
|
32
32
|
- [createSettleMintClient()](#createsettlemintclient)
|
|
33
33
|
- [Interfaces](#interfaces)
|
|
34
34
|
- [SettlemintClient](#settlemintclient)
|
|
35
|
-
- [SettlemintClientOptions](#settlemintclientoptions)
|
|
36
35
|
- [Type Aliases](#type-aliases)
|
|
37
36
|
- [Application](#application)
|
|
38
37
|
- [BlockchainNetwork](#blockchainnetwork)
|
|
@@ -61,7 +60,7 @@ The SettleMint JavaScript SDK provides a type-safe wrapper around the SettleMint
|
|
|
61
60
|
|
|
62
61
|
> **createSettleMintClient**(`options`): [`SettlemintClient`](README.md#settlemintclient)
|
|
63
62
|
|
|
64
|
-
Defined in: [settlemint.ts:
|
|
63
|
+
Defined in: [sdk/js/src/settlemint.ts:201](https://github.com/settlemint/sdk/blob/v1.0.5/sdk/js/src/settlemint.ts#L201)
|
|
65
64
|
|
|
66
65
|
Creates a SettleMint client with the provided options. The client provides methods to interact with
|
|
67
66
|
various SettleMint resources like workspaces, applications, blockchain networks, blockchain nodes, middleware,
|
|
@@ -71,7 +70,9 @@ integration tools, storage, private keys, insights and custom deployments.
|
|
|
71
70
|
|
|
72
71
|
| Parameter | Type | Description |
|
|
73
72
|
| ------ | ------ | ------ |
|
|
74
|
-
| `options` |
|
|
73
|
+
| `options` | \{ `accessToken`: `string`; `instance`: `string`; \} | Configuration options for the client including access token and instance URL |
|
|
74
|
+
| `options.accessToken` | `string` | The access token used to authenticate with the SettleMint platform |
|
|
75
|
+
| `options.instance` | `string` | The URL of the SettleMint instance to connect to |
|
|
75
76
|
|
|
76
77
|
##### Returns
|
|
77
78
|
|
|
@@ -108,37 +109,17 @@ const workspace = await client.workspace.read('workspace-unique-name');
|
|
|
108
109
|
|
|
109
110
|
#### SettlemintClient
|
|
110
111
|
|
|
111
|
-
Defined in: [settlemint.ts:
|
|
112
|
+
Defined in: [sdk/js/src/settlemint.ts:101](https://github.com/settlemint/sdk/blob/v1.0.5/sdk/js/src/settlemint.ts#L101)
|
|
112
113
|
|
|
113
114
|
Client interface for interacting with the SettleMint platform.
|
|
114
115
|
|
|
115
|
-
***
|
|
116
|
-
|
|
117
|
-
#### SettlemintClientOptions
|
|
118
|
-
|
|
119
|
-
Defined in: [settlemint.ts:102](https://github.com/settlemint/sdk/blob/v1.0.5/sdk/js/src/settlemint.ts#L102)
|
|
120
|
-
|
|
121
|
-
Options for the Settlemint client.
|
|
122
|
-
|
|
123
|
-
##### Extends
|
|
124
|
-
|
|
125
|
-
- `ClientOptions`
|
|
126
|
-
|
|
127
|
-
##### Properties
|
|
128
|
-
|
|
129
|
-
| Property | Type | Default value | Description | Inherited from | Defined in |
|
|
130
|
-
| ------ | ------ | ------ | ------ | ------ | ------ |
|
|
131
|
-
| <a id="accesstoken"></a> `accessToken` | `string` | `AccessTokenSchema` | The access token used to authenticate with the SettleMint platform | `ClientOptions.accessToken` | [helpers/client-options.schema.ts:9](https://github.com/settlemint/sdk/blob/v1.0.5/sdk/js/src/helpers/client-options.schema.ts#L9) |
|
|
132
|
-
| <a id="anonymous"></a> `anonymous?` | `boolean` | `undefined` | Whether to allow anonymous access (no access token required) | - | [settlemint.ts:104](https://github.com/settlemint/sdk/blob/v1.0.5/sdk/js/src/settlemint.ts#L104) |
|
|
133
|
-
| <a id="instance"></a> `instance` | `string` | `UrlSchema` | The URL of the SettleMint instance to connect to | `ClientOptions.instance` | [helpers/client-options.schema.ts:11](https://github.com/settlemint/sdk/blob/v1.0.5/sdk/js/src/helpers/client-options.schema.ts#L11) |
|
|
134
|
-
|
|
135
116
|
### Type Aliases
|
|
136
117
|
|
|
137
118
|
#### Application
|
|
138
119
|
|
|
139
120
|
> **Application**: `ResultOf`\<*typeof* `ApplicationFragment`\>
|
|
140
121
|
|
|
141
|
-
Defined in: [graphql/application.ts:23](https://github.com/settlemint/sdk/blob/v1.0.5/sdk/js/src/graphql/application.ts#L23)
|
|
122
|
+
Defined in: [sdk/js/src/graphql/application.ts:23](https://github.com/settlemint/sdk/blob/v1.0.5/sdk/js/src/graphql/application.ts#L23)
|
|
142
123
|
|
|
143
124
|
Type representing an application entity.
|
|
144
125
|
|
|
@@ -148,7 +129,7 @@ Type representing an application entity.
|
|
|
148
129
|
|
|
149
130
|
> **BlockchainNetwork**: `ResultOf`\<*typeof* `BlockchainNetworkFragment`\>
|
|
150
131
|
|
|
151
|
-
Defined in: [graphql/blockchain-network.ts:29](https://github.com/settlemint/sdk/blob/v1.0.5/sdk/js/src/graphql/blockchain-network.ts#L29)
|
|
132
|
+
Defined in: [sdk/js/src/graphql/blockchain-network.ts:29](https://github.com/settlemint/sdk/blob/v1.0.5/sdk/js/src/graphql/blockchain-network.ts#L29)
|
|
152
133
|
|
|
153
134
|
Type representing a blockchain network entity.
|
|
154
135
|
|
|
@@ -158,7 +139,7 @@ Type representing a blockchain network entity.
|
|
|
158
139
|
|
|
159
140
|
> **BlockchainNode**: `ResultOf`\<*typeof* `BlockchainNodeFragment`\>
|
|
160
141
|
|
|
161
|
-
Defined in: [graphql/blockchain-node.ts:48](https://github.com/settlemint/sdk/blob/v1.0.5/sdk/js/src/graphql/blockchain-node.ts#L48)
|
|
142
|
+
Defined in: [sdk/js/src/graphql/blockchain-node.ts:48](https://github.com/settlemint/sdk/blob/v1.0.5/sdk/js/src/graphql/blockchain-node.ts#L48)
|
|
162
143
|
|
|
163
144
|
Type representing a blockchain node entity.
|
|
164
145
|
|
|
@@ -168,7 +149,7 @@ Type representing a blockchain node entity.
|
|
|
168
149
|
|
|
169
150
|
> **CustomDeployment**: `ResultOf`\<*typeof* `CustomDeploymentFragment`\>
|
|
170
151
|
|
|
171
|
-
Defined in: [graphql/custom-deployment.ts:30](https://github.com/settlemint/sdk/blob/v1.0.5/sdk/js/src/graphql/custom-deployment.ts#L30)
|
|
152
|
+
Defined in: [sdk/js/src/graphql/custom-deployment.ts:30](https://github.com/settlemint/sdk/blob/v1.0.5/sdk/js/src/graphql/custom-deployment.ts#L30)
|
|
172
153
|
|
|
173
154
|
Type representing a custom deployment entity.
|
|
174
155
|
|
|
@@ -178,7 +159,7 @@ Type representing a custom deployment entity.
|
|
|
178
159
|
|
|
179
160
|
> **Insights**: `ResultOf`\<*typeof* `InsightsFragment`\>
|
|
180
161
|
|
|
181
|
-
Defined in: [graphql/insights.ts:34](https://github.com/settlemint/sdk/blob/v1.0.5/sdk/js/src/graphql/insights.ts#L34)
|
|
162
|
+
Defined in: [sdk/js/src/graphql/insights.ts:34](https://github.com/settlemint/sdk/blob/v1.0.5/sdk/js/src/graphql/insights.ts#L34)
|
|
182
163
|
|
|
183
164
|
Type representing an insights entity.
|
|
184
165
|
|
|
@@ -188,7 +169,7 @@ Type representing an insights entity.
|
|
|
188
169
|
|
|
189
170
|
> **IntegrationTool**: `ResultOf`\<*typeof* `IntegrationFragment`\>
|
|
190
171
|
|
|
191
|
-
Defined in: [graphql/integration-tool.ts:32](https://github.com/settlemint/sdk/blob/v1.0.5/sdk/js/src/graphql/integration-tool.ts#L32)
|
|
172
|
+
Defined in: [sdk/js/src/graphql/integration-tool.ts:32](https://github.com/settlemint/sdk/blob/v1.0.5/sdk/js/src/graphql/integration-tool.ts#L32)
|
|
192
173
|
|
|
193
174
|
Type representing an integration tool entity.
|
|
194
175
|
|
|
@@ -198,7 +179,7 @@ Type representing an integration tool entity.
|
|
|
198
179
|
|
|
199
180
|
> **Middleware**: `ResultOf`\<*typeof* `MiddlewareFragment`\>
|
|
200
181
|
|
|
201
|
-
Defined in: [graphql/middleware.ts:40](https://github.com/settlemint/sdk/blob/v1.0.5/sdk/js/src/graphql/middleware.ts#L40)
|
|
182
|
+
Defined in: [sdk/js/src/graphql/middleware.ts:40](https://github.com/settlemint/sdk/blob/v1.0.5/sdk/js/src/graphql/middleware.ts#L40)
|
|
202
183
|
|
|
203
184
|
Type representing a middleware entity.
|
|
204
185
|
|
|
@@ -208,7 +189,7 @@ Type representing a middleware entity.
|
|
|
208
189
|
|
|
209
190
|
> **MiddlewareWithSubgraphs**: `ResultOf`\<*typeof* `getGraphMiddlewareSubgraphs`\>\[`"middlewareByUniqueName"`\]
|
|
210
191
|
|
|
211
|
-
Defined in: [graphql/middleware.ts:98](https://github.com/settlemint/sdk/blob/v1.0.5/sdk/js/src/graphql/middleware.ts#L98)
|
|
192
|
+
Defined in: [sdk/js/src/graphql/middleware.ts:98](https://github.com/settlemint/sdk/blob/v1.0.5/sdk/js/src/graphql/middleware.ts#L98)
|
|
212
193
|
|
|
213
194
|
Type representing a middleware entity with subgraphs.
|
|
214
195
|
|
|
@@ -218,7 +199,7 @@ Type representing a middleware entity with subgraphs.
|
|
|
218
199
|
|
|
219
200
|
> **PlatformConfig**: `ResultOf`\<*typeof* `getPlatformConfigQuery`\>\[`"config"`\]
|
|
220
201
|
|
|
221
|
-
Defined in: [graphql/platform.ts:44](https://github.com/settlemint/sdk/blob/v1.0.5/sdk/js/src/graphql/platform.ts#L44)
|
|
202
|
+
Defined in: [sdk/js/src/graphql/platform.ts:44](https://github.com/settlemint/sdk/blob/v1.0.5/sdk/js/src/graphql/platform.ts#L44)
|
|
222
203
|
|
|
223
204
|
Type representing the platform configuration.
|
|
224
205
|
|
|
@@ -228,7 +209,7 @@ Type representing the platform configuration.
|
|
|
228
209
|
|
|
229
210
|
> **PrivateKey**: `ResultOf`\<*typeof* `PrivateKeyFragment`\>
|
|
230
211
|
|
|
231
|
-
Defined in: [graphql/private-key.ts:24](https://github.com/settlemint/sdk/blob/v1.0.5/sdk/js/src/graphql/private-key.ts#L24)
|
|
212
|
+
Defined in: [sdk/js/src/graphql/private-key.ts:24](https://github.com/settlemint/sdk/blob/v1.0.5/sdk/js/src/graphql/private-key.ts#L24)
|
|
232
213
|
|
|
233
214
|
Type representing a private key entity.
|
|
234
215
|
|
|
@@ -238,7 +219,7 @@ Type representing a private key entity.
|
|
|
238
219
|
|
|
239
220
|
> **Storage**: `ResultOf`\<*typeof* `StorageFragment`\>
|
|
240
221
|
|
|
241
|
-
Defined in: [graphql/storage.ts:32](https://github.com/settlemint/sdk/blob/v1.0.5/sdk/js/src/graphql/storage.ts#L32)
|
|
222
|
+
Defined in: [sdk/js/src/graphql/storage.ts:32](https://github.com/settlemint/sdk/blob/v1.0.5/sdk/js/src/graphql/storage.ts#L32)
|
|
242
223
|
|
|
243
224
|
Type representing a storage entity.
|
|
244
225
|
|
|
@@ -248,7 +229,7 @@ Type representing a storage entity.
|
|
|
248
229
|
|
|
249
230
|
> **Workspace**: `ResultOf`\<*typeof* `WorkspaceFragment`\>
|
|
250
231
|
|
|
251
|
-
Defined in: [graphql/workspace.ts:26](https://github.com/settlemint/sdk/blob/v1.0.5/sdk/js/src/graphql/workspace.ts#L26)
|
|
232
|
+
Defined in: [sdk/js/src/graphql/workspace.ts:26](https://github.com/settlemint/sdk/blob/v1.0.5/sdk/js/src/graphql/workspace.ts#L26)
|
|
252
233
|
|
|
253
234
|
Type representing a workspace entity.
|
|
254
235
|
|
package/dist/settlemint.cjs
CHANGED
|
@@ -27,7 +27,6 @@ var import_http = require("@settlemint/sdk-utils/http");
|
|
|
27
27
|
var import_runtime = require("@settlemint/sdk-utils/runtime");
|
|
28
28
|
var import_validation3 = require("@settlemint/sdk-utils/validation");
|
|
29
29
|
var import_graphql_request = require("graphql-request");
|
|
30
|
-
var import_zod2 = require("zod");
|
|
31
30
|
|
|
32
31
|
// src/helpers/graphql.ts
|
|
33
32
|
var import_gql = require("gql.tada");
|
|
@@ -1499,17 +1498,11 @@ var ClientOptionsSchema = import_zod.z.object({
|
|
|
1499
1498
|
// src/settlemint.ts
|
|
1500
1499
|
function createSettleMintClient(options) {
|
|
1501
1500
|
(0, import_runtime.ensureServer)();
|
|
1502
|
-
const validatedOptions =
|
|
1503
|
-
import_zod2.z.object({
|
|
1504
|
-
...ClientOptionsSchema.shape,
|
|
1505
|
-
accessToken: import_zod2.z.literal("")
|
|
1506
|
-
}),
|
|
1507
|
-
options
|
|
1508
|
-
) : (0, import_validation3.validate)(ClientOptionsSchema, options);
|
|
1501
|
+
const validatedOptions = (0, import_validation3.validate)(ClientOptionsSchema, options);
|
|
1509
1502
|
const baseUrl = new URL(validatedOptions.instance).toString().replace(/\/$/, "");
|
|
1510
1503
|
const gqlClient = new import_graphql_request.GraphQLClient(`${baseUrl}/api/graphql`, {
|
|
1511
1504
|
headers: {
|
|
1512
|
-
"x-auth-token": validatedOptions.accessToken
|
|
1505
|
+
"x-auth-token": validatedOptions.accessToken
|
|
1513
1506
|
},
|
|
1514
1507
|
fetch: async (input, init) => {
|
|
1515
1508
|
const response = await (0, import_http.fetchWithRetry)(input, init);
|