@parra/parra-js-sdk 0.3.408 → 0.3.409
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/dist/ParraAPI.d.ts +20 -0
- package/dist/ParraAPI.js +6 -0
- package/package.json +3 -3
package/dist/ParraAPI.d.ts
CHANGED
@@ -151,6 +151,7 @@ export interface ReleaseStub {
|
|
151
151
|
release_number: number;
|
152
152
|
status: ReleaseStatus;
|
153
153
|
header?: ReleaseHeader | null;
|
154
|
+
released_at?: string | null;
|
154
155
|
}
|
155
156
|
export interface AppReleaseStub {
|
156
157
|
id: string;
|
@@ -165,6 +166,7 @@ export interface AppReleaseStub {
|
|
165
166
|
release_number: number;
|
166
167
|
status: ReleaseStatus;
|
167
168
|
header?: ReleaseHeader | null;
|
169
|
+
released_at?: string | null;
|
168
170
|
}
|
169
171
|
export interface AppRelease {
|
170
172
|
id: string;
|
@@ -179,6 +181,7 @@ export interface AppRelease {
|
|
179
181
|
release_number: number;
|
180
182
|
status: ReleaseStatus;
|
181
183
|
header?: ReleaseHeader | null;
|
184
|
+
released_at?: string | null;
|
182
185
|
sections: Array<AppReleaseSection>;
|
183
186
|
}
|
184
187
|
export interface NewInstalledVersionInfo {
|
@@ -770,6 +773,8 @@ export interface UserEntitlement {
|
|
770
773
|
key: string;
|
771
774
|
title: string;
|
772
775
|
note?: string | null;
|
776
|
+
quantity_available?: number | null;
|
777
|
+
quantity_consumed?: number | null;
|
773
778
|
}
|
774
779
|
export interface AppPurchaseResponseBody {
|
775
780
|
entitlements: Array<UserEntitlement>;
|
@@ -778,6 +783,11 @@ export interface CreateUserEntitlementRequestBody {
|
|
778
783
|
entitlement_ids?: Array<string>;
|
779
784
|
note?: string | null;
|
780
785
|
}
|
786
|
+
export interface ConsumeEntitlementRequestBody {
|
787
|
+
quantity: number;
|
788
|
+
note?: string | null;
|
789
|
+
metadata?: object | null;
|
790
|
+
}
|
781
791
|
export declare enum BillingSourceType {
|
782
792
|
stripe = "stripe",
|
783
793
|
paypal = "paypal",
|
@@ -845,6 +855,8 @@ export interface CreateEntitlementRequestBody {
|
|
845
855
|
title?: string;
|
846
856
|
key?: string;
|
847
857
|
description?: string | null;
|
858
|
+
is_consumable?: boolean;
|
859
|
+
is_free?: boolean;
|
848
860
|
}
|
849
861
|
export interface ProductEntitlementProductStub {
|
850
862
|
id: string;
|
@@ -852,6 +864,7 @@ export interface ProductEntitlementProductStub {
|
|
852
864
|
key: string;
|
853
865
|
product_id: string;
|
854
866
|
entitlement_id: string;
|
867
|
+
consumable_quantity?: number | null;
|
855
868
|
}
|
856
869
|
export interface Entitlement {
|
857
870
|
id: string;
|
@@ -864,6 +877,7 @@ export interface Entitlement {
|
|
864
877
|
description?: string | null;
|
865
878
|
disabled: boolean;
|
866
879
|
is_free: boolean;
|
880
|
+
is_consumable: boolean;
|
867
881
|
products?: Array<ProductEntitlementProductStub> | null;
|
868
882
|
}
|
869
883
|
export interface UpdateProductRequestBody {
|
@@ -882,6 +896,7 @@ export interface ProductEntitlement {
|
|
882
896
|
key: string;
|
883
897
|
product_id: string;
|
884
898
|
entitlement_id: string;
|
899
|
+
consumable_quantity?: number | null;
|
885
900
|
}
|
886
901
|
export interface Product {
|
887
902
|
id: string;
|
@@ -897,6 +912,7 @@ export interface Product {
|
|
897
912
|
}
|
898
913
|
export interface CreateProductEntitlementRequestBody {
|
899
914
|
entitlement_id: string;
|
915
|
+
consumable_quantity?: number | null;
|
900
916
|
}
|
901
917
|
export interface AppFaq {
|
902
918
|
id: string;
|
@@ -1313,6 +1329,8 @@ export interface EntitlementStub {
|
|
1313
1329
|
id: string;
|
1314
1330
|
title: string;
|
1315
1331
|
key: string;
|
1332
|
+
is_consumable: boolean;
|
1333
|
+
is_free: boolean;
|
1316
1334
|
}
|
1317
1335
|
export interface AppPaywallConfiguration {
|
1318
1336
|
context?: string | null;
|
@@ -2418,6 +2436,7 @@ export interface Release {
|
|
2418
2436
|
release_number: number;
|
2419
2437
|
status: ReleaseStatus;
|
2420
2438
|
header?: ReleaseHeader | null;
|
2439
|
+
released_at?: string | null;
|
2421
2440
|
items?: Array<ReleaseItem> | null;
|
2422
2441
|
}
|
2423
2442
|
export interface ReleaseCollectionResponse {
|
@@ -4208,6 +4227,7 @@ declare class ParraAPI {
|
|
4208
4227
|
createPurchaseForTenantApplication: (tenant_id: string, application_id: string, body?: CreateAppPurchaseRequestBody, options?: Options) => Promise<AppPurchaseResponseBody>;
|
4209
4228
|
createEntitlementForTenantUserById: (tenant_id: string, user_id: string, body: CreateUserEntitlementRequestBody, options?: Options) => Promise<Response>;
|
4210
4229
|
listEntitlementsForTenantUserById: (tenant_id: string, user_id: string, options?: Options) => Promise<Array<UserEntitlement>>;
|
4230
|
+
consumeEntitlementForTenantUserById: (tenant_id: string, user_id: string, entitlement_id_or_key: string, body: ConsumeEntitlementRequestBody, options?: Options) => Promise<Array<UserEntitlement>>;
|
4211
4231
|
createBillingSource: (tenant_id: string, body: CreateBillingSourceRequestBody, options?: Options) => Promise<BillingSource>;
|
4212
4232
|
listBillingSources: (tenant_id: string, options?: Options) => Promise<Array<BillingSource>>;
|
4213
4233
|
getBillingSourceById: (tenant_id: string, billing_source_id: string, options?: Options) => Promise<BillingSource>;
|
package/dist/ParraAPI.js
CHANGED
@@ -582,6 +582,12 @@ var ParraAPI = /** @class */ (function () {
|
|
582
582
|
if (options === void 0) { options = {}; }
|
583
583
|
return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/users/").concat(user_id, "/entitlements"), __assign({ method: "get" }, options));
|
584
584
|
};
|
585
|
+
this.consumeEntitlementForTenantUserById = function (tenant_id, user_id, entitlement_id_or_key, body, options) {
|
586
|
+
if (options === void 0) { options = {}; }
|
587
|
+
return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/users/").concat(user_id, "/entitlements/").concat(entitlement_id_or_key, "/consume"), __assign({ method: "post", body: JSON.stringify(body), headers: {
|
588
|
+
"content-type": "application/json",
|
589
|
+
} }, options));
|
590
|
+
};
|
585
591
|
this.createBillingSource = function (tenant_id, body, options) {
|
586
592
|
if (options === void 0) { options = {}; }
|
587
593
|
return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/billing/sources"), __assign({ method: "post", body: JSON.stringify(body), headers: {
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@parra/parra-js-sdk",
|
3
|
-
"version": "0.3.
|
3
|
+
"version": "0.3.409",
|
4
4
|
"description": "",
|
5
5
|
"main": "dist/index.js",
|
6
6
|
"types": "dist/index.d.ts",
|
@@ -18,9 +18,9 @@
|
|
18
18
|
"author": "Parra",
|
19
19
|
"license": "ISC",
|
20
20
|
"devDependencies": {
|
21
|
-
"@types/node": "^22.
|
21
|
+
"@types/node": "^22.10.9",
|
22
22
|
"prettier": "^3.3.3",
|
23
|
-
"typescript": "^5.
|
23
|
+
"typescript": "^5.7.3"
|
24
24
|
},
|
25
25
|
"dependencies": {
|
26
26
|
"@parra/http-client": "0.5.8"
|