@moonbase.sh/api 0.3.9 → 0.3.11
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/index.cjs +19 -11
- package/dist/index.d.cts +31 -1
- package/dist/index.d.ts +31 -1
- package/dist/index.js +16 -10
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -35,6 +35,7 @@ __export(src_exports, {
|
|
|
35
35
|
ActivationStatus: () => ActivationStatus,
|
|
36
36
|
ConflictError: () => ConflictError,
|
|
37
37
|
LicenseStatus: () => LicenseStatus,
|
|
38
|
+
MoonbaseApi: () => MoonbaseApi,
|
|
38
39
|
MoonbaseClient: () => MoonbaseClient,
|
|
39
40
|
MoonbaseError: () => MoonbaseError,
|
|
40
41
|
NotAuthenticatedError: () => NotAuthenticatedError,
|
|
@@ -42,7 +43,8 @@ __export(src_exports, {
|
|
|
42
43
|
NotFoundError: () => NotFoundError,
|
|
43
44
|
OrderStatus: () => OrderStatus,
|
|
44
45
|
ProductStatus: () => ProductStatus,
|
|
45
|
-
TrialStatus: () => TrialStatus
|
|
46
|
+
TrialStatus: () => TrialStatus,
|
|
47
|
+
objectToQuery: () => objectToQuery
|
|
46
48
|
});
|
|
47
49
|
module.exports = __toCommonJS(src_exports);
|
|
48
50
|
|
|
@@ -517,10 +519,14 @@ var subscriptionLineItemFulfillmentSchema = import_zod8.z.object({
|
|
|
517
519
|
bundleLineItemFulfillmentSchema
|
|
518
520
|
])
|
|
519
521
|
});
|
|
522
|
+
var noLineItemFulfillmentSchema = import_zod8.z.object({
|
|
523
|
+
type: import_zod8.z.literal("NoFulfillment")
|
|
524
|
+
});
|
|
520
525
|
var lineItemFulfillmentSchema = import_zod8.z.discriminatedUnion("type", [
|
|
521
526
|
licenseLineItemFulfillmentSchema,
|
|
522
527
|
bundleLineItemFulfillmentSchema,
|
|
523
|
-
subscriptionLineItemFulfillmentSchema
|
|
528
|
+
subscriptionLineItemFulfillmentSchema,
|
|
529
|
+
noLineItemFulfillmentSchema
|
|
524
530
|
]);
|
|
525
531
|
var lineItemTotalSchema = import_zod8.z.object({
|
|
526
532
|
original: moneySchema,
|
|
@@ -719,14 +725,14 @@ var MoonbaseClient = class {
|
|
|
719
725
|
constructor(configuration) {
|
|
720
726
|
this.configuration = configuration;
|
|
721
727
|
this.configuration.endpoint = this.configuration.endpoint.replace(/\/$/, "");
|
|
722
|
-
|
|
723
|
-
this.activationRequests = new ActivationRequestEndpoints(api);
|
|
724
|
-
this.customers = new CustomerEndpoints(api);
|
|
725
|
-
this.licenses = new LicenseEndpoints(api);
|
|
726
|
-
this.products = new ProductEndpoints(api);
|
|
727
|
-
this.trials = new TrialEndpoints(api);
|
|
728
|
-
this.vouchers = new VoucherEndpoints(api);
|
|
729
|
-
this.orders = new OrderEndpoints(api);
|
|
728
|
+
this.api = new MoonbaseApi(this.configuration.endpoint, this.configuration.apiKey);
|
|
729
|
+
this.activationRequests = new ActivationRequestEndpoints(this.api);
|
|
730
|
+
this.customers = new CustomerEndpoints(this.api);
|
|
731
|
+
this.licenses = new LicenseEndpoints(this.api);
|
|
732
|
+
this.products = new ProductEndpoints(this.api);
|
|
733
|
+
this.trials = new TrialEndpoints(this.api);
|
|
734
|
+
this.vouchers = new VoucherEndpoints(this.api);
|
|
735
|
+
this.orders = new OrderEndpoints(this.api);
|
|
730
736
|
}
|
|
731
737
|
};
|
|
732
738
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -736,6 +742,7 @@ var MoonbaseClient = class {
|
|
|
736
742
|
ActivationStatus,
|
|
737
743
|
ConflictError,
|
|
738
744
|
LicenseStatus,
|
|
745
|
+
MoonbaseApi,
|
|
739
746
|
MoonbaseClient,
|
|
740
747
|
MoonbaseError,
|
|
741
748
|
NotAuthenticatedError,
|
|
@@ -743,5 +750,6 @@ var MoonbaseClient = class {
|
|
|
743
750
|
NotFoundError,
|
|
744
751
|
OrderStatus,
|
|
745
752
|
ProductStatus,
|
|
746
|
-
TrialStatus
|
|
753
|
+
TrialStatus,
|
|
754
|
+
objectToQuery
|
|
747
755
|
});
|
package/dist/index.d.cts
CHANGED
|
@@ -6,6 +6,7 @@ interface Response {
|
|
|
6
6
|
headers: Headers;
|
|
7
7
|
status: number;
|
|
8
8
|
}
|
|
9
|
+
declare function objectToQuery(obj?: Record<string, string | number | boolean>): string;
|
|
9
10
|
declare class MoonbaseApi {
|
|
10
11
|
baseUrl: string;
|
|
11
12
|
private apiKey;
|
|
@@ -1879,6 +1880,12 @@ declare const orderSchema: z.ZodObject<{
|
|
|
1879
1880
|
licenseIds: string[];
|
|
1880
1881
|
}>;
|
|
1881
1882
|
};
|
|
1883
|
+
}>, z.ZodObject<{
|
|
1884
|
+
type: z.ZodLiteral<"NoFulfillment">;
|
|
1885
|
+
}, "strip", z.ZodTypeAny, {
|
|
1886
|
+
type: "NoFulfillment";
|
|
1887
|
+
}, {
|
|
1888
|
+
type: "NoFulfillment";
|
|
1882
1889
|
}>]>>;
|
|
1883
1890
|
}, "strip", z.ZodTypeAny, {
|
|
1884
1891
|
type: "Product";
|
|
@@ -1971,6 +1978,8 @@ declare const orderSchema: z.ZodObject<{
|
|
|
1971
1978
|
licenseIds: string[];
|
|
1972
1979
|
}>;
|
|
1973
1980
|
};
|
|
1981
|
+
} | {
|
|
1982
|
+
type: "NoFulfillment";
|
|
1974
1983
|
} | undefined;
|
|
1975
1984
|
}, {
|
|
1976
1985
|
type: "Product";
|
|
@@ -2063,6 +2072,8 @@ declare const orderSchema: z.ZodObject<{
|
|
|
2063
2072
|
licenseIds: string[];
|
|
2064
2073
|
}>;
|
|
2065
2074
|
};
|
|
2075
|
+
} | {
|
|
2076
|
+
type: "NoFulfillment";
|
|
2066
2077
|
} | undefined;
|
|
2067
2078
|
}>, z.ZodObject<{
|
|
2068
2079
|
type: z.ZodLiteral<"Bundle">;
|
|
@@ -2411,6 +2422,12 @@ declare const orderSchema: z.ZodObject<{
|
|
|
2411
2422
|
licenseIds: string[];
|
|
2412
2423
|
}>;
|
|
2413
2424
|
};
|
|
2425
|
+
}>, z.ZodObject<{
|
|
2426
|
+
type: z.ZodLiteral<"NoFulfillment">;
|
|
2427
|
+
}, "strip", z.ZodTypeAny, {
|
|
2428
|
+
type: "NoFulfillment";
|
|
2429
|
+
}, {
|
|
2430
|
+
type: "NoFulfillment";
|
|
2414
2431
|
}>]>>;
|
|
2415
2432
|
}, "strip", z.ZodTypeAny, {
|
|
2416
2433
|
type: "Bundle";
|
|
@@ -2503,6 +2520,8 @@ declare const orderSchema: z.ZodObject<{
|
|
|
2503
2520
|
licenseIds: string[];
|
|
2504
2521
|
}>;
|
|
2505
2522
|
};
|
|
2523
|
+
} | {
|
|
2524
|
+
type: "NoFulfillment";
|
|
2506
2525
|
} | undefined;
|
|
2507
2526
|
}, {
|
|
2508
2527
|
type: "Bundle";
|
|
@@ -2595,6 +2614,8 @@ declare const orderSchema: z.ZodObject<{
|
|
|
2595
2614
|
licenseIds: string[];
|
|
2596
2615
|
}>;
|
|
2597
2616
|
};
|
|
2617
|
+
} | {
|
|
2618
|
+
type: "NoFulfillment";
|
|
2598
2619
|
} | undefined;
|
|
2599
2620
|
}>]>, "many">;
|
|
2600
2621
|
lastUpdated: z.ZodObject<{
|
|
@@ -2752,6 +2773,8 @@ declare const orderSchema: z.ZodObject<{
|
|
|
2752
2773
|
licenseIds: string[];
|
|
2753
2774
|
}>;
|
|
2754
2775
|
};
|
|
2776
|
+
} | {
|
|
2777
|
+
type: "NoFulfillment";
|
|
2755
2778
|
} | undefined;
|
|
2756
2779
|
} | {
|
|
2757
2780
|
type: "Bundle";
|
|
@@ -2844,6 +2867,8 @@ declare const orderSchema: z.ZodObject<{
|
|
|
2844
2867
|
licenseIds: string[];
|
|
2845
2868
|
}>;
|
|
2846
2869
|
};
|
|
2870
|
+
} | {
|
|
2871
|
+
type: "NoFulfillment";
|
|
2847
2872
|
} | undefined;
|
|
2848
2873
|
})[];
|
|
2849
2874
|
isRefunded: boolean;
|
|
@@ -3049,6 +3074,8 @@ declare const orderSchema: z.ZodObject<{
|
|
|
3049
3074
|
licenseIds: string[];
|
|
3050
3075
|
}>;
|
|
3051
3076
|
};
|
|
3077
|
+
} | {
|
|
3078
|
+
type: "NoFulfillment";
|
|
3052
3079
|
} | undefined;
|
|
3053
3080
|
} | {
|
|
3054
3081
|
type: "Bundle";
|
|
@@ -3141,6 +3168,8 @@ declare const orderSchema: z.ZodObject<{
|
|
|
3141
3168
|
licenseIds: string[];
|
|
3142
3169
|
}>;
|
|
3143
3170
|
};
|
|
3171
|
+
} | {
|
|
3172
|
+
type: "NoFulfillment";
|
|
3144
3173
|
} | undefined;
|
|
3145
3174
|
})[];
|
|
3146
3175
|
isRefunded: boolean;
|
|
@@ -3824,6 +3853,7 @@ interface MoonbaseConfiguration {
|
|
|
3824
3853
|
declare class MoonbaseClient {
|
|
3825
3854
|
private readonly configuration;
|
|
3826
3855
|
constructor(configuration: MoonbaseConfiguration);
|
|
3856
|
+
api: MoonbaseApi;
|
|
3827
3857
|
activationRequests: ActivationRequestEndpoints;
|
|
3828
3858
|
customers: CustomerEndpoints;
|
|
3829
3859
|
licenses: LicenseEndpoints;
|
|
@@ -3833,4 +3863,4 @@ declare class MoonbaseClient {
|
|
|
3833
3863
|
orders: OrderEndpoints;
|
|
3834
3864
|
}
|
|
3835
3865
|
|
|
3836
|
-
export { ActivationMethod, type ActivationRequest, ActivationRequestStatus, ActivationStatus, type Bundle, ConflictError, type CreateVoucherRequest, type Customer, type ImportCustomerRequest, type ImportLicenseRequest, type ImportTrialRequest, type License, type LicenseActivation, LicenseStatus, MoonbaseClient, type MoonbaseConfiguration, MoonbaseError, NotAuthenticatedError, NotAuthorizedError, NotFoundError, type Order, OrderStatus, type Page, type PricingVariation, type Product, ProductStatus, type ProvisionLicensesRequest, type Quantifiable, type Trial, TrialStatus, type Voucher };
|
|
3866
|
+
export { ActivationMethod, type ActivationRequest, ActivationRequestStatus, ActivationStatus, type Bundle, ConflictError, type CreateVoucherRequest, type Customer, type ImportCustomerRequest, type ImportLicenseRequest, type ImportTrialRequest, type License, type LicenseActivation, LicenseStatus, MoonbaseApi, MoonbaseClient, type MoonbaseConfiguration, MoonbaseError, NotAuthenticatedError, NotAuthorizedError, NotFoundError, type Order, OrderStatus, type Page, type PricingVariation, type Product, ProductStatus, type ProvisionLicensesRequest, type Quantifiable, type Trial, TrialStatus, type Voucher, objectToQuery };
|
package/dist/index.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ interface Response {
|
|
|
6
6
|
headers: Headers;
|
|
7
7
|
status: number;
|
|
8
8
|
}
|
|
9
|
+
declare function objectToQuery(obj?: Record<string, string | number | boolean>): string;
|
|
9
10
|
declare class MoonbaseApi {
|
|
10
11
|
baseUrl: string;
|
|
11
12
|
private apiKey;
|
|
@@ -1879,6 +1880,12 @@ declare const orderSchema: z.ZodObject<{
|
|
|
1879
1880
|
licenseIds: string[];
|
|
1880
1881
|
}>;
|
|
1881
1882
|
};
|
|
1883
|
+
}>, z.ZodObject<{
|
|
1884
|
+
type: z.ZodLiteral<"NoFulfillment">;
|
|
1885
|
+
}, "strip", z.ZodTypeAny, {
|
|
1886
|
+
type: "NoFulfillment";
|
|
1887
|
+
}, {
|
|
1888
|
+
type: "NoFulfillment";
|
|
1882
1889
|
}>]>>;
|
|
1883
1890
|
}, "strip", z.ZodTypeAny, {
|
|
1884
1891
|
type: "Product";
|
|
@@ -1971,6 +1978,8 @@ declare const orderSchema: z.ZodObject<{
|
|
|
1971
1978
|
licenseIds: string[];
|
|
1972
1979
|
}>;
|
|
1973
1980
|
};
|
|
1981
|
+
} | {
|
|
1982
|
+
type: "NoFulfillment";
|
|
1974
1983
|
} | undefined;
|
|
1975
1984
|
}, {
|
|
1976
1985
|
type: "Product";
|
|
@@ -2063,6 +2072,8 @@ declare const orderSchema: z.ZodObject<{
|
|
|
2063
2072
|
licenseIds: string[];
|
|
2064
2073
|
}>;
|
|
2065
2074
|
};
|
|
2075
|
+
} | {
|
|
2076
|
+
type: "NoFulfillment";
|
|
2066
2077
|
} | undefined;
|
|
2067
2078
|
}>, z.ZodObject<{
|
|
2068
2079
|
type: z.ZodLiteral<"Bundle">;
|
|
@@ -2411,6 +2422,12 @@ declare const orderSchema: z.ZodObject<{
|
|
|
2411
2422
|
licenseIds: string[];
|
|
2412
2423
|
}>;
|
|
2413
2424
|
};
|
|
2425
|
+
}>, z.ZodObject<{
|
|
2426
|
+
type: z.ZodLiteral<"NoFulfillment">;
|
|
2427
|
+
}, "strip", z.ZodTypeAny, {
|
|
2428
|
+
type: "NoFulfillment";
|
|
2429
|
+
}, {
|
|
2430
|
+
type: "NoFulfillment";
|
|
2414
2431
|
}>]>>;
|
|
2415
2432
|
}, "strip", z.ZodTypeAny, {
|
|
2416
2433
|
type: "Bundle";
|
|
@@ -2503,6 +2520,8 @@ declare const orderSchema: z.ZodObject<{
|
|
|
2503
2520
|
licenseIds: string[];
|
|
2504
2521
|
}>;
|
|
2505
2522
|
};
|
|
2523
|
+
} | {
|
|
2524
|
+
type: "NoFulfillment";
|
|
2506
2525
|
} | undefined;
|
|
2507
2526
|
}, {
|
|
2508
2527
|
type: "Bundle";
|
|
@@ -2595,6 +2614,8 @@ declare const orderSchema: z.ZodObject<{
|
|
|
2595
2614
|
licenseIds: string[];
|
|
2596
2615
|
}>;
|
|
2597
2616
|
};
|
|
2617
|
+
} | {
|
|
2618
|
+
type: "NoFulfillment";
|
|
2598
2619
|
} | undefined;
|
|
2599
2620
|
}>]>, "many">;
|
|
2600
2621
|
lastUpdated: z.ZodObject<{
|
|
@@ -2752,6 +2773,8 @@ declare const orderSchema: z.ZodObject<{
|
|
|
2752
2773
|
licenseIds: string[];
|
|
2753
2774
|
}>;
|
|
2754
2775
|
};
|
|
2776
|
+
} | {
|
|
2777
|
+
type: "NoFulfillment";
|
|
2755
2778
|
} | undefined;
|
|
2756
2779
|
} | {
|
|
2757
2780
|
type: "Bundle";
|
|
@@ -2844,6 +2867,8 @@ declare const orderSchema: z.ZodObject<{
|
|
|
2844
2867
|
licenseIds: string[];
|
|
2845
2868
|
}>;
|
|
2846
2869
|
};
|
|
2870
|
+
} | {
|
|
2871
|
+
type: "NoFulfillment";
|
|
2847
2872
|
} | undefined;
|
|
2848
2873
|
})[];
|
|
2849
2874
|
isRefunded: boolean;
|
|
@@ -3049,6 +3074,8 @@ declare const orderSchema: z.ZodObject<{
|
|
|
3049
3074
|
licenseIds: string[];
|
|
3050
3075
|
}>;
|
|
3051
3076
|
};
|
|
3077
|
+
} | {
|
|
3078
|
+
type: "NoFulfillment";
|
|
3052
3079
|
} | undefined;
|
|
3053
3080
|
} | {
|
|
3054
3081
|
type: "Bundle";
|
|
@@ -3141,6 +3168,8 @@ declare const orderSchema: z.ZodObject<{
|
|
|
3141
3168
|
licenseIds: string[];
|
|
3142
3169
|
}>;
|
|
3143
3170
|
};
|
|
3171
|
+
} | {
|
|
3172
|
+
type: "NoFulfillment";
|
|
3144
3173
|
} | undefined;
|
|
3145
3174
|
})[];
|
|
3146
3175
|
isRefunded: boolean;
|
|
@@ -3824,6 +3853,7 @@ interface MoonbaseConfiguration {
|
|
|
3824
3853
|
declare class MoonbaseClient {
|
|
3825
3854
|
private readonly configuration;
|
|
3826
3855
|
constructor(configuration: MoonbaseConfiguration);
|
|
3856
|
+
api: MoonbaseApi;
|
|
3827
3857
|
activationRequests: ActivationRequestEndpoints;
|
|
3828
3858
|
customers: CustomerEndpoints;
|
|
3829
3859
|
licenses: LicenseEndpoints;
|
|
@@ -3833,4 +3863,4 @@ declare class MoonbaseClient {
|
|
|
3833
3863
|
orders: OrderEndpoints;
|
|
3834
3864
|
}
|
|
3835
3865
|
|
|
3836
|
-
export { ActivationMethod, type ActivationRequest, ActivationRequestStatus, ActivationStatus, type Bundle, ConflictError, type CreateVoucherRequest, type Customer, type ImportCustomerRequest, type ImportLicenseRequest, type ImportTrialRequest, type License, type LicenseActivation, LicenseStatus, MoonbaseClient, type MoonbaseConfiguration, MoonbaseError, NotAuthenticatedError, NotAuthorizedError, NotFoundError, type Order, OrderStatus, type Page, type PricingVariation, type Product, ProductStatus, type ProvisionLicensesRequest, type Quantifiable, type Trial, TrialStatus, type Voucher };
|
|
3866
|
+
export { ActivationMethod, type ActivationRequest, ActivationRequestStatus, ActivationStatus, type Bundle, ConflictError, type CreateVoucherRequest, type Customer, type ImportCustomerRequest, type ImportLicenseRequest, type ImportTrialRequest, type License, type LicenseActivation, LicenseStatus, MoonbaseApi, MoonbaseClient, type MoonbaseConfiguration, MoonbaseError, NotAuthenticatedError, NotAuthorizedError, NotFoundError, type Order, OrderStatus, type Page, type PricingVariation, type Product, ProductStatus, type ProvisionLicensesRequest, type Quantifiable, type Trial, TrialStatus, type Voucher, objectToQuery };
|
package/dist/index.js
CHANGED
|
@@ -469,10 +469,14 @@ var subscriptionLineItemFulfillmentSchema = z8.object({
|
|
|
469
469
|
bundleLineItemFulfillmentSchema
|
|
470
470
|
])
|
|
471
471
|
});
|
|
472
|
+
var noLineItemFulfillmentSchema = z8.object({
|
|
473
|
+
type: z8.literal("NoFulfillment")
|
|
474
|
+
});
|
|
472
475
|
var lineItemFulfillmentSchema = z8.discriminatedUnion("type", [
|
|
473
476
|
licenseLineItemFulfillmentSchema,
|
|
474
477
|
bundleLineItemFulfillmentSchema,
|
|
475
|
-
subscriptionLineItemFulfillmentSchema
|
|
478
|
+
subscriptionLineItemFulfillmentSchema,
|
|
479
|
+
noLineItemFulfillmentSchema
|
|
476
480
|
]);
|
|
477
481
|
var lineItemTotalSchema = z8.object({
|
|
478
482
|
original: moneySchema,
|
|
@@ -671,14 +675,14 @@ var MoonbaseClient = class {
|
|
|
671
675
|
constructor(configuration) {
|
|
672
676
|
this.configuration = configuration;
|
|
673
677
|
this.configuration.endpoint = this.configuration.endpoint.replace(/\/$/, "");
|
|
674
|
-
|
|
675
|
-
this.activationRequests = new ActivationRequestEndpoints(api);
|
|
676
|
-
this.customers = new CustomerEndpoints(api);
|
|
677
|
-
this.licenses = new LicenseEndpoints(api);
|
|
678
|
-
this.products = new ProductEndpoints(api);
|
|
679
|
-
this.trials = new TrialEndpoints(api);
|
|
680
|
-
this.vouchers = new VoucherEndpoints(api);
|
|
681
|
-
this.orders = new OrderEndpoints(api);
|
|
678
|
+
this.api = new MoonbaseApi(this.configuration.endpoint, this.configuration.apiKey);
|
|
679
|
+
this.activationRequests = new ActivationRequestEndpoints(this.api);
|
|
680
|
+
this.customers = new CustomerEndpoints(this.api);
|
|
681
|
+
this.licenses = new LicenseEndpoints(this.api);
|
|
682
|
+
this.products = new ProductEndpoints(this.api);
|
|
683
|
+
this.trials = new TrialEndpoints(this.api);
|
|
684
|
+
this.vouchers = new VoucherEndpoints(this.api);
|
|
685
|
+
this.orders = new OrderEndpoints(this.api);
|
|
682
686
|
}
|
|
683
687
|
};
|
|
684
688
|
export {
|
|
@@ -687,6 +691,7 @@ export {
|
|
|
687
691
|
ActivationStatus,
|
|
688
692
|
ConflictError,
|
|
689
693
|
LicenseStatus,
|
|
694
|
+
MoonbaseApi,
|
|
690
695
|
MoonbaseClient,
|
|
691
696
|
MoonbaseError,
|
|
692
697
|
NotAuthenticatedError,
|
|
@@ -694,5 +699,6 @@ export {
|
|
|
694
699
|
NotFoundError,
|
|
695
700
|
OrderStatus,
|
|
696
701
|
ProductStatus,
|
|
697
|
-
TrialStatus
|
|
702
|
+
TrialStatus,
|
|
703
|
+
objectToQuery
|
|
698
704
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moonbase.sh/api",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.3.
|
|
4
|
+
"version": "0.3.11",
|
|
5
5
|
"description": "Package to let you integrate backends with Moonbase.sh as payment and delivery provider",
|
|
6
6
|
"author": "Tobias Lønnerød Madsen <m@dsen.tv>",
|
|
7
7
|
"license": "MIT",
|