You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 1, 2024. It is now read-only.
*[executePolicy](docs/sdks/opa/README.md#executepolicy) - Execute a policy
236
-
*[executePolicyWithInput](docs/sdks/opa/README.md#executepolicywithinput) - Execute a policy given an input
237
-
*[health](docs/sdks/opa/README.md#health) - Verify the server is operational
235
+
*[executePolicy](docs/sdks/opaapiclient/README.md#executepolicy) - Execute a policy
236
+
*[executePolicyWithInput](docs/sdks/opaapiclient/README.md#executepolicywithinput) - Execute a policy given an input
237
+
*[health](docs/sdks/opaapiclient/README.md#health) - Verify the server is operational
238
238
<!-- End Available Resources and Operations [operations] -->
239
239
240
240
<!-- Start Error Handling [errors] -->
@@ -252,11 +252,11 @@ Validation errors can also occur when either method arguments or data returned f
252
252
253
253
254
254
```typescript
255
-
import { Opa } from"opa";
256
-
import*aserrorsfrom"opa/models/errors";
255
+
import { OpaApiClient } from"@styra/opa";
256
+
import*aserrorsfrom"@styra/opa/models/errors";
257
257
258
258
asyncfunction run() {
259
-
const sdk =newOpa();
259
+
const sdk =newOpaApiClient();
260
260
261
261
let result;
262
262
try {
@@ -307,10 +307,10 @@ You can override the default server globally by passing a server index to the `s
307
307
| 0 |`http://localhost:8181`| None |
308
308
309
309
```typescript
310
-
import { Opa } from"opa";
310
+
import { OpaApiClient } from"@styra/opa";
311
311
312
312
asyncfunction run() {
313
-
const sdk =newOpa({
313
+
const sdk =newOpaApiClient({
314
314
serverIdx: 0,
315
315
});
316
316
@@ -332,10 +332,10 @@ run();
332
332
The default server can also be overridden globally by passing a URL to the `serverURL` optional parameter when initializing the SDK client instance. For example:
333
333
334
334
```typescript
335
-
import { Opa } from"opa";
335
+
import { OpaApiClient } from"@styra/opa";
336
336
337
337
asyncfunction run() {
338
-
const sdk =newOpa({
338
+
const sdk =newOpaApiClient({
339
339
serverURL: "http://localhost:8181",
340
340
});
341
341
@@ -370,8 +370,8 @@ custom header and a timeout to requests and how to use the `"requestError"` hook
370
370
to log errors:
371
371
372
372
```typescript
373
-
import { Opa } from"opa";
374
-
import { HTTPClient } from"opa/lib/http";
373
+
import { OpaApiClient } from"@styra/opa";
374
+
import { HTTPClient } from"@styra/opa/lib/http";
375
375
376
376
const httpClient =newHTTPClient({
377
377
// fetcher takes a function that has the same signature as native `fetch`.
0 commit comments