@parra/parra-js-sdk 0.3.408 → 0.3.410
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 +24 -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,9 @@ export interface ProductEntitlementProductStub {
|
|
852
864
|
key: string;
|
853
865
|
product_id: string;
|
854
866
|
entitlement_id: string;
|
867
|
+
is_consumable: boolean;
|
868
|
+
is_free: boolean;
|
869
|
+
consumable_quantity?: number | null;
|
855
870
|
}
|
856
871
|
export interface Entitlement {
|
857
872
|
id: string;
|
@@ -864,6 +879,7 @@ export interface Entitlement {
|
|
864
879
|
description?: string | null;
|
865
880
|
disabled: boolean;
|
866
881
|
is_free: boolean;
|
882
|
+
is_consumable: boolean;
|
867
883
|
products?: Array<ProductEntitlementProductStub> | null;
|
868
884
|
}
|
869
885
|
export interface UpdateProductRequestBody {
|
@@ -882,6 +898,9 @@ export interface ProductEntitlement {
|
|
882
898
|
key: string;
|
883
899
|
product_id: string;
|
884
900
|
entitlement_id: string;
|
901
|
+
is_consumable: boolean;
|
902
|
+
is_free: boolean;
|
903
|
+
consumable_quantity?: number | null;
|
885
904
|
}
|
886
905
|
export interface Product {
|
887
906
|
id: string;
|
@@ -897,6 +916,7 @@ export interface Product {
|
|
897
916
|
}
|
898
917
|
export interface CreateProductEntitlementRequestBody {
|
899
918
|
entitlement_id: string;
|
919
|
+
consumable_quantity?: number | null;
|
900
920
|
}
|
901
921
|
export interface AppFaq {
|
902
922
|
id: string;
|
@@ -1313,6 +1333,8 @@ export interface EntitlementStub {
|
|
1313
1333
|
id: string;
|
1314
1334
|
title: string;
|
1315
1335
|
key: string;
|
1336
|
+
is_consumable: boolean;
|
1337
|
+
is_free: boolean;
|
1316
1338
|
}
|
1317
1339
|
export interface AppPaywallConfiguration {
|
1318
1340
|
context?: string | null;
|
@@ -2418,6 +2440,7 @@ export interface Release {
|
|
2418
2440
|
release_number: number;
|
2419
2441
|
status: ReleaseStatus;
|
2420
2442
|
header?: ReleaseHeader | null;
|
2443
|
+
released_at?: string | null;
|
2421
2444
|
items?: Array<ReleaseItem> | null;
|
2422
2445
|
}
|
2423
2446
|
export interface ReleaseCollectionResponse {
|
@@ -4208,6 +4231,7 @@ declare class ParraAPI {
|
|
4208
4231
|
createPurchaseForTenantApplication: (tenant_id: string, application_id: string, body?: CreateAppPurchaseRequestBody, options?: Options) => Promise<AppPurchaseResponseBody>;
|
4209
4232
|
createEntitlementForTenantUserById: (tenant_id: string, user_id: string, body: CreateUserEntitlementRequestBody, options?: Options) => Promise<Response>;
|
4210
4233
|
listEntitlementsForTenantUserById: (tenant_id: string, user_id: string, options?: Options) => Promise<Array<UserEntitlement>>;
|
4234
|
+
consumeEntitlementForTenantUserById: (tenant_id: string, user_id: string, entitlement_id_or_key: string, body: ConsumeEntitlementRequestBody, options?: Options) => Promise<Array<UserEntitlement>>;
|
4211
4235
|
createBillingSource: (tenant_id: string, body: CreateBillingSourceRequestBody, options?: Options) => Promise<BillingSource>;
|
4212
4236
|
listBillingSources: (tenant_id: string, options?: Options) => Promise<Array<BillingSource>>;
|
4213
4237
|
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.410",
|
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"
|