@jibb-open/jssdk 3.18.2 → 3.18.3
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/package.json +1 -1
- package/types/jibb.pb.js +758 -26
- package/types/proto.js +2 -1
package/package.json
CHANGED
package/types/jibb.pb.js
CHANGED
|
@@ -3199,10 +3199,9 @@ export const user = $root.user = (() => {
|
|
|
3199
3199
|
user.Level = function () {
|
|
3200
3200
|
const valuesById = {},
|
|
3201
3201
|
values = Object.create(valuesById);
|
|
3202
|
-
values[valuesById[0] = "
|
|
3203
|
-
values[valuesById[1] = "
|
|
3204
|
-
values[valuesById[
|
|
3205
|
-
values[valuesById[4] = "BUSINESS"] = 4;
|
|
3202
|
+
values[valuesById[0] = "UNKNOWN_USER"] = 0;
|
|
3203
|
+
values[valuesById[1] = "PRO"] = 1;
|
|
3204
|
+
values[valuesById[2] = "BUSINESS"] = 2;
|
|
3206
3205
|
values[valuesById[5] = "ENTERPRISE"] = 5;
|
|
3207
3206
|
return values;
|
|
3208
3207
|
}();
|
|
@@ -3223,6 +3222,20 @@ export const user = $root.user = (() => {
|
|
|
3223
3222
|
values[valuesById[2] = "CLOUD"] = 2;
|
|
3224
3223
|
return values;
|
|
3225
3224
|
}();
|
|
3225
|
+
user.SubscriptionStatus = function () {
|
|
3226
|
+
const valuesById = {},
|
|
3227
|
+
values = Object.create(valuesById);
|
|
3228
|
+
values[valuesById[0] = "UNKNOWN_STATUS"] = 0;
|
|
3229
|
+
values[valuesById[1] = "TRIALING"] = 1;
|
|
3230
|
+
values[valuesById[2] = "ACTIVE"] = 2;
|
|
3231
|
+
values[valuesById[3] = "INCOMPLETE"] = 3;
|
|
3232
|
+
values[valuesById[4] = "INCOMPLETE_EXPIRED"] = 4;
|
|
3233
|
+
values[valuesById[5] = "PAST_DUE"] = 5;
|
|
3234
|
+
values[valuesById[6] = "CANCELED"] = 6;
|
|
3235
|
+
values[valuesById[7] = "UNPAID"] = 7;
|
|
3236
|
+
values[valuesById[8] = "PAUSED"] = 8;
|
|
3237
|
+
return values;
|
|
3238
|
+
}();
|
|
3226
3239
|
user.UserDetails = function () {
|
|
3227
3240
|
function UserDetails(p) {
|
|
3228
3241
|
if (p) for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) if (p[ks[i]] != null) this[ks[i]] = p[ks[i]];
|
|
@@ -3237,6 +3250,7 @@ export const user = $root.user = (() => {
|
|
|
3237
3250
|
UserDetails.prototype.userId = "";
|
|
3238
3251
|
UserDetails.prototype.email = "";
|
|
3239
3252
|
UserDetails.prototype.lastLogin = null;
|
|
3253
|
+
UserDetails.prototype.fileManagerEnabled = false;
|
|
3240
3254
|
UserDetails.create = function create(properties) {
|
|
3241
3255
|
return new UserDetails(properties);
|
|
3242
3256
|
};
|
|
@@ -3252,6 +3266,7 @@ export const user = $root.user = (() => {
|
|
|
3252
3266
|
if (m.userId != null && Object.hasOwnProperty.call(m, "userId")) w.uint32(74).string(m.userId);
|
|
3253
3267
|
if (m.email != null && Object.hasOwnProperty.call(m, "email")) w.uint32(82).string(m.email);
|
|
3254
3268
|
if (m.lastLogin != null && Object.hasOwnProperty.call(m, "lastLogin")) $root.google.protobuf.Timestamp.encode(m.lastLogin, w.uint32(90).fork()).ldelim();
|
|
3269
|
+
if (m.fileManagerEnabled != null && Object.hasOwnProperty.call(m, "fileManagerEnabled")) w.uint32(96).bool(m.fileManagerEnabled);
|
|
3255
3270
|
return w;
|
|
3256
3271
|
};
|
|
3257
3272
|
UserDetails.encodeDelimited = function encodeDelimited(message, writer) {
|
|
@@ -3294,6 +3309,9 @@ export const user = $root.user = (() => {
|
|
|
3294
3309
|
case 11:
|
|
3295
3310
|
m.lastLogin = $root.google.protobuf.Timestamp.decode(r, r.uint32());
|
|
3296
3311
|
break;
|
|
3312
|
+
case 12:
|
|
3313
|
+
m.fileManagerEnabled = r.bool();
|
|
3314
|
+
break;
|
|
3297
3315
|
default:
|
|
3298
3316
|
r.skipType(t & 7);
|
|
3299
3317
|
break;
|
|
@@ -3316,8 +3334,7 @@ export const user = $root.user = (() => {
|
|
|
3316
3334
|
return "level: enum value expected";
|
|
3317
3335
|
case 0:
|
|
3318
3336
|
case 1:
|
|
3319
|
-
case
|
|
3320
|
-
case 4:
|
|
3337
|
+
case 2:
|
|
3321
3338
|
case 5:
|
|
3322
3339
|
break;
|
|
3323
3340
|
}
|
|
@@ -3357,6 +3374,9 @@ export const user = $root.user = (() => {
|
|
|
3357
3374
|
if (e) return "lastLogin." + e;
|
|
3358
3375
|
}
|
|
3359
3376
|
}
|
|
3377
|
+
if (m.fileManagerEnabled != null && m.hasOwnProperty("fileManagerEnabled")) {
|
|
3378
|
+
if (typeof m.fileManagerEnabled !== "boolean") return "fileManagerEnabled: boolean expected";
|
|
3379
|
+
}
|
|
3360
3380
|
return null;
|
|
3361
3381
|
};
|
|
3362
3382
|
UserDetails.fromObject = function fromObject(d) {
|
|
@@ -3366,21 +3386,17 @@ export const user = $root.user = (() => {
|
|
|
3366
3386
|
m.organizationName = String(d.organizationName);
|
|
3367
3387
|
}
|
|
3368
3388
|
switch (d.level) {
|
|
3369
|
-
case "
|
|
3389
|
+
case "UNKNOWN_USER":
|
|
3370
3390
|
case 0:
|
|
3371
3391
|
m.level = 0;
|
|
3372
3392
|
break;
|
|
3373
|
-
case "
|
|
3393
|
+
case "PRO":
|
|
3374
3394
|
case 1:
|
|
3375
3395
|
m.level = 1;
|
|
3376
3396
|
break;
|
|
3377
|
-
case "PRO":
|
|
3378
|
-
case 3:
|
|
3379
|
-
m.level = 3;
|
|
3380
|
-
break;
|
|
3381
3397
|
case "BUSINESS":
|
|
3382
|
-
case
|
|
3383
|
-
m.level =
|
|
3398
|
+
case 2:
|
|
3399
|
+
m.level = 2;
|
|
3384
3400
|
break;
|
|
3385
3401
|
case "ENTERPRISE":
|
|
3386
3402
|
case 5:
|
|
@@ -3427,6 +3443,9 @@ export const user = $root.user = (() => {
|
|
|
3427
3443
|
if (typeof d.lastLogin !== "object") throw TypeError(".user.UserDetails.lastLogin: object expected");
|
|
3428
3444
|
m.lastLogin = $root.google.protobuf.Timestamp.fromObject(d.lastLogin);
|
|
3429
3445
|
}
|
|
3446
|
+
if (d.fileManagerEnabled != null) {
|
|
3447
|
+
m.fileManagerEnabled = Boolean(d.fileManagerEnabled);
|
|
3448
|
+
}
|
|
3430
3449
|
return m;
|
|
3431
3450
|
};
|
|
3432
3451
|
UserDetails.toObject = function toObject(m, o) {
|
|
@@ -3434,7 +3453,7 @@ export const user = $root.user = (() => {
|
|
|
3434
3453
|
var d = {};
|
|
3435
3454
|
if (o.defaults) {
|
|
3436
3455
|
d.organizationName = "";
|
|
3437
|
-
d.level = o.enums === String ? "
|
|
3456
|
+
d.level = o.enums === String ? "UNKNOWN_USER" : 0;
|
|
3438
3457
|
d.firstName = "";
|
|
3439
3458
|
d.lastName = "";
|
|
3440
3459
|
d.organizationId = 0;
|
|
@@ -3443,6 +3462,7 @@ export const user = $root.user = (() => {
|
|
|
3443
3462
|
d.userId = "";
|
|
3444
3463
|
d.email = "";
|
|
3445
3464
|
d.lastLogin = null;
|
|
3465
|
+
d.fileManagerEnabled = false;
|
|
3446
3466
|
}
|
|
3447
3467
|
if (m.organizationName != null && m.hasOwnProperty("organizationName")) {
|
|
3448
3468
|
d.organizationName = m.organizationName;
|
|
@@ -3474,6 +3494,9 @@ export const user = $root.user = (() => {
|
|
|
3474
3494
|
if (m.lastLogin != null && m.hasOwnProperty("lastLogin")) {
|
|
3475
3495
|
d.lastLogin = $root.google.protobuf.Timestamp.toObject(m.lastLogin, o);
|
|
3476
3496
|
}
|
|
3497
|
+
if (m.fileManagerEnabled != null && m.hasOwnProperty("fileManagerEnabled")) {
|
|
3498
|
+
d.fileManagerEnabled = m.fileManagerEnabled;
|
|
3499
|
+
}
|
|
3477
3500
|
return d;
|
|
3478
3501
|
};
|
|
3479
3502
|
UserDetails.prototype.toJSON = function toJSON() {
|
|
@@ -3498,6 +3521,7 @@ export const user = $root.user = (() => {
|
|
|
3498
3521
|
OrganizationDetails.prototype.deviceLicenseCount = 0;
|
|
3499
3522
|
OrganizationDetails.prototype.devicesCount = 0;
|
|
3500
3523
|
OrganizationDetails.prototype.imageCollection = false;
|
|
3524
|
+
OrganizationDetails.prototype.fileManagerEnabled = false;
|
|
3501
3525
|
OrganizationDetails.create = function create(properties) {
|
|
3502
3526
|
return new OrganizationDetails(properties);
|
|
3503
3527
|
};
|
|
@@ -3516,6 +3540,7 @@ export const user = $root.user = (() => {
|
|
|
3516
3540
|
if (m.devicesCount != null && Object.hasOwnProperty.call(m, "devicesCount")) w.uint32(88).int32(m.devicesCount);
|
|
3517
3541
|
if (m.startDate != null && Object.hasOwnProperty.call(m, "startDate")) $root.google.protobuf.Timestamp.encode(m.startDate, w.uint32(98).fork()).ldelim();
|
|
3518
3542
|
if (m.imageCollection != null && Object.hasOwnProperty.call(m, "imageCollection")) w.uint32(112).bool(m.imageCollection);
|
|
3543
|
+
if (m.fileManagerEnabled != null && Object.hasOwnProperty.call(m, "fileManagerEnabled")) w.uint32(120).bool(m.fileManagerEnabled);
|
|
3519
3544
|
return w;
|
|
3520
3545
|
};
|
|
3521
3546
|
OrganizationDetails.encodeDelimited = function encodeDelimited(message, writer) {
|
|
@@ -3567,6 +3592,9 @@ export const user = $root.user = (() => {
|
|
|
3567
3592
|
case 14:
|
|
3568
3593
|
m.imageCollection = r.bool();
|
|
3569
3594
|
break;
|
|
3595
|
+
case 15:
|
|
3596
|
+
m.fileManagerEnabled = r.bool();
|
|
3597
|
+
break;
|
|
3570
3598
|
default:
|
|
3571
3599
|
r.skipType(t & 7);
|
|
3572
3600
|
break;
|
|
@@ -3592,8 +3620,7 @@ export const user = $root.user = (() => {
|
|
|
3592
3620
|
return "level: enum value expected";
|
|
3593
3621
|
case 0:
|
|
3594
3622
|
case 1:
|
|
3595
|
-
case
|
|
3596
|
-
case 4:
|
|
3623
|
+
case 2:
|
|
3597
3624
|
case 5:
|
|
3598
3625
|
break;
|
|
3599
3626
|
}
|
|
@@ -3637,6 +3664,9 @@ export const user = $root.user = (() => {
|
|
|
3637
3664
|
if (m.imageCollection != null && m.hasOwnProperty("imageCollection")) {
|
|
3638
3665
|
if (typeof m.imageCollection !== "boolean") return "imageCollection: boolean expected";
|
|
3639
3666
|
}
|
|
3667
|
+
if (m.fileManagerEnabled != null && m.hasOwnProperty("fileManagerEnabled")) {
|
|
3668
|
+
if (typeof m.fileManagerEnabled !== "boolean") return "fileManagerEnabled: boolean expected";
|
|
3669
|
+
}
|
|
3640
3670
|
return null;
|
|
3641
3671
|
};
|
|
3642
3672
|
OrganizationDetails.fromObject = function fromObject(d) {
|
|
@@ -3649,21 +3679,17 @@ export const user = $root.user = (() => {
|
|
|
3649
3679
|
m.ownerEmail = String(d.ownerEmail);
|
|
3650
3680
|
}
|
|
3651
3681
|
switch (d.level) {
|
|
3652
|
-
case "
|
|
3682
|
+
case "UNKNOWN_USER":
|
|
3653
3683
|
case 0:
|
|
3654
3684
|
m.level = 0;
|
|
3655
3685
|
break;
|
|
3656
|
-
case "
|
|
3686
|
+
case "PRO":
|
|
3657
3687
|
case 1:
|
|
3658
3688
|
m.level = 1;
|
|
3659
3689
|
break;
|
|
3660
|
-
case "PRO":
|
|
3661
|
-
case 3:
|
|
3662
|
-
m.level = 3;
|
|
3663
|
-
break;
|
|
3664
3690
|
case "BUSINESS":
|
|
3665
|
-
case
|
|
3666
|
-
m.level =
|
|
3691
|
+
case 2:
|
|
3692
|
+
m.level = 2;
|
|
3667
3693
|
break;
|
|
3668
3694
|
case "ENTERPRISE":
|
|
3669
3695
|
case 5:
|
|
@@ -3703,6 +3729,9 @@ export const user = $root.user = (() => {
|
|
|
3703
3729
|
if (d.imageCollection != null) {
|
|
3704
3730
|
m.imageCollection = Boolean(d.imageCollection);
|
|
3705
3731
|
}
|
|
3732
|
+
if (d.fileManagerEnabled != null) {
|
|
3733
|
+
m.fileManagerEnabled = Boolean(d.fileManagerEnabled);
|
|
3734
|
+
}
|
|
3706
3735
|
return m;
|
|
3707
3736
|
};
|
|
3708
3737
|
OrganizationDetails.toObject = function toObject(m, o) {
|
|
@@ -3711,7 +3740,7 @@ export const user = $root.user = (() => {
|
|
|
3711
3740
|
if (o.defaults) {
|
|
3712
3741
|
d.name = "";
|
|
3713
3742
|
d.ownerEmail = "";
|
|
3714
|
-
d.level = o.enums === String ? "
|
|
3743
|
+
d.level = o.enums === String ? "UNKNOWN_USER" : 0;
|
|
3715
3744
|
d.licenseCount = 0;
|
|
3716
3745
|
d.usersCount = 0;
|
|
3717
3746
|
d.creationDate = null;
|
|
@@ -3722,6 +3751,7 @@ export const user = $root.user = (() => {
|
|
|
3722
3751
|
d.devicesCount = 0;
|
|
3723
3752
|
d.startDate = null;
|
|
3724
3753
|
d.imageCollection = false;
|
|
3754
|
+
d.fileManagerEnabled = false;
|
|
3725
3755
|
}
|
|
3726
3756
|
if (m.name != null && m.hasOwnProperty("name")) {
|
|
3727
3757
|
d.name = m.name;
|
|
@@ -3762,6 +3792,9 @@ export const user = $root.user = (() => {
|
|
|
3762
3792
|
if (m.imageCollection != null && m.hasOwnProperty("imageCollection")) {
|
|
3763
3793
|
d.imageCollection = m.imageCollection;
|
|
3764
3794
|
}
|
|
3795
|
+
if (m.fileManagerEnabled != null && m.hasOwnProperty("fileManagerEnabled")) {
|
|
3796
|
+
d.fileManagerEnabled = m.fileManagerEnabled;
|
|
3797
|
+
}
|
|
3765
3798
|
return d;
|
|
3766
3799
|
};
|
|
3767
3800
|
OrganizationDetails.prototype.toJSON = function toJSON() {
|
|
@@ -3769,6 +3802,705 @@ export const user = $root.user = (() => {
|
|
|
3769
3802
|
};
|
|
3770
3803
|
return OrganizationDetails;
|
|
3771
3804
|
}();
|
|
3805
|
+
user.Plan = function () {
|
|
3806
|
+
function Plan(p) {
|
|
3807
|
+
this.prices = [];
|
|
3808
|
+
if (p) for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) if (p[ks[i]] != null) this[ks[i]] = p[ks[i]];
|
|
3809
|
+
}
|
|
3810
|
+
Plan.prototype.id = "";
|
|
3811
|
+
Plan.prototype.name = "";
|
|
3812
|
+
Plan.prototype.prices = $util.emptyArray;
|
|
3813
|
+
Plan.create = function create(properties) {
|
|
3814
|
+
return new Plan(properties);
|
|
3815
|
+
};
|
|
3816
|
+
Plan.encode = function encode(m, w) {
|
|
3817
|
+
if (!w) w = $Writer.create();
|
|
3818
|
+
if (m.id != null && Object.hasOwnProperty.call(m, "id")) w.uint32(10).string(m.id);
|
|
3819
|
+
if (m.name != null && Object.hasOwnProperty.call(m, "name")) w.uint32(18).string(m.name);
|
|
3820
|
+
if (m.prices != null && m.prices.length) {
|
|
3821
|
+
for (var i = 0; i < m.prices.length; ++i) $root.user.PriceItem.encode(m.prices[i], w.uint32(26).fork()).ldelim();
|
|
3822
|
+
}
|
|
3823
|
+
return w;
|
|
3824
|
+
};
|
|
3825
|
+
Plan.encodeDelimited = function encodeDelimited(message, writer) {
|
|
3826
|
+
return this.encode(message, writer).ldelim();
|
|
3827
|
+
};
|
|
3828
|
+
Plan.decode = function decode(r, l) {
|
|
3829
|
+
if (!(r instanceof $Reader)) r = $Reader.create(r);
|
|
3830
|
+
var c = l === undefined ? r.len : r.pos + l,
|
|
3831
|
+
m = new $root.user.Plan();
|
|
3832
|
+
while (r.pos < c) {
|
|
3833
|
+
var t = r.uint32();
|
|
3834
|
+
switch (t >>> 3) {
|
|
3835
|
+
case 1:
|
|
3836
|
+
m.id = r.string();
|
|
3837
|
+
break;
|
|
3838
|
+
case 2:
|
|
3839
|
+
m.name = r.string();
|
|
3840
|
+
break;
|
|
3841
|
+
case 3:
|
|
3842
|
+
if (!(m.prices && m.prices.length)) m.prices = [];
|
|
3843
|
+
m.prices.push($root.user.PriceItem.decode(r, r.uint32()));
|
|
3844
|
+
break;
|
|
3845
|
+
default:
|
|
3846
|
+
r.skipType(t & 7);
|
|
3847
|
+
break;
|
|
3848
|
+
}
|
|
3849
|
+
}
|
|
3850
|
+
return m;
|
|
3851
|
+
};
|
|
3852
|
+
Plan.decodeDelimited = function decodeDelimited(reader) {
|
|
3853
|
+
if (!(reader instanceof $Reader)) reader = new $Reader(reader);
|
|
3854
|
+
return this.decode(reader, reader.uint32());
|
|
3855
|
+
};
|
|
3856
|
+
Plan.verify = function verify(m) {
|
|
3857
|
+
if (typeof m !== "object" || m === null) return "object expected";
|
|
3858
|
+
if (m.id != null && m.hasOwnProperty("id")) {
|
|
3859
|
+
if (!$util.isString(m.id)) return "id: string expected";
|
|
3860
|
+
}
|
|
3861
|
+
if (m.name != null && m.hasOwnProperty("name")) {
|
|
3862
|
+
if (!$util.isString(m.name)) return "name: string expected";
|
|
3863
|
+
}
|
|
3864
|
+
if (m.prices != null && m.hasOwnProperty("prices")) {
|
|
3865
|
+
if (!Array.isArray(m.prices)) return "prices: array expected";
|
|
3866
|
+
for (var i = 0; i < m.prices.length; ++i) {
|
|
3867
|
+
{
|
|
3868
|
+
var e = $root.user.PriceItem.verify(m.prices[i]);
|
|
3869
|
+
if (e) return "prices." + e;
|
|
3870
|
+
}
|
|
3871
|
+
}
|
|
3872
|
+
}
|
|
3873
|
+
return null;
|
|
3874
|
+
};
|
|
3875
|
+
Plan.fromObject = function fromObject(d) {
|
|
3876
|
+
if (d instanceof $root.user.Plan) return d;
|
|
3877
|
+
var m = new $root.user.Plan();
|
|
3878
|
+
if (d.id != null) {
|
|
3879
|
+
m.id = String(d.id);
|
|
3880
|
+
}
|
|
3881
|
+
if (d.name != null) {
|
|
3882
|
+
m.name = String(d.name);
|
|
3883
|
+
}
|
|
3884
|
+
if (d.prices) {
|
|
3885
|
+
if (!Array.isArray(d.prices)) throw TypeError(".user.Plan.prices: array expected");
|
|
3886
|
+
m.prices = [];
|
|
3887
|
+
for (var i = 0; i < d.prices.length; ++i) {
|
|
3888
|
+
if (typeof d.prices[i] !== "object") throw TypeError(".user.Plan.prices: object expected");
|
|
3889
|
+
m.prices[i] = $root.user.PriceItem.fromObject(d.prices[i]);
|
|
3890
|
+
}
|
|
3891
|
+
}
|
|
3892
|
+
return m;
|
|
3893
|
+
};
|
|
3894
|
+
Plan.toObject = function toObject(m, o) {
|
|
3895
|
+
if (!o) o = {};
|
|
3896
|
+
var d = {};
|
|
3897
|
+
if (o.arrays || o.defaults) {
|
|
3898
|
+
d.prices = [];
|
|
3899
|
+
}
|
|
3900
|
+
if (o.defaults) {
|
|
3901
|
+
d.id = "";
|
|
3902
|
+
d.name = "";
|
|
3903
|
+
}
|
|
3904
|
+
if (m.id != null && m.hasOwnProperty("id")) {
|
|
3905
|
+
d.id = m.id;
|
|
3906
|
+
}
|
|
3907
|
+
if (m.name != null && m.hasOwnProperty("name")) {
|
|
3908
|
+
d.name = m.name;
|
|
3909
|
+
}
|
|
3910
|
+
if (m.prices && m.prices.length) {
|
|
3911
|
+
d.prices = [];
|
|
3912
|
+
for (var j = 0; j < m.prices.length; ++j) {
|
|
3913
|
+
d.prices[j] = $root.user.PriceItem.toObject(m.prices[j], o);
|
|
3914
|
+
}
|
|
3915
|
+
}
|
|
3916
|
+
return d;
|
|
3917
|
+
};
|
|
3918
|
+
Plan.prototype.toJSON = function toJSON() {
|
|
3919
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
3920
|
+
};
|
|
3921
|
+
return Plan;
|
|
3922
|
+
}();
|
|
3923
|
+
user.PriceItem = function () {
|
|
3924
|
+
function PriceItem(p) {
|
|
3925
|
+
if (p) for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) if (p[ks[i]] != null) this[ks[i]] = p[ks[i]];
|
|
3926
|
+
}
|
|
3927
|
+
PriceItem.prototype.id = "";
|
|
3928
|
+
PriceItem.prototype.amount = $util.Long ? $util.Long.fromBits(0, 0, false) : 0;
|
|
3929
|
+
PriceItem.prototype.interval = "";
|
|
3930
|
+
PriceItem.prototype.intervalCount = $util.Long ? $util.Long.fromBits(0, 0, false) : 0;
|
|
3931
|
+
PriceItem.prototype.trialPeriodDays = $util.Long ? $util.Long.fromBits(0, 0, false) : 0;
|
|
3932
|
+
PriceItem.create = function create(properties) {
|
|
3933
|
+
return new PriceItem(properties);
|
|
3934
|
+
};
|
|
3935
|
+
PriceItem.encode = function encode(m, w) {
|
|
3936
|
+
if (!w) w = $Writer.create();
|
|
3937
|
+
if (m.id != null && Object.hasOwnProperty.call(m, "id")) w.uint32(10).string(m.id);
|
|
3938
|
+
if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) w.uint32(16).int64(m.amount);
|
|
3939
|
+
if (m.interval != null && Object.hasOwnProperty.call(m, "interval")) w.uint32(26).string(m.interval);
|
|
3940
|
+
if (m.intervalCount != null && Object.hasOwnProperty.call(m, "intervalCount")) w.uint32(32).int64(m.intervalCount);
|
|
3941
|
+
if (m.trialPeriodDays != null && Object.hasOwnProperty.call(m, "trialPeriodDays")) w.uint32(40).int64(m.trialPeriodDays);
|
|
3942
|
+
return w;
|
|
3943
|
+
};
|
|
3944
|
+
PriceItem.encodeDelimited = function encodeDelimited(message, writer) {
|
|
3945
|
+
return this.encode(message, writer).ldelim();
|
|
3946
|
+
};
|
|
3947
|
+
PriceItem.decode = function decode(r, l) {
|
|
3948
|
+
if (!(r instanceof $Reader)) r = $Reader.create(r);
|
|
3949
|
+
var c = l === undefined ? r.len : r.pos + l,
|
|
3950
|
+
m = new $root.user.PriceItem();
|
|
3951
|
+
while (r.pos < c) {
|
|
3952
|
+
var t = r.uint32();
|
|
3953
|
+
switch (t >>> 3) {
|
|
3954
|
+
case 1:
|
|
3955
|
+
m.id = r.string();
|
|
3956
|
+
break;
|
|
3957
|
+
case 2:
|
|
3958
|
+
m.amount = r.int64();
|
|
3959
|
+
break;
|
|
3960
|
+
case 3:
|
|
3961
|
+
m.interval = r.string();
|
|
3962
|
+
break;
|
|
3963
|
+
case 4:
|
|
3964
|
+
m.intervalCount = r.int64();
|
|
3965
|
+
break;
|
|
3966
|
+
case 5:
|
|
3967
|
+
m.trialPeriodDays = r.int64();
|
|
3968
|
+
break;
|
|
3969
|
+
default:
|
|
3970
|
+
r.skipType(t & 7);
|
|
3971
|
+
break;
|
|
3972
|
+
}
|
|
3973
|
+
}
|
|
3974
|
+
return m;
|
|
3975
|
+
};
|
|
3976
|
+
PriceItem.decodeDelimited = function decodeDelimited(reader) {
|
|
3977
|
+
if (!(reader instanceof $Reader)) reader = new $Reader(reader);
|
|
3978
|
+
return this.decode(reader, reader.uint32());
|
|
3979
|
+
};
|
|
3980
|
+
PriceItem.verify = function verify(m) {
|
|
3981
|
+
if (typeof m !== "object" || m === null) return "object expected";
|
|
3982
|
+
if (m.id != null && m.hasOwnProperty("id")) {
|
|
3983
|
+
if (!$util.isString(m.id)) return "id: string expected";
|
|
3984
|
+
}
|
|
3985
|
+
if (m.amount != null && m.hasOwnProperty("amount")) {
|
|
3986
|
+
if (!$util.isInteger(m.amount) && !(m.amount && $util.isInteger(m.amount.low) && $util.isInteger(m.amount.high))) return "amount: integer|Long expected";
|
|
3987
|
+
}
|
|
3988
|
+
if (m.interval != null && m.hasOwnProperty("interval")) {
|
|
3989
|
+
if (!$util.isString(m.interval)) return "interval: string expected";
|
|
3990
|
+
}
|
|
3991
|
+
if (m.intervalCount != null && m.hasOwnProperty("intervalCount")) {
|
|
3992
|
+
if (!$util.isInteger(m.intervalCount) && !(m.intervalCount && $util.isInteger(m.intervalCount.low) && $util.isInteger(m.intervalCount.high))) return "intervalCount: integer|Long expected";
|
|
3993
|
+
}
|
|
3994
|
+
if (m.trialPeriodDays != null && m.hasOwnProperty("trialPeriodDays")) {
|
|
3995
|
+
if (!$util.isInteger(m.trialPeriodDays) && !(m.trialPeriodDays && $util.isInteger(m.trialPeriodDays.low) && $util.isInteger(m.trialPeriodDays.high))) return "trialPeriodDays: integer|Long expected";
|
|
3996
|
+
}
|
|
3997
|
+
return null;
|
|
3998
|
+
};
|
|
3999
|
+
PriceItem.fromObject = function fromObject(d) {
|
|
4000
|
+
if (d instanceof $root.user.PriceItem) return d;
|
|
4001
|
+
var m = new $root.user.PriceItem();
|
|
4002
|
+
if (d.id != null) {
|
|
4003
|
+
m.id = String(d.id);
|
|
4004
|
+
}
|
|
4005
|
+
if (d.amount != null) {
|
|
4006
|
+
if ($util.Long) (m.amount = $util.Long.fromValue(d.amount)).unsigned = false;else if (typeof d.amount === "string") m.amount = parseInt(d.amount, 10);else if (typeof d.amount === "number") m.amount = d.amount;else if (typeof d.amount === "object") m.amount = new $util.LongBits(d.amount.low >>> 0, d.amount.high >>> 0).toNumber();
|
|
4007
|
+
}
|
|
4008
|
+
if (d.interval != null) {
|
|
4009
|
+
m.interval = String(d.interval);
|
|
4010
|
+
}
|
|
4011
|
+
if (d.intervalCount != null) {
|
|
4012
|
+
if ($util.Long) (m.intervalCount = $util.Long.fromValue(d.intervalCount)).unsigned = false;else if (typeof d.intervalCount === "string") m.intervalCount = parseInt(d.intervalCount, 10);else if (typeof d.intervalCount === "number") m.intervalCount = d.intervalCount;else if (typeof d.intervalCount === "object") m.intervalCount = new $util.LongBits(d.intervalCount.low >>> 0, d.intervalCount.high >>> 0).toNumber();
|
|
4013
|
+
}
|
|
4014
|
+
if (d.trialPeriodDays != null) {
|
|
4015
|
+
if ($util.Long) (m.trialPeriodDays = $util.Long.fromValue(d.trialPeriodDays)).unsigned = false;else if (typeof d.trialPeriodDays === "string") m.trialPeriodDays = parseInt(d.trialPeriodDays, 10);else if (typeof d.trialPeriodDays === "number") m.trialPeriodDays = d.trialPeriodDays;else if (typeof d.trialPeriodDays === "object") m.trialPeriodDays = new $util.LongBits(d.trialPeriodDays.low >>> 0, d.trialPeriodDays.high >>> 0).toNumber();
|
|
4016
|
+
}
|
|
4017
|
+
return m;
|
|
4018
|
+
};
|
|
4019
|
+
PriceItem.toObject = function toObject(m, o) {
|
|
4020
|
+
if (!o) o = {};
|
|
4021
|
+
var d = {};
|
|
4022
|
+
if (o.defaults) {
|
|
4023
|
+
d.id = "";
|
|
4024
|
+
if ($util.Long) {
|
|
4025
|
+
var n = new $util.Long(0, 0, false);
|
|
4026
|
+
d.amount = o.longs === String ? n.toString() : o.longs === Number ? n.toNumber() : n;
|
|
4027
|
+
} else d.amount = o.longs === String ? "0" : 0;
|
|
4028
|
+
d.interval = "";
|
|
4029
|
+
if ($util.Long) {
|
|
4030
|
+
var n = new $util.Long(0, 0, false);
|
|
4031
|
+
d.intervalCount = o.longs === String ? n.toString() : o.longs === Number ? n.toNumber() : n;
|
|
4032
|
+
} else d.intervalCount = o.longs === String ? "0" : 0;
|
|
4033
|
+
if ($util.Long) {
|
|
4034
|
+
var n = new $util.Long(0, 0, false);
|
|
4035
|
+
d.trialPeriodDays = o.longs === String ? n.toString() : o.longs === Number ? n.toNumber() : n;
|
|
4036
|
+
} else d.trialPeriodDays = o.longs === String ? "0" : 0;
|
|
4037
|
+
}
|
|
4038
|
+
if (m.id != null && m.hasOwnProperty("id")) {
|
|
4039
|
+
d.id = m.id;
|
|
4040
|
+
}
|
|
4041
|
+
if (m.amount != null && m.hasOwnProperty("amount")) {
|
|
4042
|
+
if (typeof m.amount === "number") d.amount = o.longs === String ? String(m.amount) : m.amount;else d.amount = o.longs === String ? $util.Long.prototype.toString.call(m.amount) : o.longs === Number ? new $util.LongBits(m.amount.low >>> 0, m.amount.high >>> 0).toNumber() : m.amount;
|
|
4043
|
+
}
|
|
4044
|
+
if (m.interval != null && m.hasOwnProperty("interval")) {
|
|
4045
|
+
d.interval = m.interval;
|
|
4046
|
+
}
|
|
4047
|
+
if (m.intervalCount != null && m.hasOwnProperty("intervalCount")) {
|
|
4048
|
+
if (typeof m.intervalCount === "number") d.intervalCount = o.longs === String ? String(m.intervalCount) : m.intervalCount;else d.intervalCount = o.longs === String ? $util.Long.prototype.toString.call(m.intervalCount) : o.longs === Number ? new $util.LongBits(m.intervalCount.low >>> 0, m.intervalCount.high >>> 0).toNumber() : m.intervalCount;
|
|
4049
|
+
}
|
|
4050
|
+
if (m.trialPeriodDays != null && m.hasOwnProperty("trialPeriodDays")) {
|
|
4051
|
+
if (typeof m.trialPeriodDays === "number") d.trialPeriodDays = o.longs === String ? String(m.trialPeriodDays) : m.trialPeriodDays;else d.trialPeriodDays = o.longs === String ? $util.Long.prototype.toString.call(m.trialPeriodDays) : o.longs === Number ? new $util.LongBits(m.trialPeriodDays.low >>> 0, m.trialPeriodDays.high >>> 0).toNumber() : m.trialPeriodDays;
|
|
4052
|
+
}
|
|
4053
|
+
return d;
|
|
4054
|
+
};
|
|
4055
|
+
PriceItem.prototype.toJSON = function toJSON() {
|
|
4056
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
4057
|
+
};
|
|
4058
|
+
return PriceItem;
|
|
4059
|
+
}();
|
|
4060
|
+
user.Subscription = function () {
|
|
4061
|
+
function Subscription(p) {
|
|
4062
|
+
this.items = [];
|
|
4063
|
+
if (p) for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) if (p[ks[i]] != null) this[ks[i]] = p[ks[i]];
|
|
4064
|
+
}
|
|
4065
|
+
Subscription.prototype.stripeCustomerId = "";
|
|
4066
|
+
Subscription.prototype.stripeSubscriptionId = "";
|
|
4067
|
+
Subscription.prototype.planName = "";
|
|
4068
|
+
Subscription.prototype.status = 0;
|
|
4069
|
+
Subscription.prototype.currentPeriodStart = null;
|
|
4070
|
+
Subscription.prototype.currentPeriodEnd = null;
|
|
4071
|
+
Subscription.prototype.trialEnd = null;
|
|
4072
|
+
Subscription.prototype.cancelAtPeriodEnd = false;
|
|
4073
|
+
Subscription.prototype.items = $util.emptyArray;
|
|
4074
|
+
Subscription.prototype.interval = "";
|
|
4075
|
+
Subscription.prototype.intervalCount = $util.Long ? $util.Long.fromBits(0, 0, false) : 0;
|
|
4076
|
+
let $oneOfFields;
|
|
4077
|
+
Object.defineProperty(Subscription.prototype, "_trialEnd", {
|
|
4078
|
+
get: $util.oneOfGetter($oneOfFields = ["trialEnd"]),
|
|
4079
|
+
set: $util.oneOfSetter($oneOfFields)
|
|
4080
|
+
});
|
|
4081
|
+
Subscription.create = function create(properties) {
|
|
4082
|
+
return new Subscription(properties);
|
|
4083
|
+
};
|
|
4084
|
+
Subscription.encode = function encode(m, w) {
|
|
4085
|
+
if (!w) w = $Writer.create();
|
|
4086
|
+
if (m.stripeCustomerId != null && Object.hasOwnProperty.call(m, "stripeCustomerId")) w.uint32(10).string(m.stripeCustomerId);
|
|
4087
|
+
if (m.stripeSubscriptionId != null && Object.hasOwnProperty.call(m, "stripeSubscriptionId")) w.uint32(18).string(m.stripeSubscriptionId);
|
|
4088
|
+
if (m.planName != null && Object.hasOwnProperty.call(m, "planName")) w.uint32(26).string(m.planName);
|
|
4089
|
+
if (m.status != null && Object.hasOwnProperty.call(m, "status")) w.uint32(32).int32(m.status);
|
|
4090
|
+
if (m.currentPeriodStart != null && Object.hasOwnProperty.call(m, "currentPeriodStart")) $root.google.protobuf.Timestamp.encode(m.currentPeriodStart, w.uint32(42).fork()).ldelim();
|
|
4091
|
+
if (m.currentPeriodEnd != null && Object.hasOwnProperty.call(m, "currentPeriodEnd")) $root.google.protobuf.Timestamp.encode(m.currentPeriodEnd, w.uint32(50).fork()).ldelim();
|
|
4092
|
+
if (m.trialEnd != null && Object.hasOwnProperty.call(m, "trialEnd")) $root.google.protobuf.Timestamp.encode(m.trialEnd, w.uint32(58).fork()).ldelim();
|
|
4093
|
+
if (m.cancelAtPeriodEnd != null && Object.hasOwnProperty.call(m, "cancelAtPeriodEnd")) w.uint32(64).bool(m.cancelAtPeriodEnd);
|
|
4094
|
+
if (m.items != null && m.items.length) {
|
|
4095
|
+
for (var i = 0; i < m.items.length; ++i) $root.user.SubscriptionItem.encode(m.items[i], w.uint32(74).fork()).ldelim();
|
|
4096
|
+
}
|
|
4097
|
+
if (m.interval != null && Object.hasOwnProperty.call(m, "interval")) w.uint32(82).string(m.interval);
|
|
4098
|
+
if (m.intervalCount != null && Object.hasOwnProperty.call(m, "intervalCount")) w.uint32(88).int64(m.intervalCount);
|
|
4099
|
+
return w;
|
|
4100
|
+
};
|
|
4101
|
+
Subscription.encodeDelimited = function encodeDelimited(message, writer) {
|
|
4102
|
+
return this.encode(message, writer).ldelim();
|
|
4103
|
+
};
|
|
4104
|
+
Subscription.decode = function decode(r, l) {
|
|
4105
|
+
if (!(r instanceof $Reader)) r = $Reader.create(r);
|
|
4106
|
+
var c = l === undefined ? r.len : r.pos + l,
|
|
4107
|
+
m = new $root.user.Subscription();
|
|
4108
|
+
while (r.pos < c) {
|
|
4109
|
+
var t = r.uint32();
|
|
4110
|
+
switch (t >>> 3) {
|
|
4111
|
+
case 1:
|
|
4112
|
+
m.stripeCustomerId = r.string();
|
|
4113
|
+
break;
|
|
4114
|
+
case 2:
|
|
4115
|
+
m.stripeSubscriptionId = r.string();
|
|
4116
|
+
break;
|
|
4117
|
+
case 3:
|
|
4118
|
+
m.planName = r.string();
|
|
4119
|
+
break;
|
|
4120
|
+
case 4:
|
|
4121
|
+
m.status = r.int32();
|
|
4122
|
+
break;
|
|
4123
|
+
case 5:
|
|
4124
|
+
m.currentPeriodStart = $root.google.protobuf.Timestamp.decode(r, r.uint32());
|
|
4125
|
+
break;
|
|
4126
|
+
case 6:
|
|
4127
|
+
m.currentPeriodEnd = $root.google.protobuf.Timestamp.decode(r, r.uint32());
|
|
4128
|
+
break;
|
|
4129
|
+
case 7:
|
|
4130
|
+
m.trialEnd = $root.google.protobuf.Timestamp.decode(r, r.uint32());
|
|
4131
|
+
break;
|
|
4132
|
+
case 8:
|
|
4133
|
+
m.cancelAtPeriodEnd = r.bool();
|
|
4134
|
+
break;
|
|
4135
|
+
case 9:
|
|
4136
|
+
if (!(m.items && m.items.length)) m.items = [];
|
|
4137
|
+
m.items.push($root.user.SubscriptionItem.decode(r, r.uint32()));
|
|
4138
|
+
break;
|
|
4139
|
+
case 10:
|
|
4140
|
+
m.interval = r.string();
|
|
4141
|
+
break;
|
|
4142
|
+
case 11:
|
|
4143
|
+
m.intervalCount = r.int64();
|
|
4144
|
+
break;
|
|
4145
|
+
default:
|
|
4146
|
+
r.skipType(t & 7);
|
|
4147
|
+
break;
|
|
4148
|
+
}
|
|
4149
|
+
}
|
|
4150
|
+
return m;
|
|
4151
|
+
};
|
|
4152
|
+
Subscription.decodeDelimited = function decodeDelimited(reader) {
|
|
4153
|
+
if (!(reader instanceof $Reader)) reader = new $Reader(reader);
|
|
4154
|
+
return this.decode(reader, reader.uint32());
|
|
4155
|
+
};
|
|
4156
|
+
Subscription.verify = function verify(m) {
|
|
4157
|
+
if (typeof m !== "object" || m === null) return "object expected";
|
|
4158
|
+
var p = {};
|
|
4159
|
+
if (m.stripeCustomerId != null && m.hasOwnProperty("stripeCustomerId")) {
|
|
4160
|
+
if (!$util.isString(m.stripeCustomerId)) return "stripeCustomerId: string expected";
|
|
4161
|
+
}
|
|
4162
|
+
if (m.stripeSubscriptionId != null && m.hasOwnProperty("stripeSubscriptionId")) {
|
|
4163
|
+
if (!$util.isString(m.stripeSubscriptionId)) return "stripeSubscriptionId: string expected";
|
|
4164
|
+
}
|
|
4165
|
+
if (m.planName != null && m.hasOwnProperty("planName")) {
|
|
4166
|
+
if (!$util.isString(m.planName)) return "planName: string expected";
|
|
4167
|
+
}
|
|
4168
|
+
if (m.status != null && m.hasOwnProperty("status")) {
|
|
4169
|
+
switch (m.status) {
|
|
4170
|
+
default:
|
|
4171
|
+
return "status: enum value expected";
|
|
4172
|
+
case 0:
|
|
4173
|
+
case 1:
|
|
4174
|
+
case 2:
|
|
4175
|
+
case 3:
|
|
4176
|
+
case 4:
|
|
4177
|
+
case 5:
|
|
4178
|
+
case 6:
|
|
4179
|
+
case 7:
|
|
4180
|
+
case 8:
|
|
4181
|
+
break;
|
|
4182
|
+
}
|
|
4183
|
+
}
|
|
4184
|
+
if (m.currentPeriodStart != null && m.hasOwnProperty("currentPeriodStart")) {
|
|
4185
|
+
{
|
|
4186
|
+
var e = $root.google.protobuf.Timestamp.verify(m.currentPeriodStart);
|
|
4187
|
+
if (e) return "currentPeriodStart." + e;
|
|
4188
|
+
}
|
|
4189
|
+
}
|
|
4190
|
+
if (m.currentPeriodEnd != null && m.hasOwnProperty("currentPeriodEnd")) {
|
|
4191
|
+
{
|
|
4192
|
+
var e = $root.google.protobuf.Timestamp.verify(m.currentPeriodEnd);
|
|
4193
|
+
if (e) return "currentPeriodEnd." + e;
|
|
4194
|
+
}
|
|
4195
|
+
}
|
|
4196
|
+
if (m.trialEnd != null && m.hasOwnProperty("trialEnd")) {
|
|
4197
|
+
p._trialEnd = 1;
|
|
4198
|
+
{
|
|
4199
|
+
var e = $root.google.protobuf.Timestamp.verify(m.trialEnd);
|
|
4200
|
+
if (e) return "trialEnd." + e;
|
|
4201
|
+
}
|
|
4202
|
+
}
|
|
4203
|
+
if (m.cancelAtPeriodEnd != null && m.hasOwnProperty("cancelAtPeriodEnd")) {
|
|
4204
|
+
if (typeof m.cancelAtPeriodEnd !== "boolean") return "cancelAtPeriodEnd: boolean expected";
|
|
4205
|
+
}
|
|
4206
|
+
if (m.items != null && m.hasOwnProperty("items")) {
|
|
4207
|
+
if (!Array.isArray(m.items)) return "items: array expected";
|
|
4208
|
+
for (var i = 0; i < m.items.length; ++i) {
|
|
4209
|
+
{
|
|
4210
|
+
var e = $root.user.SubscriptionItem.verify(m.items[i]);
|
|
4211
|
+
if (e) return "items." + e;
|
|
4212
|
+
}
|
|
4213
|
+
}
|
|
4214
|
+
}
|
|
4215
|
+
if (m.interval != null && m.hasOwnProperty("interval")) {
|
|
4216
|
+
if (!$util.isString(m.interval)) return "interval: string expected";
|
|
4217
|
+
}
|
|
4218
|
+
if (m.intervalCount != null && m.hasOwnProperty("intervalCount")) {
|
|
4219
|
+
if (!$util.isInteger(m.intervalCount) && !(m.intervalCount && $util.isInteger(m.intervalCount.low) && $util.isInteger(m.intervalCount.high))) return "intervalCount: integer|Long expected";
|
|
4220
|
+
}
|
|
4221
|
+
return null;
|
|
4222
|
+
};
|
|
4223
|
+
Subscription.fromObject = function fromObject(d) {
|
|
4224
|
+
if (d instanceof $root.user.Subscription) return d;
|
|
4225
|
+
var m = new $root.user.Subscription();
|
|
4226
|
+
if (d.stripeCustomerId != null) {
|
|
4227
|
+
m.stripeCustomerId = String(d.stripeCustomerId);
|
|
4228
|
+
}
|
|
4229
|
+
if (d.stripeSubscriptionId != null) {
|
|
4230
|
+
m.stripeSubscriptionId = String(d.stripeSubscriptionId);
|
|
4231
|
+
}
|
|
4232
|
+
if (d.planName != null) {
|
|
4233
|
+
m.planName = String(d.planName);
|
|
4234
|
+
}
|
|
4235
|
+
switch (d.status) {
|
|
4236
|
+
case "UNKNOWN_STATUS":
|
|
4237
|
+
case 0:
|
|
4238
|
+
m.status = 0;
|
|
4239
|
+
break;
|
|
4240
|
+
case "TRIALING":
|
|
4241
|
+
case 1:
|
|
4242
|
+
m.status = 1;
|
|
4243
|
+
break;
|
|
4244
|
+
case "ACTIVE":
|
|
4245
|
+
case 2:
|
|
4246
|
+
m.status = 2;
|
|
4247
|
+
break;
|
|
4248
|
+
case "INCOMPLETE":
|
|
4249
|
+
case 3:
|
|
4250
|
+
m.status = 3;
|
|
4251
|
+
break;
|
|
4252
|
+
case "INCOMPLETE_EXPIRED":
|
|
4253
|
+
case 4:
|
|
4254
|
+
m.status = 4;
|
|
4255
|
+
break;
|
|
4256
|
+
case "PAST_DUE":
|
|
4257
|
+
case 5:
|
|
4258
|
+
m.status = 5;
|
|
4259
|
+
break;
|
|
4260
|
+
case "CANCELED":
|
|
4261
|
+
case 6:
|
|
4262
|
+
m.status = 6;
|
|
4263
|
+
break;
|
|
4264
|
+
case "UNPAID":
|
|
4265
|
+
case 7:
|
|
4266
|
+
m.status = 7;
|
|
4267
|
+
break;
|
|
4268
|
+
case "PAUSED":
|
|
4269
|
+
case 8:
|
|
4270
|
+
m.status = 8;
|
|
4271
|
+
break;
|
|
4272
|
+
}
|
|
4273
|
+
if (d.currentPeriodStart != null) {
|
|
4274
|
+
if (typeof d.currentPeriodStart !== "object") throw TypeError(".user.Subscription.currentPeriodStart: object expected");
|
|
4275
|
+
m.currentPeriodStart = $root.google.protobuf.Timestamp.fromObject(d.currentPeriodStart);
|
|
4276
|
+
}
|
|
4277
|
+
if (d.currentPeriodEnd != null) {
|
|
4278
|
+
if (typeof d.currentPeriodEnd !== "object") throw TypeError(".user.Subscription.currentPeriodEnd: object expected");
|
|
4279
|
+
m.currentPeriodEnd = $root.google.protobuf.Timestamp.fromObject(d.currentPeriodEnd);
|
|
4280
|
+
}
|
|
4281
|
+
if (d.trialEnd != null) {
|
|
4282
|
+
if (typeof d.trialEnd !== "object") throw TypeError(".user.Subscription.trialEnd: object expected");
|
|
4283
|
+
m.trialEnd = $root.google.protobuf.Timestamp.fromObject(d.trialEnd);
|
|
4284
|
+
}
|
|
4285
|
+
if (d.cancelAtPeriodEnd != null) {
|
|
4286
|
+
m.cancelAtPeriodEnd = Boolean(d.cancelAtPeriodEnd);
|
|
4287
|
+
}
|
|
4288
|
+
if (d.items) {
|
|
4289
|
+
if (!Array.isArray(d.items)) throw TypeError(".user.Subscription.items: array expected");
|
|
4290
|
+
m.items = [];
|
|
4291
|
+
for (var i = 0; i < d.items.length; ++i) {
|
|
4292
|
+
if (typeof d.items[i] !== "object") throw TypeError(".user.Subscription.items: object expected");
|
|
4293
|
+
m.items[i] = $root.user.SubscriptionItem.fromObject(d.items[i]);
|
|
4294
|
+
}
|
|
4295
|
+
}
|
|
4296
|
+
if (d.interval != null) {
|
|
4297
|
+
m.interval = String(d.interval);
|
|
4298
|
+
}
|
|
4299
|
+
if (d.intervalCount != null) {
|
|
4300
|
+
if ($util.Long) (m.intervalCount = $util.Long.fromValue(d.intervalCount)).unsigned = false;else if (typeof d.intervalCount === "string") m.intervalCount = parseInt(d.intervalCount, 10);else if (typeof d.intervalCount === "number") m.intervalCount = d.intervalCount;else if (typeof d.intervalCount === "object") m.intervalCount = new $util.LongBits(d.intervalCount.low >>> 0, d.intervalCount.high >>> 0).toNumber();
|
|
4301
|
+
}
|
|
4302
|
+
return m;
|
|
4303
|
+
};
|
|
4304
|
+
Subscription.toObject = function toObject(m, o) {
|
|
4305
|
+
if (!o) o = {};
|
|
4306
|
+
var d = {};
|
|
4307
|
+
if (o.arrays || o.defaults) {
|
|
4308
|
+
d.items = [];
|
|
4309
|
+
}
|
|
4310
|
+
if (o.defaults) {
|
|
4311
|
+
d.stripeCustomerId = "";
|
|
4312
|
+
d.stripeSubscriptionId = "";
|
|
4313
|
+
d.planName = "";
|
|
4314
|
+
d.status = o.enums === String ? "UNKNOWN_STATUS" : 0;
|
|
4315
|
+
d.currentPeriodStart = null;
|
|
4316
|
+
d.currentPeriodEnd = null;
|
|
4317
|
+
d.cancelAtPeriodEnd = false;
|
|
4318
|
+
d.interval = "";
|
|
4319
|
+
if ($util.Long) {
|
|
4320
|
+
var n = new $util.Long(0, 0, false);
|
|
4321
|
+
d.intervalCount = o.longs === String ? n.toString() : o.longs === Number ? n.toNumber() : n;
|
|
4322
|
+
} else d.intervalCount = o.longs === String ? "0" : 0;
|
|
4323
|
+
}
|
|
4324
|
+
if (m.stripeCustomerId != null && m.hasOwnProperty("stripeCustomerId")) {
|
|
4325
|
+
d.stripeCustomerId = m.stripeCustomerId;
|
|
4326
|
+
}
|
|
4327
|
+
if (m.stripeSubscriptionId != null && m.hasOwnProperty("stripeSubscriptionId")) {
|
|
4328
|
+
d.stripeSubscriptionId = m.stripeSubscriptionId;
|
|
4329
|
+
}
|
|
4330
|
+
if (m.planName != null && m.hasOwnProperty("planName")) {
|
|
4331
|
+
d.planName = m.planName;
|
|
4332
|
+
}
|
|
4333
|
+
if (m.status != null && m.hasOwnProperty("status")) {
|
|
4334
|
+
d.status = o.enums === String ? $root.user.SubscriptionStatus[m.status] : m.status;
|
|
4335
|
+
}
|
|
4336
|
+
if (m.currentPeriodStart != null && m.hasOwnProperty("currentPeriodStart")) {
|
|
4337
|
+
d.currentPeriodStart = $root.google.protobuf.Timestamp.toObject(m.currentPeriodStart, o);
|
|
4338
|
+
}
|
|
4339
|
+
if (m.currentPeriodEnd != null && m.hasOwnProperty("currentPeriodEnd")) {
|
|
4340
|
+
d.currentPeriodEnd = $root.google.protobuf.Timestamp.toObject(m.currentPeriodEnd, o);
|
|
4341
|
+
}
|
|
4342
|
+
if (m.trialEnd != null && m.hasOwnProperty("trialEnd")) {
|
|
4343
|
+
d.trialEnd = $root.google.protobuf.Timestamp.toObject(m.trialEnd, o);
|
|
4344
|
+
if (o.oneofs) d._trialEnd = "trialEnd";
|
|
4345
|
+
}
|
|
4346
|
+
if (m.cancelAtPeriodEnd != null && m.hasOwnProperty("cancelAtPeriodEnd")) {
|
|
4347
|
+
d.cancelAtPeriodEnd = m.cancelAtPeriodEnd;
|
|
4348
|
+
}
|
|
4349
|
+
if (m.items && m.items.length) {
|
|
4350
|
+
d.items = [];
|
|
4351
|
+
for (var j = 0; j < m.items.length; ++j) {
|
|
4352
|
+
d.items[j] = $root.user.SubscriptionItem.toObject(m.items[j], o);
|
|
4353
|
+
}
|
|
4354
|
+
}
|
|
4355
|
+
if (m.interval != null && m.hasOwnProperty("interval")) {
|
|
4356
|
+
d.interval = m.interval;
|
|
4357
|
+
}
|
|
4358
|
+
if (m.intervalCount != null && m.hasOwnProperty("intervalCount")) {
|
|
4359
|
+
if (typeof m.intervalCount === "number") d.intervalCount = o.longs === String ? String(m.intervalCount) : m.intervalCount;else d.intervalCount = o.longs === String ? $util.Long.prototype.toString.call(m.intervalCount) : o.longs === Number ? new $util.LongBits(m.intervalCount.low >>> 0, m.intervalCount.high >>> 0).toNumber() : m.intervalCount;
|
|
4360
|
+
}
|
|
4361
|
+
return d;
|
|
4362
|
+
};
|
|
4363
|
+
Subscription.prototype.toJSON = function toJSON() {
|
|
4364
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
4365
|
+
};
|
|
4366
|
+
return Subscription;
|
|
4367
|
+
}();
|
|
4368
|
+
user.SubscriptionItem = function () {
|
|
4369
|
+
function SubscriptionItem(p) {
|
|
4370
|
+
if (p) for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) if (p[ks[i]] != null) this[ks[i]] = p[ks[i]];
|
|
4371
|
+
}
|
|
4372
|
+
SubscriptionItem.prototype.stripeItemId = "";
|
|
4373
|
+
SubscriptionItem.prototype.priceId = "";
|
|
4374
|
+
SubscriptionItem.prototype.quantity = 0;
|
|
4375
|
+
SubscriptionItem.prototype.createdAt = null;
|
|
4376
|
+
SubscriptionItem.prototype.updatedAt = null;
|
|
4377
|
+
SubscriptionItem.create = function create(properties) {
|
|
4378
|
+
return new SubscriptionItem(properties);
|
|
4379
|
+
};
|
|
4380
|
+
SubscriptionItem.encode = function encode(m, w) {
|
|
4381
|
+
if (!w) w = $Writer.create();
|
|
4382
|
+
if (m.stripeItemId != null && Object.hasOwnProperty.call(m, "stripeItemId")) w.uint32(10).string(m.stripeItemId);
|
|
4383
|
+
if (m.priceId != null && Object.hasOwnProperty.call(m, "priceId")) w.uint32(18).string(m.priceId);
|
|
4384
|
+
if (m.quantity != null && Object.hasOwnProperty.call(m, "quantity")) w.uint32(24).int32(m.quantity);
|
|
4385
|
+
if (m.createdAt != null && Object.hasOwnProperty.call(m, "createdAt")) $root.google.protobuf.Timestamp.encode(m.createdAt, w.uint32(34).fork()).ldelim();
|
|
4386
|
+
if (m.updatedAt != null && Object.hasOwnProperty.call(m, "updatedAt")) $root.google.protobuf.Timestamp.encode(m.updatedAt, w.uint32(42).fork()).ldelim();
|
|
4387
|
+
return w;
|
|
4388
|
+
};
|
|
4389
|
+
SubscriptionItem.encodeDelimited = function encodeDelimited(message, writer) {
|
|
4390
|
+
return this.encode(message, writer).ldelim();
|
|
4391
|
+
};
|
|
4392
|
+
SubscriptionItem.decode = function decode(r, l) {
|
|
4393
|
+
if (!(r instanceof $Reader)) r = $Reader.create(r);
|
|
4394
|
+
var c = l === undefined ? r.len : r.pos + l,
|
|
4395
|
+
m = new $root.user.SubscriptionItem();
|
|
4396
|
+
while (r.pos < c) {
|
|
4397
|
+
var t = r.uint32();
|
|
4398
|
+
switch (t >>> 3) {
|
|
4399
|
+
case 1:
|
|
4400
|
+
m.stripeItemId = r.string();
|
|
4401
|
+
break;
|
|
4402
|
+
case 2:
|
|
4403
|
+
m.priceId = r.string();
|
|
4404
|
+
break;
|
|
4405
|
+
case 3:
|
|
4406
|
+
m.quantity = r.int32();
|
|
4407
|
+
break;
|
|
4408
|
+
case 4:
|
|
4409
|
+
m.createdAt = $root.google.protobuf.Timestamp.decode(r, r.uint32());
|
|
4410
|
+
break;
|
|
4411
|
+
case 5:
|
|
4412
|
+
m.updatedAt = $root.google.protobuf.Timestamp.decode(r, r.uint32());
|
|
4413
|
+
break;
|
|
4414
|
+
default:
|
|
4415
|
+
r.skipType(t & 7);
|
|
4416
|
+
break;
|
|
4417
|
+
}
|
|
4418
|
+
}
|
|
4419
|
+
return m;
|
|
4420
|
+
};
|
|
4421
|
+
SubscriptionItem.decodeDelimited = function decodeDelimited(reader) {
|
|
4422
|
+
if (!(reader instanceof $Reader)) reader = new $Reader(reader);
|
|
4423
|
+
return this.decode(reader, reader.uint32());
|
|
4424
|
+
};
|
|
4425
|
+
SubscriptionItem.verify = function verify(m) {
|
|
4426
|
+
if (typeof m !== "object" || m === null) return "object expected";
|
|
4427
|
+
if (m.stripeItemId != null && m.hasOwnProperty("stripeItemId")) {
|
|
4428
|
+
if (!$util.isString(m.stripeItemId)) return "stripeItemId: string expected";
|
|
4429
|
+
}
|
|
4430
|
+
if (m.priceId != null && m.hasOwnProperty("priceId")) {
|
|
4431
|
+
if (!$util.isString(m.priceId)) return "priceId: string expected";
|
|
4432
|
+
}
|
|
4433
|
+
if (m.quantity != null && m.hasOwnProperty("quantity")) {
|
|
4434
|
+
if (!$util.isInteger(m.quantity)) return "quantity: integer expected";
|
|
4435
|
+
}
|
|
4436
|
+
if (m.createdAt != null && m.hasOwnProperty("createdAt")) {
|
|
4437
|
+
{
|
|
4438
|
+
var e = $root.google.protobuf.Timestamp.verify(m.createdAt);
|
|
4439
|
+
if (e) return "createdAt." + e;
|
|
4440
|
+
}
|
|
4441
|
+
}
|
|
4442
|
+
if (m.updatedAt != null && m.hasOwnProperty("updatedAt")) {
|
|
4443
|
+
{
|
|
4444
|
+
var e = $root.google.protobuf.Timestamp.verify(m.updatedAt);
|
|
4445
|
+
if (e) return "updatedAt." + e;
|
|
4446
|
+
}
|
|
4447
|
+
}
|
|
4448
|
+
return null;
|
|
4449
|
+
};
|
|
4450
|
+
SubscriptionItem.fromObject = function fromObject(d) {
|
|
4451
|
+
if (d instanceof $root.user.SubscriptionItem) return d;
|
|
4452
|
+
var m = new $root.user.SubscriptionItem();
|
|
4453
|
+
if (d.stripeItemId != null) {
|
|
4454
|
+
m.stripeItemId = String(d.stripeItemId);
|
|
4455
|
+
}
|
|
4456
|
+
if (d.priceId != null) {
|
|
4457
|
+
m.priceId = String(d.priceId);
|
|
4458
|
+
}
|
|
4459
|
+
if (d.quantity != null) {
|
|
4460
|
+
m.quantity = d.quantity | 0;
|
|
4461
|
+
}
|
|
4462
|
+
if (d.createdAt != null) {
|
|
4463
|
+
if (typeof d.createdAt !== "object") throw TypeError(".user.SubscriptionItem.createdAt: object expected");
|
|
4464
|
+
m.createdAt = $root.google.protobuf.Timestamp.fromObject(d.createdAt);
|
|
4465
|
+
}
|
|
4466
|
+
if (d.updatedAt != null) {
|
|
4467
|
+
if (typeof d.updatedAt !== "object") throw TypeError(".user.SubscriptionItem.updatedAt: object expected");
|
|
4468
|
+
m.updatedAt = $root.google.protobuf.Timestamp.fromObject(d.updatedAt);
|
|
4469
|
+
}
|
|
4470
|
+
return m;
|
|
4471
|
+
};
|
|
4472
|
+
SubscriptionItem.toObject = function toObject(m, o) {
|
|
4473
|
+
if (!o) o = {};
|
|
4474
|
+
var d = {};
|
|
4475
|
+
if (o.defaults) {
|
|
4476
|
+
d.stripeItemId = "";
|
|
4477
|
+
d.priceId = "";
|
|
4478
|
+
d.quantity = 0;
|
|
4479
|
+
d.createdAt = null;
|
|
4480
|
+
d.updatedAt = null;
|
|
4481
|
+
}
|
|
4482
|
+
if (m.stripeItemId != null && m.hasOwnProperty("stripeItemId")) {
|
|
4483
|
+
d.stripeItemId = m.stripeItemId;
|
|
4484
|
+
}
|
|
4485
|
+
if (m.priceId != null && m.hasOwnProperty("priceId")) {
|
|
4486
|
+
d.priceId = m.priceId;
|
|
4487
|
+
}
|
|
4488
|
+
if (m.quantity != null && m.hasOwnProperty("quantity")) {
|
|
4489
|
+
d.quantity = m.quantity;
|
|
4490
|
+
}
|
|
4491
|
+
if (m.createdAt != null && m.hasOwnProperty("createdAt")) {
|
|
4492
|
+
d.createdAt = $root.google.protobuf.Timestamp.toObject(m.createdAt, o);
|
|
4493
|
+
}
|
|
4494
|
+
if (m.updatedAt != null && m.hasOwnProperty("updatedAt")) {
|
|
4495
|
+
d.updatedAt = $root.google.protobuf.Timestamp.toObject(m.updatedAt, o);
|
|
4496
|
+
}
|
|
4497
|
+
return d;
|
|
4498
|
+
};
|
|
4499
|
+
SubscriptionItem.prototype.toJSON = function toJSON() {
|
|
4500
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
4501
|
+
};
|
|
4502
|
+
return SubscriptionItem;
|
|
4503
|
+
}();
|
|
3772
4504
|
return user;
|
|
3773
4505
|
})();
|
|
3774
4506
|
export const google = $root.google = (() => {
|
package/types/proto.js
CHANGED