@polar-sh/sdk 0.6.1 → 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 +39 -39
- package/docs/sdks/advertisements/README.md +7 -7
- package/docs/sdks/articles/README.md +12 -14
- package/docs/sdks/benefits/README.md +10 -12
- package/docs/sdks/checkouts/README.md +7 -7
- package/docs/sdks/clients/README.md +10 -10
- package/docs/sdks/downloadables/README.md +7 -7
- package/docs/sdks/externalorganizations/README.md +1 -1
- package/docs/sdks/files/README.md +4 -6
- package/docs/sdks/licensekeys/README.md +9 -9
- package/docs/sdks/metrics/README.md +13 -13
- package/docs/sdks/oauth2/README.md +4 -4
- package/docs/sdks/orders/README.md +8 -8
- package/docs/sdks/organizations/README.md +9 -9
- package/docs/sdks/polaradvertisements/README.md +10 -12
- package/docs/sdks/polarbenefits/README.md +7 -7
- package/docs/sdks/polarlicensekeys/README.md +9 -11
- package/docs/sdks/polarorders/README.md +8 -8
- package/docs/sdks/polarsubscriptions/README.md +10 -10
- package/docs/sdks/products/README.md +10 -10
- package/docs/sdks/repositories/README.md +8 -8
- package/docs/sdks/subscriptions/README.md +4 -4
- package/funcs/{organizationsRetrieve.d.ts → advertisementsGet.d.ts} +4 -4
- package/funcs/{checkoutsRetrieve.d.ts.map → advertisementsGet.d.ts.map} +1 -1
- package/funcs/{advertisementsRetrieve.js → advertisementsGet.js} +3 -3
- package/funcs/advertisementsGet.js.map +1 -0
- package/funcs/{articlesRetrieve.d.ts → articlesGet.d.ts} +2 -2
- package/funcs/articlesGet.d.ts.map +1 -0
- package/funcs/{articlesRetrieve.js → articlesGet.js} +3 -3
- package/funcs/articlesGet.js.map +1 -0
- package/funcs/{benefitsRetrieve.d.ts → benefitsGet.d.ts} +2 -2
- package/funcs/benefitsGet.d.ts.map +1 -0
- package/funcs/{benefitsRetrieve.js → benefitsGet.js} +3 -3
- package/funcs/benefitsGet.js.map +1 -0
- package/funcs/checkoutsGet.d.ts +17 -0
- package/funcs/checkoutsGet.d.ts.map +1 -0
- package/funcs/{checkoutsRetrieve.js → checkoutsGet.js} +3 -3
- package/funcs/checkoutsGet.js.map +1 -0
- package/funcs/{checkoutsRetrieve.d.ts → licenseKeysGet.d.ts} +4 -4
- package/funcs/licenseKeysGet.d.ts.map +1 -0
- package/funcs/{licenseKeysRetrieve.js → licenseKeysGet.js} +3 -3
- package/funcs/licenseKeysGet.js.map +1 -0
- package/funcs/{metricsRetrieve.d.ts → metricsGet.d.ts} +2 -2
- package/funcs/metricsGet.d.ts.map +1 -0
- package/funcs/{metricsRetrieve.js → metricsGet.js} +3 -3
- package/funcs/metricsGet.js.map +1 -0
- package/funcs/{usersAdvertisementsRetrieve.d.ts → oauth2ClientsGet.d.ts} +4 -5
- package/funcs/oauth2ClientsGet.d.ts.map +1 -0
- package/funcs/{oauth2ClientsRetrieve.js → oauth2ClientsGet.js} +3 -3
- package/funcs/oauth2ClientsGet.js.map +1 -0
- package/funcs/{ordersRetrieve.d.ts → ordersGet.d.ts} +2 -2
- package/funcs/ordersGet.d.ts.map +1 -0
- package/funcs/{ordersRetrieve.js → ordersGet.js} +3 -3
- package/funcs/ordersGet.js.map +1 -0
- package/funcs/organizationsGet.d.ts +17 -0
- package/funcs/{articlesRetrieve.d.ts.map → organizationsGet.d.ts.map} +1 -1
- package/funcs/{organizationsRetrieve.js → organizationsGet.js} +3 -3
- package/funcs/organizationsGet.js.map +1 -0
- package/funcs/{productsRetrieve.d.ts → productsGet.d.ts} +2 -2
- package/funcs/productsGet.d.ts.map +1 -0
- package/funcs/{productsRetrieve.js → productsGet.js} +3 -3
- package/funcs/productsGet.js.map +1 -0
- package/funcs/{repositoriesRetrieve.d.ts → repositoriesGet.d.ts} +2 -2
- package/funcs/{metricsRetrieve.d.ts.map → repositoriesGet.d.ts.map} +1 -1
- package/funcs/{repositoriesRetrieve.js → repositoriesGet.js} +3 -3
- package/funcs/repositoriesGet.js.map +1 -0
- package/funcs/subscriptionsImportSubscriptions.d.ts.map +1 -1
- package/funcs/subscriptionsImportSubscriptions.js +7 -0
- package/funcs/subscriptionsImportSubscriptions.js.map +1 -1
- package/funcs/{advertisementsRetrieve.d.ts → usersAdvertisementsGet.d.ts} +3 -3
- package/funcs/{advertisementsRetrieve.d.ts.map → usersAdvertisementsGet.d.ts.map} +1 -1
- package/funcs/{usersAdvertisementsRetrieve.js → usersAdvertisementsGet.js} +3 -3
- package/funcs/{advertisementsRetrieve.js.map → usersAdvertisementsGet.js.map} +1 -1
- package/funcs/{usersBenefitsRetrieve.d.ts → usersBenefitsGet.d.ts} +2 -2
- package/funcs/{benefitsRetrieve.d.ts.map → usersBenefitsGet.d.ts.map} +1 -1
- package/funcs/{usersBenefitsRetrieve.js → usersBenefitsGet.js} +3 -3
- package/funcs/usersBenefitsGet.js.map +1 -0
- package/funcs/{usersDownloadablesRetrieve.d.ts → usersDownloadablesGet.d.ts} +2 -2
- package/funcs/usersDownloadablesGet.d.ts.map +1 -0
- package/funcs/{usersDownloadablesRetrieve.js → usersDownloadablesGet.js} +3 -3
- package/funcs/usersDownloadablesGet.js.map +1 -0
- package/funcs/{licenseKeysRetrieve.d.ts → usersLicenseKeysGet.d.ts} +2 -2
- package/funcs/{licenseKeysRetrieve.d.ts.map → usersLicenseKeysGet.d.ts.map} +1 -1
- package/funcs/{usersLicenseKeysRetrieve.js → usersLicenseKeysGet.js} +3 -3
- package/funcs/{licenseKeysRetrieve.js.map → usersLicenseKeysGet.js.map} +1 -1
- package/funcs/{usersOrdersRetrieve.d.ts → usersOrdersGet.d.ts} +2 -2
- package/funcs/{ordersRetrieve.d.ts.map → usersOrdersGet.d.ts.map} +1 -1
- package/funcs/{usersOrdersRetrieve.js → usersOrdersGet.js} +3 -3
- package/funcs/usersOrdersGet.js.map +1 -0
- package/funcs/{usersSubscriptionsRetrieve.d.ts → usersSubscriptionsGet.d.ts} +2 -2
- package/funcs/{organizationsRetrieve.d.ts.map → usersSubscriptionsGet.d.ts.map} +1 -1
- package/funcs/{usersSubscriptionsRetrieve.js → usersSubscriptionsGet.js} +3 -3
- package/funcs/{organizationsRetrieve.js.map → usersSubscriptionsGet.js.map} +1 -1
- package/index.d.ts +1 -0
- package/index.d.ts.map +1 -1
- package/index.js +14 -0
- package/index.js.map +1 -1
- package/lib/config.d.ts +3 -3
- package/lib/config.js +3 -3
- package/lib/files.d.ts +8 -0
- package/lib/files.d.ts.map +1 -0
- package/lib/files.js +36 -0
- package/lib/files.js.map +1 -0
- package/lib/sdks.d.ts.map +1 -1
- package/lib/sdks.js +12 -0
- package/lib/sdks.js.map +1 -1
- package/models/components/bodysubscriptionsimport.d.ts +2 -2
- package/models/components/bodysubscriptionsimport.d.ts.map +1 -1
- package/models/components/bodysubscriptionsimport.js +12 -3
- package/models/components/bodysubscriptionsimport.js.map +1 -1
- package/package.json +2 -1
- package/sdk/advertisements.d.ts +1 -1
- package/sdk/advertisements.d.ts.map +1 -1
- package/sdk/advertisements.js +3 -3
- package/sdk/advertisements.js.map +1 -1
- package/sdk/articles.d.ts +1 -1
- package/sdk/articles.d.ts.map +1 -1
- package/sdk/articles.js +3 -3
- package/sdk/articles.js.map +1 -1
- package/sdk/benefits.d.ts +1 -1
- package/sdk/benefits.d.ts.map +1 -1
- package/sdk/benefits.js +3 -3
- package/sdk/benefits.js.map +1 -1
- package/sdk/checkouts.d.ts +1 -1
- package/sdk/checkouts.d.ts.map +1 -1
- package/sdk/checkouts.js +3 -3
- package/sdk/checkouts.js.map +1 -1
- package/sdk/clients.d.ts +1 -1
- package/sdk/clients.d.ts.map +1 -1
- package/sdk/clients.js +3 -3
- package/sdk/clients.js.map +1 -1
- package/sdk/downloadables.d.ts +1 -1
- package/sdk/downloadables.d.ts.map +1 -1
- package/sdk/downloadables.js +3 -3
- package/sdk/downloadables.js.map +1 -1
- package/sdk/licensekeys.d.ts +1 -1
- package/sdk/licensekeys.d.ts.map +1 -1
- package/sdk/licensekeys.js +3 -3
- package/sdk/licensekeys.js.map +1 -1
- package/sdk/metrics.d.ts +1 -1
- package/sdk/metrics.d.ts.map +1 -1
- package/sdk/metrics.js +3 -3
- package/sdk/metrics.js.map +1 -1
- package/sdk/orders.d.ts +1 -1
- package/sdk/orders.d.ts.map +1 -1
- package/sdk/orders.js +3 -3
- package/sdk/orders.js.map +1 -1
- package/sdk/organizations.d.ts +1 -1
- package/sdk/organizations.d.ts.map +1 -1
- package/sdk/organizations.js +3 -3
- package/sdk/organizations.js.map +1 -1
- package/sdk/polaradvertisements.d.ts +1 -1
- package/sdk/polaradvertisements.d.ts.map +1 -1
- package/sdk/polaradvertisements.js +3 -3
- package/sdk/polaradvertisements.js.map +1 -1
- package/sdk/polarbenefits.d.ts +1 -1
- package/sdk/polarbenefits.d.ts.map +1 -1
- package/sdk/polarbenefits.js +3 -3
- package/sdk/polarbenefits.js.map +1 -1
- package/sdk/polarlicensekeys.d.ts +1 -1
- package/sdk/polarlicensekeys.d.ts.map +1 -1
- package/sdk/polarlicensekeys.js +3 -3
- package/sdk/polarlicensekeys.js.map +1 -1
- package/sdk/polarorders.d.ts +1 -1
- package/sdk/polarorders.d.ts.map +1 -1
- package/sdk/polarorders.js +3 -3
- package/sdk/polarorders.js.map +1 -1
- package/sdk/polarsubscriptions.d.ts +1 -1
- package/sdk/polarsubscriptions.d.ts.map +1 -1
- package/sdk/polarsubscriptions.js +3 -3
- package/sdk/polarsubscriptions.js.map +1 -1
- package/sdk/products.d.ts +1 -1
- package/sdk/products.d.ts.map +1 -1
- package/sdk/products.js +3 -3
- package/sdk/products.js.map +1 -1
- package/sdk/repositories.d.ts +1 -1
- package/sdk/repositories.d.ts.map +1 -1
- package/sdk/repositories.js +3 -3
- package/sdk/repositories.js.map +1 -1
- package/src/funcs/{advertisementsRetrieve.ts → advertisementsGet.ts} +1 -1
- package/src/funcs/{articlesRetrieve.ts → articlesGet.ts} +1 -1
- package/src/funcs/{benefitsRetrieve.ts → benefitsGet.ts} +1 -1
- package/src/funcs/{checkoutsRetrieve.ts → checkoutsGet.ts} +1 -1
- package/src/funcs/{licenseKeysRetrieve.ts → licenseKeysGet.ts} +1 -1
- package/src/funcs/{metricsRetrieve.ts → metricsGet.ts} +1 -1
- package/src/funcs/{oauth2ClientsRetrieve.ts → oauth2ClientsGet.ts} +1 -1
- package/src/funcs/{ordersRetrieve.ts → ordersGet.ts} +1 -1
- package/src/funcs/{organizationsRetrieve.ts → organizationsGet.ts} +1 -1
- package/src/funcs/{productsRetrieve.ts → productsGet.ts} +1 -1
- package/src/funcs/{repositoriesRetrieve.ts → repositoriesGet.ts} +1 -1
- package/src/funcs/subscriptionsImportSubscriptions.ts +6 -0
- package/src/funcs/{usersAdvertisementsRetrieve.ts → usersAdvertisementsGet.ts} +1 -1
- package/src/funcs/{usersBenefitsRetrieve.ts → usersBenefitsGet.ts} +1 -1
- package/src/funcs/{usersDownloadablesRetrieve.ts → usersDownloadablesGet.ts} +1 -1
- package/src/funcs/{usersLicenseKeysRetrieve.ts → usersLicenseKeysGet.ts} +1 -1
- package/src/funcs/{usersOrdersRetrieve.ts → usersOrdersGet.ts} +1 -1
- package/src/funcs/{usersSubscriptionsRetrieve.ts → usersSubscriptionsGet.ts} +1 -1
- package/src/index.ts +1 -0
- package/src/lib/config.ts +3 -3
- package/src/lib/files.ts +40 -0
- package/src/lib/sdks.ts +12 -0
- package/src/models/components/bodysubscriptionsimport.ts +14 -5
- package/src/sdk/advertisements.ts +3 -3
- package/src/sdk/articles.ts +3 -3
- package/src/sdk/benefits.ts +3 -3
- package/src/sdk/checkouts.ts +3 -3
- package/src/sdk/clients.ts +3 -3
- package/src/sdk/downloadables.ts +3 -3
- package/src/sdk/licensekeys.ts +3 -3
- package/src/sdk/metrics.ts +3 -3
- package/src/sdk/orders.ts +3 -3
- package/src/sdk/organizations.ts +3 -3
- package/src/sdk/polaradvertisements.ts +3 -3
- package/src/sdk/polarbenefits.ts +3 -3
- package/src/sdk/polarlicensekeys.ts +3 -3
- package/src/sdk/polarorders.ts +3 -3
- package/src/sdk/polarsubscriptions.ts +3 -3
- package/src/sdk/products.ts +3 -3
- package/src/sdk/repositories.ts +3 -3
- package/src/types/streams.ts +21 -0
- package/types/streams.d.ts +2 -0
- package/types/streams.d.ts.map +1 -0
- package/types/streams.js +18 -0
- package/types/streams.js.map +1 -0
- package/funcs/articlesRetrieve.js.map +0 -1
- package/funcs/benefitsRetrieve.js.map +0 -1
- package/funcs/checkoutsRetrieve.js.map +0 -1
- package/funcs/metricsRetrieve.js.map +0 -1
- package/funcs/oauth2ClientsRetrieve.d.ts +0 -16
- package/funcs/oauth2ClientsRetrieve.d.ts.map +0 -1
- package/funcs/oauth2ClientsRetrieve.js.map +0 -1
- package/funcs/ordersRetrieve.js.map +0 -1
- package/funcs/productsRetrieve.d.ts.map +0 -1
- package/funcs/productsRetrieve.js.map +0 -1
- package/funcs/repositoriesRetrieve.d.ts.map +0 -1
- package/funcs/repositoriesRetrieve.js.map +0 -1
- package/funcs/usersAdvertisementsRetrieve.d.ts.map +0 -1
- package/funcs/usersAdvertisementsRetrieve.js.map +0 -1
- package/funcs/usersBenefitsRetrieve.d.ts.map +0 -1
- package/funcs/usersBenefitsRetrieve.js.map +0 -1
- package/funcs/usersDownloadablesRetrieve.d.ts.map +0 -1
- package/funcs/usersDownloadablesRetrieve.js.map +0 -1
- package/funcs/usersLicenseKeysRetrieve.d.ts +0 -17
- package/funcs/usersLicenseKeysRetrieve.d.ts.map +0 -1
- package/funcs/usersLicenseKeysRetrieve.js.map +0 -1
- package/funcs/usersOrdersRetrieve.d.ts.map +0 -1
- package/funcs/usersOrdersRetrieve.js.map +0 -1
- package/funcs/usersSubscriptionsRetrieve.d.ts.map +0 -1
- package/funcs/usersSubscriptionsRetrieve.js.map +0 -1
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
### Available Operations
|
|
7
7
|
|
|
8
8
|
* [list](#list) - List Downloadables
|
|
9
|
-
* [
|
|
9
|
+
* [get](#get) - Get Downloadable
|
|
10
10
|
|
|
11
11
|
## list
|
|
12
12
|
|
|
@@ -23,7 +23,7 @@ const polar = new Polar({
|
|
|
23
23
|
|
|
24
24
|
async function run() {
|
|
25
25
|
const result = await polar.users.downloadables.list({});
|
|
26
|
-
|
|
26
|
+
|
|
27
27
|
for await (const page of result) {
|
|
28
28
|
// Handle the page
|
|
29
29
|
console.log(page);
|
|
@@ -86,7 +86,7 @@ run();
|
|
|
86
86
|
| errors.SDKError | 4xx-5xx | */* |
|
|
87
87
|
|
|
88
88
|
|
|
89
|
-
##
|
|
89
|
+
## get
|
|
90
90
|
|
|
91
91
|
Get Downloadable
|
|
92
92
|
|
|
@@ -100,10 +100,10 @@ const polar = new Polar({
|
|
|
100
100
|
});
|
|
101
101
|
|
|
102
102
|
async function run() {
|
|
103
|
-
const result = await polar.users.downloadables.
|
|
103
|
+
const result = await polar.users.downloadables.get({
|
|
104
104
|
token: "<value>",
|
|
105
105
|
});
|
|
106
|
-
|
|
106
|
+
|
|
107
107
|
// Handle the result
|
|
108
108
|
console.log(result)
|
|
109
109
|
}
|
|
@@ -117,7 +117,7 @@ The standalone function version of this method:
|
|
|
117
117
|
|
|
118
118
|
```typescript
|
|
119
119
|
import { PolarCore } from "@polar-sh/sdk/core.js";
|
|
120
|
-
import {
|
|
120
|
+
import { usersDownloadablesGet } from "@polar-sh/sdk/funcs/usersDownloadablesGet.js";
|
|
121
121
|
|
|
122
122
|
// Use `PolarCore` for best tree-shaking performance.
|
|
123
123
|
// You can create one instance of it to use across an application.
|
|
@@ -126,7 +126,7 @@ const polar = new PolarCore({
|
|
|
126
126
|
});
|
|
127
127
|
|
|
128
128
|
async function run() {
|
|
129
|
-
const res = await
|
|
129
|
+
const res = await usersDownloadablesGet(polar, {
|
|
130
130
|
token: "<value>",
|
|
131
131
|
});
|
|
132
132
|
|
|
@@ -26,7 +26,7 @@ const polar = new Polar({
|
|
|
26
26
|
|
|
27
27
|
async function run() {
|
|
28
28
|
const result = await polar.files.list({});
|
|
29
|
-
|
|
29
|
+
|
|
30
30
|
for await (const page of result) {
|
|
31
31
|
// Handle the page
|
|
32
32
|
console.log(page);
|
|
@@ -117,7 +117,7 @@ async function run() {
|
|
|
117
117
|
],
|
|
118
118
|
},
|
|
119
119
|
});
|
|
120
|
-
|
|
120
|
+
|
|
121
121
|
// Handle the result
|
|
122
122
|
console.log(result)
|
|
123
123
|
}
|
|
@@ -217,7 +217,7 @@ async function run() {
|
|
|
217
217
|
],
|
|
218
218
|
},
|
|
219
219
|
});
|
|
220
|
-
|
|
220
|
+
|
|
221
221
|
// Handle the result
|
|
222
222
|
console.log(result)
|
|
223
223
|
}
|
|
@@ -307,7 +307,7 @@ async function run() {
|
|
|
307
307
|
id: "<value>",
|
|
308
308
|
filePatch: {},
|
|
309
309
|
});
|
|
310
|
-
|
|
310
|
+
|
|
311
311
|
// Handle the result
|
|
312
312
|
console.log(result)
|
|
313
313
|
}
|
|
@@ -386,8 +386,6 @@ async function run() {
|
|
|
386
386
|
await polar.files.delete({
|
|
387
387
|
id: "<value>",
|
|
388
388
|
});
|
|
389
|
-
|
|
390
|
-
|
|
391
389
|
}
|
|
392
390
|
|
|
393
391
|
run();
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
### Available Operations
|
|
7
7
|
|
|
8
8
|
* [list](#list) - List License Keys
|
|
9
|
-
* [
|
|
9
|
+
* [get](#get) - Get License Key
|
|
10
10
|
* [update](#update) - Update License Key
|
|
11
11
|
* [getActivation](#getactivation) - Get Activation
|
|
12
12
|
|
|
@@ -25,7 +25,7 @@ const polar = new Polar({
|
|
|
25
25
|
|
|
26
26
|
async function run() {
|
|
27
27
|
const result = await polar.licenseKeys.list({});
|
|
28
|
-
|
|
28
|
+
|
|
29
29
|
for await (const page of result) {
|
|
30
30
|
// Handle the page
|
|
31
31
|
console.log(page);
|
|
@@ -90,7 +90,7 @@ run();
|
|
|
90
90
|
| errors.SDKError | 4xx-5xx | */* |
|
|
91
91
|
|
|
92
92
|
|
|
93
|
-
##
|
|
93
|
+
## get
|
|
94
94
|
|
|
95
95
|
Get a license key.
|
|
96
96
|
|
|
@@ -104,10 +104,10 @@ const polar = new Polar({
|
|
|
104
104
|
});
|
|
105
105
|
|
|
106
106
|
async function run() {
|
|
107
|
-
const result = await polar.licenseKeys.
|
|
107
|
+
const result = await polar.licenseKeys.get({
|
|
108
108
|
id: "<value>",
|
|
109
109
|
});
|
|
110
|
-
|
|
110
|
+
|
|
111
111
|
// Handle the result
|
|
112
112
|
console.log(result)
|
|
113
113
|
}
|
|
@@ -121,7 +121,7 @@ The standalone function version of this method:
|
|
|
121
121
|
|
|
122
122
|
```typescript
|
|
123
123
|
import { PolarCore } from "@polar-sh/sdk/core.js";
|
|
124
|
-
import {
|
|
124
|
+
import { licenseKeysGet } from "@polar-sh/sdk/funcs/licenseKeysGet.js";
|
|
125
125
|
|
|
126
126
|
// Use `PolarCore` for best tree-shaking performance.
|
|
127
127
|
// You can create one instance of it to use across an application.
|
|
@@ -130,7 +130,7 @@ const polar = new PolarCore({
|
|
|
130
130
|
});
|
|
131
131
|
|
|
132
132
|
async function run() {
|
|
133
|
-
const res = await
|
|
133
|
+
const res = await licenseKeysGet(polar, {
|
|
134
134
|
id: "<value>",
|
|
135
135
|
});
|
|
136
136
|
|
|
@@ -188,7 +188,7 @@ async function run() {
|
|
|
188
188
|
id: "<value>",
|
|
189
189
|
licenseKeyUpdate: {},
|
|
190
190
|
});
|
|
191
|
-
|
|
191
|
+
|
|
192
192
|
// Handle the result
|
|
193
193
|
console.log(result)
|
|
194
194
|
}
|
|
@@ -270,7 +270,7 @@ async function run() {
|
|
|
270
270
|
id: "<value>",
|
|
271
271
|
activationId: "<value>",
|
|
272
272
|
});
|
|
273
|
-
|
|
273
|
+
|
|
274
274
|
// Handle the result
|
|
275
275
|
console.log(result)
|
|
276
276
|
}
|
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
|
|
6
6
|
### Available Operations
|
|
7
7
|
|
|
8
|
-
* [
|
|
8
|
+
* [get](#get) - Get Metrics
|
|
9
9
|
* [limits](#limits) - Get Metrics Limits
|
|
10
10
|
|
|
11
|
-
##
|
|
11
|
+
## get
|
|
12
12
|
|
|
13
13
|
Get metrics about your orders and subscriptions.
|
|
14
14
|
|
|
@@ -23,12 +23,12 @@ const polar = new Polar({
|
|
|
23
23
|
});
|
|
24
24
|
|
|
25
25
|
async function run() {
|
|
26
|
-
const result = await polar.metrics.
|
|
27
|
-
startDate: new RFCDate("
|
|
28
|
-
endDate: new RFCDate("
|
|
29
|
-
interval: "
|
|
26
|
+
const result = await polar.metrics.get({
|
|
27
|
+
startDate: new RFCDate("2024-02-07"),
|
|
28
|
+
endDate: new RFCDate("2022-04-09"),
|
|
29
|
+
interval: "week",
|
|
30
30
|
});
|
|
31
|
-
|
|
31
|
+
|
|
32
32
|
// Handle the result
|
|
33
33
|
console.log(result)
|
|
34
34
|
}
|
|
@@ -42,7 +42,7 @@ The standalone function version of this method:
|
|
|
42
42
|
|
|
43
43
|
```typescript
|
|
44
44
|
import { PolarCore } from "@polar-sh/sdk/core.js";
|
|
45
|
-
import {
|
|
45
|
+
import { metricsGet } from "@polar-sh/sdk/funcs/metricsGet.js";
|
|
46
46
|
import { RFCDate } from "@polar-sh/sdk/types";
|
|
47
47
|
|
|
48
48
|
// Use `PolarCore` for best tree-shaking performance.
|
|
@@ -52,10 +52,10 @@ const polar = new PolarCore({
|
|
|
52
52
|
});
|
|
53
53
|
|
|
54
54
|
async function run() {
|
|
55
|
-
const res = await
|
|
56
|
-
startDate: new RFCDate("
|
|
57
|
-
endDate: new RFCDate("
|
|
58
|
-
interval: "
|
|
55
|
+
const res = await metricsGet(polar, {
|
|
56
|
+
startDate: new RFCDate("2023-07-26"),
|
|
57
|
+
endDate: new RFCDate("2022-03-28"),
|
|
58
|
+
interval: "hour",
|
|
59
59
|
});
|
|
60
60
|
|
|
61
61
|
if (!res.ok) {
|
|
@@ -107,7 +107,7 @@ const polar = new Polar({
|
|
|
107
107
|
|
|
108
108
|
async function run() {
|
|
109
109
|
const result = await polar.metrics.limits();
|
|
110
|
-
|
|
110
|
+
|
|
111
111
|
// Handle the result
|
|
112
112
|
console.log(result)
|
|
113
113
|
}
|
|
@@ -30,7 +30,7 @@ async function run() {
|
|
|
30
30
|
code: "<value>",
|
|
31
31
|
redirectUri: "http://multicolored-chivalry.name",
|
|
32
32
|
});
|
|
33
|
-
|
|
33
|
+
|
|
34
34
|
// Handle the result
|
|
35
35
|
console.log(result)
|
|
36
36
|
}
|
|
@@ -112,7 +112,7 @@ async function run() {
|
|
|
112
112
|
clientId: "<value>",
|
|
113
113
|
clientSecret: "<value>",
|
|
114
114
|
});
|
|
115
|
-
|
|
115
|
+
|
|
116
116
|
// Handle the result
|
|
117
117
|
console.log(result)
|
|
118
118
|
}
|
|
@@ -193,7 +193,7 @@ async function run() {
|
|
|
193
193
|
clientId: "<value>",
|
|
194
194
|
clientSecret: "<value>",
|
|
195
195
|
});
|
|
196
|
-
|
|
196
|
+
|
|
197
197
|
// Handle the result
|
|
198
198
|
console.log(result)
|
|
199
199
|
}
|
|
@@ -270,7 +270,7 @@ const polar = new Polar({
|
|
|
270
270
|
|
|
271
271
|
async function run() {
|
|
272
272
|
const result = await polar.oauth2.userinfo();
|
|
273
|
-
|
|
273
|
+
|
|
274
274
|
// Handle the result
|
|
275
275
|
console.log(result)
|
|
276
276
|
}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
### Available Operations
|
|
7
7
|
|
|
8
8
|
* [list](#list) - List Orders
|
|
9
|
-
* [
|
|
9
|
+
* [get](#get) - Get Order
|
|
10
10
|
* [invoice](#invoice) - Get Order Invoice
|
|
11
11
|
|
|
12
12
|
## list
|
|
@@ -24,7 +24,7 @@ const polar = new Polar({
|
|
|
24
24
|
|
|
25
25
|
async function run() {
|
|
26
26
|
const result = await polar.orders.list({});
|
|
27
|
-
|
|
27
|
+
|
|
28
28
|
for await (const page of result) {
|
|
29
29
|
// Handle the page
|
|
30
30
|
console.log(page);
|
|
@@ -87,7 +87,7 @@ run();
|
|
|
87
87
|
| errors.SDKError | 4xx-5xx | */* |
|
|
88
88
|
|
|
89
89
|
|
|
90
|
-
##
|
|
90
|
+
## get
|
|
91
91
|
|
|
92
92
|
Get an order by ID.
|
|
93
93
|
|
|
@@ -101,10 +101,10 @@ const polar = new Polar({
|
|
|
101
101
|
});
|
|
102
102
|
|
|
103
103
|
async function run() {
|
|
104
|
-
const result = await polar.orders.
|
|
104
|
+
const result = await polar.orders.get({
|
|
105
105
|
id: "<value>",
|
|
106
106
|
});
|
|
107
|
-
|
|
107
|
+
|
|
108
108
|
// Handle the result
|
|
109
109
|
console.log(result)
|
|
110
110
|
}
|
|
@@ -118,7 +118,7 @@ The standalone function version of this method:
|
|
|
118
118
|
|
|
119
119
|
```typescript
|
|
120
120
|
import { PolarCore } from "@polar-sh/sdk/core.js";
|
|
121
|
-
import {
|
|
121
|
+
import { ordersGet } from "@polar-sh/sdk/funcs/ordersGet.js";
|
|
122
122
|
|
|
123
123
|
// Use `PolarCore` for best tree-shaking performance.
|
|
124
124
|
// You can create one instance of it to use across an application.
|
|
@@ -127,7 +127,7 @@ const polar = new PolarCore({
|
|
|
127
127
|
});
|
|
128
128
|
|
|
129
129
|
async function run() {
|
|
130
|
-
const res = await
|
|
130
|
+
const res = await ordersGet(polar, {
|
|
131
131
|
id: "<value>",
|
|
132
132
|
});
|
|
133
133
|
|
|
@@ -183,7 +183,7 @@ async function run() {
|
|
|
183
183
|
const result = await polar.orders.invoice({
|
|
184
184
|
id: "<value>",
|
|
185
185
|
});
|
|
186
|
-
|
|
186
|
+
|
|
187
187
|
// Handle the result
|
|
188
188
|
console.log(result)
|
|
189
189
|
}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
* [list](#list) - List Organizations
|
|
9
9
|
* [create](#create) - Create Organization
|
|
10
|
-
* [
|
|
10
|
+
* [get](#get) - Get Organization
|
|
11
11
|
* [update](#update) - Update Organization
|
|
12
12
|
|
|
13
13
|
## list
|
|
@@ -25,7 +25,7 @@ const polar = new Polar({
|
|
|
25
25
|
|
|
26
26
|
async function run() {
|
|
27
27
|
const result = await polar.organizations.list({});
|
|
28
|
-
|
|
28
|
+
|
|
29
29
|
for await (const page of result) {
|
|
30
30
|
// Handle the page
|
|
31
31
|
console.log(page);
|
|
@@ -106,7 +106,7 @@ async function run() {
|
|
|
106
106
|
name: "<value>",
|
|
107
107
|
slug: "<value>",
|
|
108
108
|
});
|
|
109
|
-
|
|
109
|
+
|
|
110
110
|
// Handle the result
|
|
111
111
|
console.log(result)
|
|
112
112
|
}
|
|
@@ -168,7 +168,7 @@ run();
|
|
|
168
168
|
| errors.SDKError | 4xx-5xx | */* |
|
|
169
169
|
|
|
170
170
|
|
|
171
|
-
##
|
|
171
|
+
## get
|
|
172
172
|
|
|
173
173
|
Get an organization by ID.
|
|
174
174
|
|
|
@@ -182,10 +182,10 @@ const polar = new Polar({
|
|
|
182
182
|
});
|
|
183
183
|
|
|
184
184
|
async function run() {
|
|
185
|
-
const result = await polar.organizations.
|
|
185
|
+
const result = await polar.organizations.get({
|
|
186
186
|
id: "<value>",
|
|
187
187
|
});
|
|
188
|
-
|
|
188
|
+
|
|
189
189
|
// Handle the result
|
|
190
190
|
console.log(result)
|
|
191
191
|
}
|
|
@@ -199,7 +199,7 @@ The standalone function version of this method:
|
|
|
199
199
|
|
|
200
200
|
```typescript
|
|
201
201
|
import { PolarCore } from "@polar-sh/sdk/core.js";
|
|
202
|
-
import {
|
|
202
|
+
import { organizationsGet } from "@polar-sh/sdk/funcs/organizationsGet.js";
|
|
203
203
|
|
|
204
204
|
// Use `PolarCore` for best tree-shaking performance.
|
|
205
205
|
// You can create one instance of it to use across an application.
|
|
@@ -208,7 +208,7 @@ const polar = new PolarCore({
|
|
|
208
208
|
});
|
|
209
209
|
|
|
210
210
|
async function run() {
|
|
211
|
-
const res = await
|
|
211
|
+
const res = await organizationsGet(polar, {
|
|
212
212
|
id: "<value>",
|
|
213
213
|
});
|
|
214
214
|
|
|
@@ -265,7 +265,7 @@ async function run() {
|
|
|
265
265
|
id: "<value>",
|
|
266
266
|
organizationUpdate: {},
|
|
267
267
|
});
|
|
268
|
-
|
|
268
|
+
|
|
269
269
|
// Handle the result
|
|
270
270
|
console.log(result)
|
|
271
271
|
}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
* [list](#list) - List Advertisements
|
|
9
9
|
* [create](#create) - Create Advertisement
|
|
10
|
-
* [
|
|
10
|
+
* [get](#get) - Get Advertisement
|
|
11
11
|
* [update](#update) - Update Advertisement
|
|
12
12
|
* [delete](#delete) - Delete Advertisement
|
|
13
13
|
* [enable](#enable) - Enable Advertisement
|
|
@@ -27,7 +27,7 @@ const polar = new Polar({
|
|
|
27
27
|
|
|
28
28
|
async function run() {
|
|
29
29
|
const result = await polar.users.advertisements.list({});
|
|
30
|
-
|
|
30
|
+
|
|
31
31
|
for await (const page of result) {
|
|
32
32
|
// Handle the page
|
|
33
33
|
console.log(page);
|
|
@@ -109,7 +109,7 @@ async function run() {
|
|
|
109
109
|
text: "<value>",
|
|
110
110
|
linkUrl: "http://flashy-cartload.net",
|
|
111
111
|
});
|
|
112
|
-
|
|
112
|
+
|
|
113
113
|
// Handle the result
|
|
114
114
|
console.log(result)
|
|
115
115
|
}
|
|
@@ -172,7 +172,7 @@ run();
|
|
|
172
172
|
| errors.SDKError | 4xx-5xx | */* |
|
|
173
173
|
|
|
174
174
|
|
|
175
|
-
##
|
|
175
|
+
## get
|
|
176
176
|
|
|
177
177
|
Get an advertisement campaign by ID.
|
|
178
178
|
|
|
@@ -186,10 +186,10 @@ const polar = new Polar({
|
|
|
186
186
|
});
|
|
187
187
|
|
|
188
188
|
async function run() {
|
|
189
|
-
const result = await polar.users.advertisements.
|
|
189
|
+
const result = await polar.users.advertisements.get({
|
|
190
190
|
id: "<value>",
|
|
191
191
|
});
|
|
192
|
-
|
|
192
|
+
|
|
193
193
|
// Handle the result
|
|
194
194
|
console.log(result)
|
|
195
195
|
}
|
|
@@ -203,7 +203,7 @@ The standalone function version of this method:
|
|
|
203
203
|
|
|
204
204
|
```typescript
|
|
205
205
|
import { PolarCore } from "@polar-sh/sdk/core.js";
|
|
206
|
-
import {
|
|
206
|
+
import { usersAdvertisementsGet } from "@polar-sh/sdk/funcs/usersAdvertisementsGet.js";
|
|
207
207
|
|
|
208
208
|
// Use `PolarCore` for best tree-shaking performance.
|
|
209
209
|
// You can create one instance of it to use across an application.
|
|
@@ -212,7 +212,7 @@ const polar = new PolarCore({
|
|
|
212
212
|
});
|
|
213
213
|
|
|
214
214
|
async function run() {
|
|
215
|
-
const res = await
|
|
215
|
+
const res = await usersAdvertisementsGet(polar, {
|
|
216
216
|
id: "<value>",
|
|
217
217
|
});
|
|
218
218
|
|
|
@@ -269,7 +269,7 @@ async function run() {
|
|
|
269
269
|
id: "<value>",
|
|
270
270
|
userAdvertisementCampaignUpdate: {},
|
|
271
271
|
});
|
|
272
|
-
|
|
272
|
+
|
|
273
273
|
// Handle the result
|
|
274
274
|
console.log(result)
|
|
275
275
|
}
|
|
@@ -351,7 +351,7 @@ async function run() {
|
|
|
351
351
|
const result = await polar.users.advertisements.delete({
|
|
352
352
|
id: "<value>",
|
|
353
353
|
});
|
|
354
|
-
|
|
354
|
+
|
|
355
355
|
// Handle the result
|
|
356
356
|
console.log(result)
|
|
357
357
|
}
|
|
@@ -433,8 +433,6 @@ async function run() {
|
|
|
433
433
|
benefitId: "<value>",
|
|
434
434
|
},
|
|
435
435
|
});
|
|
436
|
-
|
|
437
|
-
|
|
438
436
|
}
|
|
439
437
|
|
|
440
438
|
run();
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
### Available Operations
|
|
7
7
|
|
|
8
8
|
* [list](#list) - List Benefits
|
|
9
|
-
* [
|
|
9
|
+
* [get](#get) - Get Benefit
|
|
10
10
|
|
|
11
11
|
## list
|
|
12
12
|
|
|
@@ -23,7 +23,7 @@ const polar = new Polar({
|
|
|
23
23
|
|
|
24
24
|
async function run() {
|
|
25
25
|
const result = await polar.users.benefits.list({});
|
|
26
|
-
|
|
26
|
+
|
|
27
27
|
for await (const page of result) {
|
|
28
28
|
// Handle the page
|
|
29
29
|
console.log(page);
|
|
@@ -86,7 +86,7 @@ run();
|
|
|
86
86
|
| errors.SDKError | 4xx-5xx | */* |
|
|
87
87
|
|
|
88
88
|
|
|
89
|
-
##
|
|
89
|
+
## get
|
|
90
90
|
|
|
91
91
|
Get a granted benefit by ID.
|
|
92
92
|
|
|
@@ -100,10 +100,10 @@ const polar = new Polar({
|
|
|
100
100
|
});
|
|
101
101
|
|
|
102
102
|
async function run() {
|
|
103
|
-
const result = await polar.users.benefits.
|
|
103
|
+
const result = await polar.users.benefits.get({
|
|
104
104
|
id: "<value>",
|
|
105
105
|
});
|
|
106
|
-
|
|
106
|
+
|
|
107
107
|
// Handle the result
|
|
108
108
|
console.log(result)
|
|
109
109
|
}
|
|
@@ -117,7 +117,7 @@ The standalone function version of this method:
|
|
|
117
117
|
|
|
118
118
|
```typescript
|
|
119
119
|
import { PolarCore } from "@polar-sh/sdk/core.js";
|
|
120
|
-
import {
|
|
120
|
+
import { usersBenefitsGet } from "@polar-sh/sdk/funcs/usersBenefitsGet.js";
|
|
121
121
|
|
|
122
122
|
// Use `PolarCore` for best tree-shaking performance.
|
|
123
123
|
// You can create one instance of it to use across an application.
|
|
@@ -126,7 +126,7 @@ const polar = new PolarCore({
|
|
|
126
126
|
});
|
|
127
127
|
|
|
128
128
|
async function run() {
|
|
129
|
-
const res = await
|
|
129
|
+
const res = await usersBenefitsGet(polar, {
|
|
130
130
|
id: "<value>",
|
|
131
131
|
});
|
|
132
132
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
### Available Operations
|
|
7
7
|
|
|
8
8
|
* [list](#list) - List License Keys
|
|
9
|
-
* [
|
|
9
|
+
* [get](#get) - Get License Key
|
|
10
10
|
* [validate](#validate) - Validate License Key
|
|
11
11
|
* [activate](#activate) - Activate License Key
|
|
12
12
|
* [deactivate](#deactivate) - Deactivate License Key
|
|
@@ -26,7 +26,7 @@ const polar = new Polar({
|
|
|
26
26
|
|
|
27
27
|
async function run() {
|
|
28
28
|
const result = await polar.users.licenseKeys.list({});
|
|
29
|
-
|
|
29
|
+
|
|
30
30
|
for await (const page of result) {
|
|
31
31
|
// Handle the page
|
|
32
32
|
console.log(page);
|
|
@@ -91,7 +91,7 @@ run();
|
|
|
91
91
|
| errors.SDKError | 4xx-5xx | */* |
|
|
92
92
|
|
|
93
93
|
|
|
94
|
-
##
|
|
94
|
+
## get
|
|
95
95
|
|
|
96
96
|
Get a license key.
|
|
97
97
|
|
|
@@ -105,10 +105,10 @@ const polar = new Polar({
|
|
|
105
105
|
});
|
|
106
106
|
|
|
107
107
|
async function run() {
|
|
108
|
-
const result = await polar.users.licenseKeys.
|
|
108
|
+
const result = await polar.users.licenseKeys.get({
|
|
109
109
|
id: "<value>",
|
|
110
110
|
});
|
|
111
|
-
|
|
111
|
+
|
|
112
112
|
// Handle the result
|
|
113
113
|
console.log(result)
|
|
114
114
|
}
|
|
@@ -122,7 +122,7 @@ The standalone function version of this method:
|
|
|
122
122
|
|
|
123
123
|
```typescript
|
|
124
124
|
import { PolarCore } from "@polar-sh/sdk/core.js";
|
|
125
|
-
import {
|
|
125
|
+
import { usersLicenseKeysGet } from "@polar-sh/sdk/funcs/usersLicenseKeysGet.js";
|
|
126
126
|
|
|
127
127
|
// Use `PolarCore` for best tree-shaking performance.
|
|
128
128
|
// You can create one instance of it to use across an application.
|
|
@@ -131,7 +131,7 @@ const polar = new PolarCore({
|
|
|
131
131
|
});
|
|
132
132
|
|
|
133
133
|
async function run() {
|
|
134
|
-
const res = await
|
|
134
|
+
const res = await usersLicenseKeysGet(polar, {
|
|
135
135
|
id: "<value>",
|
|
136
136
|
});
|
|
137
137
|
|
|
@@ -189,7 +189,7 @@ async function run() {
|
|
|
189
189
|
key: "<key>",
|
|
190
190
|
organizationId: "<value>",
|
|
191
191
|
});
|
|
192
|
-
|
|
192
|
+
|
|
193
193
|
// Handle the result
|
|
194
194
|
console.log(result)
|
|
195
195
|
}
|
|
@@ -271,7 +271,7 @@ async function run() {
|
|
|
271
271
|
organizationId: "<value>",
|
|
272
272
|
label: "<value>",
|
|
273
273
|
});
|
|
274
|
-
|
|
274
|
+
|
|
275
275
|
// Handle the result
|
|
276
276
|
console.log(result)
|
|
277
277
|
}
|
|
@@ -355,8 +355,6 @@ async function run() {
|
|
|
355
355
|
organizationId: "<value>",
|
|
356
356
|
activationId: "<value>",
|
|
357
357
|
});
|
|
358
|
-
|
|
359
|
-
|
|
360
358
|
}
|
|
361
359
|
|
|
362
360
|
run();
|