@polar-sh/sdk 0.40.3 → 0.41.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 +1 -1
- package/dist/commonjs/funcs/eventsList.js +1 -0
- package/dist/commonjs/funcs/eventsList.js.map +1 -1
- package/dist/commonjs/lib/config.d.ts +3 -3
- package/dist/commonjs/lib/config.js +3 -3
- package/dist/commonjs/models/components/benefitcycledevent.d.ts +5 -0
- package/dist/commonjs/models/components/benefitcycledevent.d.ts.map +1 -1
- package/dist/commonjs/models/components/benefitcycledevent.js +4 -0
- package/dist/commonjs/models/components/benefitcycledevent.js.map +1 -1
- package/dist/commonjs/models/components/benefitgrantedevent.d.ts +5 -0
- package/dist/commonjs/models/components/benefitgrantedevent.d.ts.map +1 -1
- package/dist/commonjs/models/components/benefitgrantedevent.js +4 -0
- package/dist/commonjs/models/components/benefitgrantedevent.js.map +1 -1
- package/dist/commonjs/models/components/benefitrevokedevent.d.ts +5 -0
- package/dist/commonjs/models/components/benefitrevokedevent.d.ts.map +1 -1
- package/dist/commonjs/models/components/benefitrevokedevent.js +4 -0
- package/dist/commonjs/models/components/benefitrevokedevent.js.map +1 -1
- package/dist/commonjs/models/components/benefitupdatedevent.d.ts +5 -0
- package/dist/commonjs/models/components/benefitupdatedevent.d.ts.map +1 -1
- package/dist/commonjs/models/components/benefitupdatedevent.js +4 -0
- package/dist/commonjs/models/components/benefitupdatedevent.js.map +1 -1
- package/dist/commonjs/models/components/customercreate.d.ts +0 -3
- package/dist/commonjs/models/components/customercreate.d.ts.map +1 -1
- package/dist/commonjs/models/components/customercreate.js.map +1 -1
- package/dist/commonjs/models/components/customercreatedevent.d.ts +5 -0
- package/dist/commonjs/models/components/customercreatedevent.d.ts.map +1 -1
- package/dist/commonjs/models/components/customercreatedevent.js +4 -0
- package/dist/commonjs/models/components/customercreatedevent.js.map +1 -1
- package/dist/commonjs/models/components/customerdeletedevent.d.ts +5 -0
- package/dist/commonjs/models/components/customerdeletedevent.d.ts.map +1 -1
- package/dist/commonjs/models/components/customerdeletedevent.js +4 -0
- package/dist/commonjs/models/components/customerdeletedevent.js.map +1 -1
- package/dist/commonjs/models/components/customerupdate.d.ts +0 -3
- package/dist/commonjs/models/components/customerupdate.d.ts.map +1 -1
- package/dist/commonjs/models/components/customerupdate.js.map +1 -1
- package/dist/commonjs/models/components/customerupdatedevent.d.ts +5 -0
- package/dist/commonjs/models/components/customerupdatedevent.d.ts.map +1 -1
- package/dist/commonjs/models/components/customerupdatedevent.js +4 -0
- package/dist/commonjs/models/components/customerupdatedevent.js.map +1 -1
- package/dist/commonjs/models/components/customerupdateexternalid.d.ts +0 -3
- package/dist/commonjs/models/components/customerupdateexternalid.d.ts.map +1 -1
- package/dist/commonjs/models/components/customerupdateexternalid.js.map +1 -1
- package/dist/commonjs/models/components/eventcreatecustomer.d.ts +10 -0
- package/dist/commonjs/models/components/eventcreatecustomer.d.ts.map +1 -1
- package/dist/commonjs/models/components/eventcreatecustomer.js +8 -0
- package/dist/commonjs/models/components/eventcreatecustomer.js.map +1 -1
- package/dist/commonjs/models/components/eventcreateexternalcustomer.d.ts +10 -0
- package/dist/commonjs/models/components/eventcreateexternalcustomer.d.ts.map +1 -1
- package/dist/commonjs/models/components/eventcreateexternalcustomer.js +8 -0
- package/dist/commonjs/models/components/eventcreateexternalcustomer.js.map +1 -1
- package/dist/commonjs/models/components/eventsingestresponse.d.ts +5 -0
- package/dist/commonjs/models/components/eventsingestresponse.d.ts.map +1 -1
- package/dist/commonjs/models/components/eventsingestresponse.js +2 -0
- package/dist/commonjs/models/components/eventsingestresponse.js.map +1 -1
- package/dist/commonjs/models/components/metercreditevent.d.ts +5 -0
- package/dist/commonjs/models/components/metercreditevent.d.ts.map +1 -1
- package/dist/commonjs/models/components/metercreditevent.js +4 -0
- package/dist/commonjs/models/components/metercreditevent.js.map +1 -1
- package/dist/commonjs/models/components/meterresetevent.d.ts +5 -0
- package/dist/commonjs/models/components/meterresetevent.d.ts.map +1 -1
- package/dist/commonjs/models/components/meterresetevent.js +4 -0
- package/dist/commonjs/models/components/meterresetevent.js.map +1 -1
- package/dist/commonjs/models/components/orderpaidevent.d.ts +5 -0
- package/dist/commonjs/models/components/orderpaidevent.d.ts.map +1 -1
- package/dist/commonjs/models/components/orderpaidevent.js +4 -0
- package/dist/commonjs/models/components/orderpaidevent.js.map +1 -1
- package/dist/commonjs/models/components/orderrefundedevent.d.ts +5 -0
- package/dist/commonjs/models/components/orderrefundedevent.d.ts.map +1 -1
- package/dist/commonjs/models/components/orderrefundedevent.js +4 -0
- package/dist/commonjs/models/components/orderrefundedevent.js.map +1 -1
- package/dist/commonjs/models/components/subscriptioncycledevent.d.ts +5 -0
- package/dist/commonjs/models/components/subscriptioncycledevent.d.ts.map +1 -1
- package/dist/commonjs/models/components/subscriptioncycledevent.js +4 -0
- package/dist/commonjs/models/components/subscriptioncycledevent.js.map +1 -1
- package/dist/commonjs/models/components/subscriptionproductupdatedevent.d.ts +5 -0
- package/dist/commonjs/models/components/subscriptionproductupdatedevent.d.ts.map +1 -1
- package/dist/commonjs/models/components/subscriptionproductupdatedevent.js +4 -0
- package/dist/commonjs/models/components/subscriptionproductupdatedevent.js.map +1 -1
- package/dist/commonjs/models/components/subscriptionrevokedevent.d.ts +5 -0
- package/dist/commonjs/models/components/subscriptionrevokedevent.d.ts.map +1 -1
- package/dist/commonjs/models/components/subscriptionrevokedevent.js +4 -0
- package/dist/commonjs/models/components/subscriptionrevokedevent.js.map +1 -1
- package/dist/commonjs/models/components/userevent.d.ts +5 -0
- package/dist/commonjs/models/components/userevent.d.ts.map +1 -1
- package/dist/commonjs/models/components/userevent.js +4 -0
- package/dist/commonjs/models/components/userevent.js.map +1 -1
- package/dist/commonjs/models/operations/eventslist.d.ts +5 -0
- package/dist/commonjs/models/operations/eventslist.d.ts.map +1 -1
- package/dist/commonjs/models/operations/eventslist.js +4 -0
- package/dist/commonjs/models/operations/eventslist.js.map +1 -1
- package/dist/esm/funcs/eventsList.js +1 -0
- package/dist/esm/funcs/eventsList.js.map +1 -1
- package/dist/esm/lib/config.d.ts +3 -3
- package/dist/esm/lib/config.js +3 -3
- package/dist/esm/models/components/benefitcycledevent.d.ts +5 -0
- package/dist/esm/models/components/benefitcycledevent.d.ts.map +1 -1
- package/dist/esm/models/components/benefitcycledevent.js +4 -0
- package/dist/esm/models/components/benefitcycledevent.js.map +1 -1
- package/dist/esm/models/components/benefitgrantedevent.d.ts +5 -0
- package/dist/esm/models/components/benefitgrantedevent.d.ts.map +1 -1
- package/dist/esm/models/components/benefitgrantedevent.js +4 -0
- package/dist/esm/models/components/benefitgrantedevent.js.map +1 -1
- package/dist/esm/models/components/benefitrevokedevent.d.ts +5 -0
- package/dist/esm/models/components/benefitrevokedevent.d.ts.map +1 -1
- package/dist/esm/models/components/benefitrevokedevent.js +4 -0
- package/dist/esm/models/components/benefitrevokedevent.js.map +1 -1
- package/dist/esm/models/components/benefitupdatedevent.d.ts +5 -0
- package/dist/esm/models/components/benefitupdatedevent.d.ts.map +1 -1
- package/dist/esm/models/components/benefitupdatedevent.js +4 -0
- package/dist/esm/models/components/benefitupdatedevent.js.map +1 -1
- package/dist/esm/models/components/customercreate.d.ts +0 -3
- package/dist/esm/models/components/customercreate.d.ts.map +1 -1
- package/dist/esm/models/components/customercreate.js.map +1 -1
- package/dist/esm/models/components/customercreatedevent.d.ts +5 -0
- package/dist/esm/models/components/customercreatedevent.d.ts.map +1 -1
- package/dist/esm/models/components/customercreatedevent.js +4 -0
- package/dist/esm/models/components/customercreatedevent.js.map +1 -1
- package/dist/esm/models/components/customerdeletedevent.d.ts +5 -0
- package/dist/esm/models/components/customerdeletedevent.d.ts.map +1 -1
- package/dist/esm/models/components/customerdeletedevent.js +4 -0
- package/dist/esm/models/components/customerdeletedevent.js.map +1 -1
- package/dist/esm/models/components/customerupdate.d.ts +0 -3
- package/dist/esm/models/components/customerupdate.d.ts.map +1 -1
- package/dist/esm/models/components/customerupdate.js.map +1 -1
- package/dist/esm/models/components/customerupdatedevent.d.ts +5 -0
- package/dist/esm/models/components/customerupdatedevent.d.ts.map +1 -1
- package/dist/esm/models/components/customerupdatedevent.js +4 -0
- package/dist/esm/models/components/customerupdatedevent.js.map +1 -1
- package/dist/esm/models/components/customerupdateexternalid.d.ts +0 -3
- package/dist/esm/models/components/customerupdateexternalid.d.ts.map +1 -1
- package/dist/esm/models/components/customerupdateexternalid.js.map +1 -1
- package/dist/esm/models/components/eventcreatecustomer.d.ts +10 -0
- package/dist/esm/models/components/eventcreatecustomer.d.ts.map +1 -1
- package/dist/esm/models/components/eventcreatecustomer.js +8 -0
- package/dist/esm/models/components/eventcreatecustomer.js.map +1 -1
- package/dist/esm/models/components/eventcreateexternalcustomer.d.ts +10 -0
- package/dist/esm/models/components/eventcreateexternalcustomer.d.ts.map +1 -1
- package/dist/esm/models/components/eventcreateexternalcustomer.js +8 -0
- package/dist/esm/models/components/eventcreateexternalcustomer.js.map +1 -1
- package/dist/esm/models/components/eventsingestresponse.d.ts +5 -0
- package/dist/esm/models/components/eventsingestresponse.d.ts.map +1 -1
- package/dist/esm/models/components/eventsingestresponse.js +2 -0
- package/dist/esm/models/components/eventsingestresponse.js.map +1 -1
- package/dist/esm/models/components/metercreditevent.d.ts +5 -0
- package/dist/esm/models/components/metercreditevent.d.ts.map +1 -1
- package/dist/esm/models/components/metercreditevent.js +4 -0
- package/dist/esm/models/components/metercreditevent.js.map +1 -1
- package/dist/esm/models/components/meterresetevent.d.ts +5 -0
- package/dist/esm/models/components/meterresetevent.d.ts.map +1 -1
- package/dist/esm/models/components/meterresetevent.js +4 -0
- package/dist/esm/models/components/meterresetevent.js.map +1 -1
- package/dist/esm/models/components/orderpaidevent.d.ts +5 -0
- package/dist/esm/models/components/orderpaidevent.d.ts.map +1 -1
- package/dist/esm/models/components/orderpaidevent.js +4 -0
- package/dist/esm/models/components/orderpaidevent.js.map +1 -1
- package/dist/esm/models/components/orderrefundedevent.d.ts +5 -0
- package/dist/esm/models/components/orderrefundedevent.d.ts.map +1 -1
- package/dist/esm/models/components/orderrefundedevent.js +4 -0
- package/dist/esm/models/components/orderrefundedevent.js.map +1 -1
- package/dist/esm/models/components/subscriptioncycledevent.d.ts +5 -0
- package/dist/esm/models/components/subscriptioncycledevent.d.ts.map +1 -1
- package/dist/esm/models/components/subscriptioncycledevent.js +4 -0
- package/dist/esm/models/components/subscriptioncycledevent.js.map +1 -1
- package/dist/esm/models/components/subscriptionproductupdatedevent.d.ts +5 -0
- package/dist/esm/models/components/subscriptionproductupdatedevent.d.ts.map +1 -1
- package/dist/esm/models/components/subscriptionproductupdatedevent.js +4 -0
- package/dist/esm/models/components/subscriptionproductupdatedevent.js.map +1 -1
- package/dist/esm/models/components/subscriptionrevokedevent.d.ts +5 -0
- package/dist/esm/models/components/subscriptionrevokedevent.d.ts.map +1 -1
- package/dist/esm/models/components/subscriptionrevokedevent.js +4 -0
- package/dist/esm/models/components/subscriptionrevokedevent.js.map +1 -1
- package/dist/esm/models/components/userevent.d.ts +5 -0
- package/dist/esm/models/components/userevent.d.ts.map +1 -1
- package/dist/esm/models/components/userevent.js +4 -0
- package/dist/esm/models/components/userevent.js.map +1 -1
- package/dist/esm/models/operations/eventslist.d.ts +5 -0
- package/dist/esm/models/operations/eventslist.d.ts.map +1 -1
- package/dist/esm/models/operations/eventslist.js +4 -0
- package/dist/esm/models/operations/eventslist.js.map +1 -1
- package/examples/package-lock.json +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/funcs/eventsList.ts +1 -0
- package/src/lib/config.ts +3 -3
- package/src/models/components/benefitcycledevent.ts +9 -0
- package/src/models/components/benefitgrantedevent.ts +9 -0
- package/src/models/components/benefitrevokedevent.ts +9 -0
- package/src/models/components/benefitupdatedevent.ts +9 -0
- package/src/models/components/customercreate.ts +0 -3
- package/src/models/components/customercreatedevent.ts +9 -0
- package/src/models/components/customerdeletedevent.ts +9 -0
- package/src/models/components/customerupdate.ts +0 -3
- package/src/models/components/customerupdatedevent.ts +9 -0
- package/src/models/components/customerupdateexternalid.ts +0 -3
- package/src/models/components/eventcreatecustomer.ts +18 -0
- package/src/models/components/eventcreateexternalcustomer.ts +18 -0
- package/src/models/components/eventsingestresponse.ts +7 -0
- package/src/models/components/metercreditevent.ts +9 -0
- package/src/models/components/meterresetevent.ts +9 -0
- package/src/models/components/orderpaidevent.ts +9 -0
- package/src/models/components/orderrefundedevent.ts +9 -0
- package/src/models/components/subscriptioncycledevent.ts +9 -0
- package/src/models/components/subscriptionproductupdatedevent.ts +9 -0
- package/src/models/components/subscriptionrevokedevent.ts +9 -0
- package/src/models/components/userevent.ts +9 -0
- package/src/models/operations/eventslist.ts +9 -0
- package/.devcontainer/README.md +0 -35
- package/docs/sdks/benefitgrants/README.md +0 -88
- package/docs/sdks/benefits/README.md +0 -500
- package/docs/sdks/checkoutlinks/README.md +0 -407
- package/docs/sdks/checkouts/README.md +0 -600
- package/docs/sdks/clients/README.md +0 -331
- package/docs/sdks/customermeters/README.md +0 -166
- package/docs/sdks/customers/README.md +0 -1036
- package/docs/sdks/customerseats/README.md +0 -441
- package/docs/sdks/customersession/README.md +0 -79
- package/docs/sdks/customersessions/README.md +0 -84
- package/docs/sdks/customfields/README.md +0 -417
- package/docs/sdks/discounts/README.md +0 -409
- package/docs/sdks/downloadables/README.md +0 -83
- package/docs/sdks/events/README.md +0 -324
- package/docs/sdks/files/README.md +0 -460
- package/docs/sdks/licensekeys/README.md +0 -576
- package/docs/sdks/meters/README.md +0 -437
- package/docs/sdks/metrics/README.md +0 -165
- package/docs/sdks/oauth2/README.md +0 -371
- package/docs/sdks/orders/README.md +0 -489
- package/docs/sdks/organizations/README.md +0 -322
- package/docs/sdks/payments/README.md +0 -166
- package/docs/sdks/polarbenefitgrants/README.md +0 -250
- package/docs/sdks/polarcustomermeters/README.md +0 -164
- package/docs/sdks/polarcustomers/README.md +0 -482
- package/docs/sdks/polarlicensekeys/README.md +0 -406
- package/docs/sdks/polarorders/README.md +0 -574
- package/docs/sdks/polarorganizations/README.md +0 -79
- package/docs/sdks/polarsubscriptions/README.md +0 -326
- package/docs/sdks/polarwallets/README.md +0 -164
- package/docs/sdks/products/README.md +0 -441
- package/docs/sdks/refunds/README.md +0 -171
- package/docs/sdks/seats/README.md +0 -379
- package/docs/sdks/subscriptions/README.md +0 -493
- package/docs/sdks/wallets/README.md +0 -256
- package/docs/sdks/webhooks/README.md +0 -650
- package/examples/README.md +0 -31
|
@@ -1,406 +0,0 @@
|
|
|
1
|
-
# PolarLicenseKeys
|
|
2
|
-
(*customerPortal.licenseKeys*)
|
|
3
|
-
|
|
4
|
-
## Overview
|
|
5
|
-
|
|
6
|
-
### Available Operations
|
|
7
|
-
|
|
8
|
-
* [list](#list) - List License Keys
|
|
9
|
-
* [get](#get) - Get License Key
|
|
10
|
-
* [validate](#validate) - Validate License Key
|
|
11
|
-
* [activate](#activate) - Activate License Key
|
|
12
|
-
* [deactivate](#deactivate) - Deactivate License Key
|
|
13
|
-
|
|
14
|
-
## list
|
|
15
|
-
|
|
16
|
-
**Scopes**: `customer_portal:read` `customer_portal:write`
|
|
17
|
-
|
|
18
|
-
### Example Usage
|
|
19
|
-
|
|
20
|
-
<!-- UsageSnippet language="typescript" operationID="customer_portal:license_keys:list" method="get" path="/v1/customer-portal/license-keys/" -->
|
|
21
|
-
```typescript
|
|
22
|
-
import { Polar } from "@polar-sh/sdk";
|
|
23
|
-
|
|
24
|
-
const polar = new Polar();
|
|
25
|
-
|
|
26
|
-
async function run() {
|
|
27
|
-
const result = await polar.customerPortal.licenseKeys.list({
|
|
28
|
-
customerSession: process.env["POLAR_CUSTOMER_SESSION"] ?? "",
|
|
29
|
-
}, {});
|
|
30
|
-
|
|
31
|
-
for await (const page of result) {
|
|
32
|
-
console.log(page);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
run();
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
### Standalone function
|
|
40
|
-
|
|
41
|
-
The standalone function version of this method:
|
|
42
|
-
|
|
43
|
-
```typescript
|
|
44
|
-
import { PolarCore } from "@polar-sh/sdk/core.js";
|
|
45
|
-
import { customerPortalLicenseKeysList } from "@polar-sh/sdk/funcs/customerPortalLicenseKeysList.js";
|
|
46
|
-
|
|
47
|
-
// Use `PolarCore` for best tree-shaking performance.
|
|
48
|
-
// You can create one instance of it to use across an application.
|
|
49
|
-
const polar = new PolarCore();
|
|
50
|
-
|
|
51
|
-
async function run() {
|
|
52
|
-
const res = await customerPortalLicenseKeysList(polar, {
|
|
53
|
-
customerSession: process.env["POLAR_CUSTOMER_SESSION"] ?? "",
|
|
54
|
-
}, {});
|
|
55
|
-
if (res.ok) {
|
|
56
|
-
const { value: result } = res;
|
|
57
|
-
for await (const page of result) {
|
|
58
|
-
console.log(page);
|
|
59
|
-
}
|
|
60
|
-
} else {
|
|
61
|
-
console.log("customerPortalLicenseKeysList failed:", res.error);
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
run();
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
### Parameters
|
|
69
|
-
|
|
70
|
-
| Parameter | Type | Required | Description |
|
|
71
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
72
|
-
| `request` | [operations.CustomerPortalLicenseKeysListRequest](../../models/operations/customerportallicensekeyslistrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
73
|
-
| `security` | [operations.CustomerPortalLicenseKeysListSecurity](../../models/operations/customerportallicensekeyslistsecurity.md) | :heavy_check_mark: | The security requirements to use for the request. |
|
|
74
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
75
|
-
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
|
|
76
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
77
|
-
|
|
78
|
-
### Response
|
|
79
|
-
|
|
80
|
-
**Promise\<[operations.CustomerPortalLicenseKeysListResponse](../../models/operations/customerportallicensekeyslistresponse.md)\>**
|
|
81
|
-
|
|
82
|
-
### Errors
|
|
83
|
-
|
|
84
|
-
| Error Type | Status Code | Content Type |
|
|
85
|
-
| -------------------------- | -------------------------- | -------------------------- |
|
|
86
|
-
| errors.Unauthorized | 401 | application/json |
|
|
87
|
-
| errors.ResourceNotFound | 404 | application/json |
|
|
88
|
-
| errors.HTTPValidationError | 422 | application/json |
|
|
89
|
-
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
90
|
-
|
|
91
|
-
## get
|
|
92
|
-
|
|
93
|
-
Get a license key.
|
|
94
|
-
|
|
95
|
-
**Scopes**: `customer_portal:read` `customer_portal:write`
|
|
96
|
-
|
|
97
|
-
### Example Usage
|
|
98
|
-
|
|
99
|
-
<!-- UsageSnippet language="typescript" operationID="customer_portal:license_keys:get" method="get" path="/v1/customer-portal/license-keys/{id}" -->
|
|
100
|
-
```typescript
|
|
101
|
-
import { Polar } from "@polar-sh/sdk";
|
|
102
|
-
|
|
103
|
-
const polar = new Polar();
|
|
104
|
-
|
|
105
|
-
async function run() {
|
|
106
|
-
const result = await polar.customerPortal.licenseKeys.get({
|
|
107
|
-
customerSession: process.env["POLAR_CUSTOMER_SESSION"] ?? "",
|
|
108
|
-
}, {
|
|
109
|
-
id: "<value>",
|
|
110
|
-
});
|
|
111
|
-
|
|
112
|
-
console.log(result);
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
run();
|
|
116
|
-
```
|
|
117
|
-
|
|
118
|
-
### Standalone function
|
|
119
|
-
|
|
120
|
-
The standalone function version of this method:
|
|
121
|
-
|
|
122
|
-
```typescript
|
|
123
|
-
import { PolarCore } from "@polar-sh/sdk/core.js";
|
|
124
|
-
import { customerPortalLicenseKeysGet } from "@polar-sh/sdk/funcs/customerPortalLicenseKeysGet.js";
|
|
125
|
-
|
|
126
|
-
// Use `PolarCore` for best tree-shaking performance.
|
|
127
|
-
// You can create one instance of it to use across an application.
|
|
128
|
-
const polar = new PolarCore();
|
|
129
|
-
|
|
130
|
-
async function run() {
|
|
131
|
-
const res = await customerPortalLicenseKeysGet(polar, {
|
|
132
|
-
customerSession: process.env["POLAR_CUSTOMER_SESSION"] ?? "",
|
|
133
|
-
}, {
|
|
134
|
-
id: "<value>",
|
|
135
|
-
});
|
|
136
|
-
if (res.ok) {
|
|
137
|
-
const { value: result } = res;
|
|
138
|
-
console.log(result);
|
|
139
|
-
} else {
|
|
140
|
-
console.log("customerPortalLicenseKeysGet failed:", res.error);
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
run();
|
|
145
|
-
```
|
|
146
|
-
|
|
147
|
-
### Parameters
|
|
148
|
-
|
|
149
|
-
| Parameter | Type | Required | Description |
|
|
150
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
151
|
-
| `request` | [operations.CustomerPortalLicenseKeysGetRequest](../../models/operations/customerportallicensekeysgetrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
152
|
-
| `security` | [operations.CustomerPortalLicenseKeysGetSecurity](../../models/operations/customerportallicensekeysgetsecurity.md) | :heavy_check_mark: | The security requirements to use for the request. |
|
|
153
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
154
|
-
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
|
|
155
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
156
|
-
|
|
157
|
-
### Response
|
|
158
|
-
|
|
159
|
-
**Promise\<[components.LicenseKeyWithActivations](../../models/components/licensekeywithactivations.md)\>**
|
|
160
|
-
|
|
161
|
-
### Errors
|
|
162
|
-
|
|
163
|
-
| Error Type | Status Code | Content Type |
|
|
164
|
-
| -------------------------- | -------------------------- | -------------------------- |
|
|
165
|
-
| errors.ResourceNotFound | 404 | application/json |
|
|
166
|
-
| errors.HTTPValidationError | 422 | application/json |
|
|
167
|
-
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
168
|
-
|
|
169
|
-
## validate
|
|
170
|
-
|
|
171
|
-
Validate a license key.
|
|
172
|
-
|
|
173
|
-
> This endpoint doesn't require authentication and can be safely used on a public
|
|
174
|
-
> client, like a desktop application or a mobile app.
|
|
175
|
-
> If you plan to validate a license key on a server, use the `/v1/license-keys/validate`
|
|
176
|
-
> endpoint instead.
|
|
177
|
-
|
|
178
|
-
### Example Usage
|
|
179
|
-
|
|
180
|
-
<!-- UsageSnippet language="typescript" operationID="customer_portal:license_keys:validate" method="post" path="/v1/customer-portal/license-keys/validate" -->
|
|
181
|
-
```typescript
|
|
182
|
-
import { Polar } from "@polar-sh/sdk";
|
|
183
|
-
|
|
184
|
-
const polar = new Polar();
|
|
185
|
-
|
|
186
|
-
async function run() {
|
|
187
|
-
const result = await polar.customerPortal.licenseKeys.validate({
|
|
188
|
-
key: "<key>",
|
|
189
|
-
organizationId: "<value>",
|
|
190
|
-
});
|
|
191
|
-
|
|
192
|
-
console.log(result);
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
run();
|
|
196
|
-
```
|
|
197
|
-
|
|
198
|
-
### Standalone function
|
|
199
|
-
|
|
200
|
-
The standalone function version of this method:
|
|
201
|
-
|
|
202
|
-
```typescript
|
|
203
|
-
import { PolarCore } from "@polar-sh/sdk/core.js";
|
|
204
|
-
import { customerPortalLicenseKeysValidate } from "@polar-sh/sdk/funcs/customerPortalLicenseKeysValidate.js";
|
|
205
|
-
|
|
206
|
-
// Use `PolarCore` for best tree-shaking performance.
|
|
207
|
-
// You can create one instance of it to use across an application.
|
|
208
|
-
const polar = new PolarCore();
|
|
209
|
-
|
|
210
|
-
async function run() {
|
|
211
|
-
const res = await customerPortalLicenseKeysValidate(polar, {
|
|
212
|
-
key: "<key>",
|
|
213
|
-
organizationId: "<value>",
|
|
214
|
-
});
|
|
215
|
-
if (res.ok) {
|
|
216
|
-
const { value: result } = res;
|
|
217
|
-
console.log(result);
|
|
218
|
-
} else {
|
|
219
|
-
console.log("customerPortalLicenseKeysValidate failed:", res.error);
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
run();
|
|
224
|
-
```
|
|
225
|
-
|
|
226
|
-
### Parameters
|
|
227
|
-
|
|
228
|
-
| Parameter | Type | Required | Description |
|
|
229
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
230
|
-
| `request` | [components.LicenseKeyValidate](../../models/components/licensekeyvalidate.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
231
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
232
|
-
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
|
|
233
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
234
|
-
|
|
235
|
-
### Response
|
|
236
|
-
|
|
237
|
-
**Promise\<[components.ValidatedLicenseKey](../../models/components/validatedlicensekey.md)\>**
|
|
238
|
-
|
|
239
|
-
### Errors
|
|
240
|
-
|
|
241
|
-
| Error Type | Status Code | Content Type |
|
|
242
|
-
| -------------------------- | -------------------------- | -------------------------- |
|
|
243
|
-
| errors.ResourceNotFound | 404 | application/json |
|
|
244
|
-
| errors.HTTPValidationError | 422 | application/json |
|
|
245
|
-
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
246
|
-
|
|
247
|
-
## activate
|
|
248
|
-
|
|
249
|
-
Activate a license key instance.
|
|
250
|
-
|
|
251
|
-
> This endpoint doesn't require authentication and can be safely used on a public
|
|
252
|
-
> client, like a desktop application or a mobile app.
|
|
253
|
-
> If you plan to validate a license key on a server, use the `/v1/license-keys/activate`
|
|
254
|
-
> endpoint instead.
|
|
255
|
-
|
|
256
|
-
### Example Usage
|
|
257
|
-
|
|
258
|
-
<!-- UsageSnippet language="typescript" operationID="customer_portal:license_keys:activate" method="post" path="/v1/customer-portal/license-keys/activate" -->
|
|
259
|
-
```typescript
|
|
260
|
-
import { Polar } from "@polar-sh/sdk";
|
|
261
|
-
|
|
262
|
-
const polar = new Polar();
|
|
263
|
-
|
|
264
|
-
async function run() {
|
|
265
|
-
const result = await polar.customerPortal.licenseKeys.activate({
|
|
266
|
-
key: "<key>",
|
|
267
|
-
organizationId: "<value>",
|
|
268
|
-
label: "<value>",
|
|
269
|
-
});
|
|
270
|
-
|
|
271
|
-
console.log(result);
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
run();
|
|
275
|
-
```
|
|
276
|
-
|
|
277
|
-
### Standalone function
|
|
278
|
-
|
|
279
|
-
The standalone function version of this method:
|
|
280
|
-
|
|
281
|
-
```typescript
|
|
282
|
-
import { PolarCore } from "@polar-sh/sdk/core.js";
|
|
283
|
-
import { customerPortalLicenseKeysActivate } from "@polar-sh/sdk/funcs/customerPortalLicenseKeysActivate.js";
|
|
284
|
-
|
|
285
|
-
// Use `PolarCore` for best tree-shaking performance.
|
|
286
|
-
// You can create one instance of it to use across an application.
|
|
287
|
-
const polar = new PolarCore();
|
|
288
|
-
|
|
289
|
-
async function run() {
|
|
290
|
-
const res = await customerPortalLicenseKeysActivate(polar, {
|
|
291
|
-
key: "<key>",
|
|
292
|
-
organizationId: "<value>",
|
|
293
|
-
label: "<value>",
|
|
294
|
-
});
|
|
295
|
-
if (res.ok) {
|
|
296
|
-
const { value: result } = res;
|
|
297
|
-
console.log(result);
|
|
298
|
-
} else {
|
|
299
|
-
console.log("customerPortalLicenseKeysActivate failed:", res.error);
|
|
300
|
-
}
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
run();
|
|
304
|
-
```
|
|
305
|
-
|
|
306
|
-
### Parameters
|
|
307
|
-
|
|
308
|
-
| Parameter | Type | Required | Description |
|
|
309
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
310
|
-
| `request` | [components.LicenseKeyActivate](../../models/components/licensekeyactivate.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
311
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
312
|
-
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
|
|
313
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
314
|
-
|
|
315
|
-
### Response
|
|
316
|
-
|
|
317
|
-
**Promise\<[components.LicenseKeyActivationRead](../../models/components/licensekeyactivationread.md)\>**
|
|
318
|
-
|
|
319
|
-
### Errors
|
|
320
|
-
|
|
321
|
-
| Error Type | Status Code | Content Type |
|
|
322
|
-
| -------------------------- | -------------------------- | -------------------------- |
|
|
323
|
-
| errors.NotPermitted | 403 | application/json |
|
|
324
|
-
| errors.ResourceNotFound | 404 | application/json |
|
|
325
|
-
| errors.HTTPValidationError | 422 | application/json |
|
|
326
|
-
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
327
|
-
|
|
328
|
-
## deactivate
|
|
329
|
-
|
|
330
|
-
Deactivate a license key instance.
|
|
331
|
-
|
|
332
|
-
> This endpoint doesn't require authentication and can be safely used on a public
|
|
333
|
-
> client, like a desktop application or a mobile app.
|
|
334
|
-
> If you plan to validate a license key on a server, use the `/v1/license-keys/deactivate`
|
|
335
|
-
> endpoint instead.
|
|
336
|
-
|
|
337
|
-
### Example Usage
|
|
338
|
-
|
|
339
|
-
<!-- UsageSnippet language="typescript" operationID="customer_portal:license_keys:deactivate" method="post" path="/v1/customer-portal/license-keys/deactivate" -->
|
|
340
|
-
```typescript
|
|
341
|
-
import { Polar } from "@polar-sh/sdk";
|
|
342
|
-
|
|
343
|
-
const polar = new Polar();
|
|
344
|
-
|
|
345
|
-
async function run() {
|
|
346
|
-
await polar.customerPortal.licenseKeys.deactivate({
|
|
347
|
-
key: "<key>",
|
|
348
|
-
organizationId: "<value>",
|
|
349
|
-
activationId: "<value>",
|
|
350
|
-
});
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
}
|
|
354
|
-
|
|
355
|
-
run();
|
|
356
|
-
```
|
|
357
|
-
|
|
358
|
-
### Standalone function
|
|
359
|
-
|
|
360
|
-
The standalone function version of this method:
|
|
361
|
-
|
|
362
|
-
```typescript
|
|
363
|
-
import { PolarCore } from "@polar-sh/sdk/core.js";
|
|
364
|
-
import { customerPortalLicenseKeysDeactivate } from "@polar-sh/sdk/funcs/customerPortalLicenseKeysDeactivate.js";
|
|
365
|
-
|
|
366
|
-
// Use `PolarCore` for best tree-shaking performance.
|
|
367
|
-
// You can create one instance of it to use across an application.
|
|
368
|
-
const polar = new PolarCore();
|
|
369
|
-
|
|
370
|
-
async function run() {
|
|
371
|
-
const res = await customerPortalLicenseKeysDeactivate(polar, {
|
|
372
|
-
key: "<key>",
|
|
373
|
-
organizationId: "<value>",
|
|
374
|
-
activationId: "<value>",
|
|
375
|
-
});
|
|
376
|
-
if (res.ok) {
|
|
377
|
-
const { value: result } = res;
|
|
378
|
-
|
|
379
|
-
} else {
|
|
380
|
-
console.log("customerPortalLicenseKeysDeactivate failed:", res.error);
|
|
381
|
-
}
|
|
382
|
-
}
|
|
383
|
-
|
|
384
|
-
run();
|
|
385
|
-
```
|
|
386
|
-
|
|
387
|
-
### Parameters
|
|
388
|
-
|
|
389
|
-
| Parameter | Type | Required | Description |
|
|
390
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
391
|
-
| `request` | [components.LicenseKeyDeactivate](../../models/components/licensekeydeactivate.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
392
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
393
|
-
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
|
|
394
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
395
|
-
|
|
396
|
-
### Response
|
|
397
|
-
|
|
398
|
-
**Promise\<void\>**
|
|
399
|
-
|
|
400
|
-
### Errors
|
|
401
|
-
|
|
402
|
-
| Error Type | Status Code | Content Type |
|
|
403
|
-
| -------------------------- | -------------------------- | -------------------------- |
|
|
404
|
-
| errors.ResourceNotFound | 404 | application/json |
|
|
405
|
-
| errors.HTTPValidationError | 422 | application/json |
|
|
406
|
-
| errors.SDKError | 4XX, 5XX | \*/\* |
|