@paygentic/sdk 0.7.10 → 0.7.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/commonjs/funcs/entitlementsIssue.d.ts +1 -1
- package/dist/commonjs/funcs/entitlementsIssue.d.ts.map +1 -1
- package/dist/commonjs/funcs/entitlementsIssue.js +1 -1
- package/dist/commonjs/funcs/entitlementsIssue.js.map +1 -1
- package/dist/commonjs/funcs/entitlementsList.d.ts +4 -0
- package/dist/commonjs/funcs/entitlementsList.d.ts.map +1 -1
- package/dist/commonjs/funcs/entitlementsList.js +4 -0
- package/dist/commonjs/funcs/entitlementsList.js.map +1 -1
- package/dist/commonjs/lib/config.d.ts +2 -2
- package/dist/commonjs/lib/config.js +2 -2
- package/dist/commonjs/models/booleanentitlementdetail.d.ts +16 -19
- package/dist/commonjs/models/booleanentitlementdetail.d.ts.map +1 -1
- package/dist/commonjs/models/booleanentitlementdetail.js +8 -15
- package/dist/commonjs/models/booleanentitlementdetail.js.map +1 -1
- package/dist/commonjs/models/booleanentitlementlistitem.d.ts +66 -0
- package/dist/commonjs/models/booleanentitlementlistitem.d.ts.map +1 -0
- package/dist/commonjs/models/{entitlement.js → booleanentitlementlistitem.js} +16 -27
- package/dist/commonjs/models/booleanentitlementlistitem.js.map +1 -0
- package/dist/commonjs/models/entitlementlistitem.d.ts +14 -0
- package/dist/commonjs/models/entitlementlistitem.d.ts.map +1 -0
- package/dist/commonjs/models/entitlementlistitem.js +55 -0
- package/dist/commonjs/models/entitlementlistitem.js.map +1 -0
- package/dist/commonjs/models/entitlementstatus.d.ts +17 -0
- package/dist/commonjs/models/entitlementstatus.d.ts.map +1 -0
- package/dist/commonjs/models/entitlementstatus.js +51 -0
- package/dist/commonjs/models/entitlementstatus.js.map +1 -0
- package/dist/commonjs/models/index.d.ts +5 -2
- package/dist/commonjs/models/index.d.ts.map +1 -1
- package/dist/commonjs/models/index.js +5 -2
- package/dist/commonjs/models/index.js.map +1 -1
- package/dist/commonjs/models/invoice.d.ts +4 -0
- package/dist/commonjs/models/invoice.d.ts.map +1 -1
- package/dist/commonjs/models/invoice.js +1 -0
- package/dist/commonjs/models/invoice.js.map +1 -1
- package/dist/commonjs/models/meteredentitlementdetail.d.ts +20 -23
- package/dist/commonjs/models/meteredentitlementdetail.d.ts.map +1 -1
- package/dist/commonjs/models/meteredentitlementdetail.js +10 -17
- package/dist/commonjs/models/meteredentitlementdetail.js.map +1 -1
- package/dist/commonjs/models/meteredentitlementlistitem.d.ts +90 -0
- package/dist/commonjs/models/meteredentitlementlistitem.d.ts.map +1 -0
- package/dist/commonjs/models/{entitlementaccessresult.js → meteredentitlementlistitem.js} +23 -37
- package/dist/commonjs/models/meteredentitlementlistitem.js.map +1 -0
- package/dist/commonjs/models/operations/listentitlements.d.ts +2 -2
- package/dist/commonjs/models/operations/listentitlements.d.ts.map +1 -1
- package/dist/commonjs/models/operations/listentitlements.js +1 -1
- package/dist/commonjs/models/operations/listentitlements.js.map +1 -1
- package/dist/commonjs/models/operations/updatesubscription.d.ts +3 -0
- package/dist/commonjs/models/operations/updatesubscription.d.ts.map +1 -1
- package/dist/commonjs/models/operations/updatesubscription.js.map +1 -1
- package/dist/commonjs/models/staticentitlementdetail.d.ts +12 -21
- package/dist/commonjs/models/staticentitlementdetail.d.ts.map +1 -1
- package/dist/commonjs/models/staticentitlementdetail.js +8 -16
- package/dist/commonjs/models/staticentitlementdetail.js.map +1 -1
- package/dist/commonjs/models/staticentitlementlistitem.d.ts +66 -0
- package/dist/commonjs/models/staticentitlementlistitem.d.ts.map +1 -0
- package/dist/commonjs/models/staticentitlementlistitem.js +63 -0
- package/dist/commonjs/models/staticentitlementlistitem.js.map +1 -0
- package/dist/commonjs/sdk/entitlements.d.ts +5 -1
- package/dist/commonjs/sdk/entitlements.d.ts.map +1 -1
- package/dist/commonjs/sdk/entitlements.js +4 -0
- package/dist/commonjs/sdk/entitlements.js.map +1 -1
- package/dist/esm/funcs/entitlementsIssue.d.ts +1 -1
- package/dist/esm/funcs/entitlementsIssue.d.ts.map +1 -1
- package/dist/esm/funcs/entitlementsIssue.js +1 -1
- package/dist/esm/funcs/entitlementsIssue.js.map +1 -1
- package/dist/esm/funcs/entitlementsList.d.ts +4 -0
- package/dist/esm/funcs/entitlementsList.d.ts.map +1 -1
- package/dist/esm/funcs/entitlementsList.js +4 -0
- package/dist/esm/funcs/entitlementsList.js.map +1 -1
- package/dist/esm/lib/config.d.ts +2 -2
- package/dist/esm/lib/config.js +2 -2
- package/dist/esm/models/booleanentitlementdetail.d.ts +16 -19
- package/dist/esm/models/booleanentitlementdetail.d.ts.map +1 -1
- package/dist/esm/models/booleanentitlementdetail.js +7 -14
- package/dist/esm/models/booleanentitlementdetail.js.map +1 -1
- package/dist/esm/models/booleanentitlementlistitem.d.ts +66 -0
- package/dist/esm/models/booleanentitlementlistitem.d.ts.map +1 -0
- package/dist/esm/models/booleanentitlementlistitem.js +26 -0
- package/dist/esm/models/booleanentitlementlistitem.js.map +1 -0
- package/dist/esm/models/entitlementlistitem.d.ts +14 -0
- package/dist/esm/models/entitlementlistitem.d.ts.map +1 -0
- package/dist/esm/models/entitlementlistitem.js +18 -0
- package/dist/esm/models/entitlementlistitem.js.map +1 -0
- package/dist/esm/models/entitlementstatus.d.ts +17 -0
- package/dist/esm/models/entitlementstatus.d.ts.map +1 -0
- package/dist/esm/models/entitlementstatus.js +15 -0
- package/dist/esm/models/entitlementstatus.js.map +1 -0
- package/dist/esm/models/index.d.ts +5 -2
- package/dist/esm/models/index.d.ts.map +1 -1
- package/dist/esm/models/index.js +5 -2
- package/dist/esm/models/index.js.map +1 -1
- package/dist/esm/models/invoice.d.ts +4 -0
- package/dist/esm/models/invoice.d.ts.map +1 -1
- package/dist/esm/models/invoice.js +1 -0
- package/dist/esm/models/invoice.js.map +1 -1
- package/dist/esm/models/meteredentitlementdetail.d.ts +20 -23
- package/dist/esm/models/meteredentitlementdetail.d.ts.map +1 -1
- package/dist/esm/models/meteredentitlementdetail.js +9 -16
- package/dist/esm/models/meteredentitlementdetail.js.map +1 -1
- package/dist/esm/models/meteredentitlementlistitem.d.ts +90 -0
- package/dist/esm/models/meteredentitlementlistitem.d.ts.map +1 -0
- package/dist/esm/models/meteredentitlementlistitem.js +32 -0
- package/dist/esm/models/meteredentitlementlistitem.js.map +1 -0
- package/dist/esm/models/operations/listentitlements.d.ts +2 -2
- package/dist/esm/models/operations/listentitlements.d.ts.map +1 -1
- package/dist/esm/models/operations/listentitlements.js +1 -1
- package/dist/esm/models/operations/listentitlements.js.map +1 -1
- package/dist/esm/models/operations/updatesubscription.d.ts +3 -0
- package/dist/esm/models/operations/updatesubscription.d.ts.map +1 -1
- package/dist/esm/models/operations/updatesubscription.js.map +1 -1
- package/dist/esm/models/staticentitlementdetail.d.ts +12 -21
- package/dist/esm/models/staticentitlementdetail.d.ts.map +1 -1
- package/dist/esm/models/staticentitlementdetail.js +7 -15
- package/dist/esm/models/staticentitlementdetail.js.map +1 -1
- package/dist/esm/models/staticentitlementlistitem.d.ts +66 -0
- package/dist/esm/models/staticentitlementlistitem.d.ts.map +1 -0
- package/dist/esm/models/staticentitlementlistitem.js +26 -0
- package/dist/esm/models/staticentitlementlistitem.js.map +1 -0
- package/dist/esm/sdk/entitlements.d.ts +5 -1
- package/dist/esm/sdk/entitlements.d.ts.map +1 -1
- package/dist/esm/sdk/entitlements.js +4 -0
- package/dist/esm/sdk/entitlements.js.map +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/funcs/entitlementsIssue.ts +4 -4
- package/src/funcs/entitlementsList.ts +4 -0
- package/src/lib/config.ts +2 -2
- package/src/models/booleanentitlementdetail.ts +22 -28
- package/src/models/booleanentitlementlistitem.ts +100 -0
- package/src/models/entitlementlistitem.ts +49 -0
- package/src/models/entitlementstatus.ts +24 -0
- package/src/models/index.ts +5 -2
- package/src/models/invoice.ts +5 -0
- package/src/models/meteredentitlementdetail.ts +28 -34
- package/src/models/meteredentitlementlistitem.ts +134 -0
- package/src/models/operations/listentitlements.ts +3 -3
- package/src/models/operations/updatesubscription.ts +3 -0
- package/src/models/staticentitlementdetail.ts +19 -30
- package/src/models/staticentitlementlistitem.ts +100 -0
- package/src/sdk/entitlements.ts +5 -1
- package/dist/commonjs/models/entitlement.d.ts +0 -71
- package/dist/commonjs/models/entitlement.d.ts.map +0 -1
- package/dist/commonjs/models/entitlement.js.map +0 -1
- package/dist/commonjs/models/entitlementaccessresult.d.ts +0 -99
- package/dist/commonjs/models/entitlementaccessresult.d.ts.map +0 -1
- package/dist/commonjs/models/entitlementaccessresult.js.map +0 -1
- package/dist/esm/models/entitlement.d.ts +0 -71
- package/dist/esm/models/entitlement.d.ts.map +0 -1
- package/dist/esm/models/entitlement.js +0 -37
- package/dist/esm/models/entitlement.js.map +0 -1
- package/dist/esm/models/entitlementaccessresult.d.ts +0 -99
- package/dist/esm/models/entitlementaccessresult.d.ts.map +0 -1
- package/dist/esm/models/entitlementaccessresult.js +0 -46
- package/dist/esm/models/entitlementaccessresult.js.map +0 -1
- package/src/models/entitlement.ts +0 -107
- package/src/models/entitlementaccessresult.ts +0 -147
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import * as z from "zod/v3";
|
|
2
|
-
import { ClosedEnum } from "../types/enums.js";
|
|
3
|
-
import { Result as SafeParseResult } from "../types/fp.js";
|
|
4
|
-
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
5
|
-
export declare const EntitlementObject: {
|
|
6
|
-
readonly Entitlement: "entitlement";
|
|
7
|
-
};
|
|
8
|
-
export type EntitlementObject = ClosedEnum<typeof EntitlementObject>;
|
|
9
|
-
/**
|
|
10
|
-
* Current status of the entitlement.
|
|
11
|
-
*/
|
|
12
|
-
export declare const EntitlementStatus: {
|
|
13
|
-
readonly Active: "active";
|
|
14
|
-
readonly Canceled: "canceled";
|
|
15
|
-
readonly Expired: "expired";
|
|
16
|
-
};
|
|
17
|
-
/**
|
|
18
|
-
* Current status of the entitlement.
|
|
19
|
-
*/
|
|
20
|
-
export type EntitlementStatus = ClosedEnum<typeof EntitlementStatus>;
|
|
21
|
-
export type Entitlement = {
|
|
22
|
-
object: EntitlementObject;
|
|
23
|
-
/**
|
|
24
|
-
* Unique identifier for the entitlement.
|
|
25
|
-
*/
|
|
26
|
-
id: string;
|
|
27
|
-
/**
|
|
28
|
-
* Unique identifier for a customer
|
|
29
|
-
*/
|
|
30
|
-
customerId: string;
|
|
31
|
-
/**
|
|
32
|
-
* The feature this entitlement grants access to.
|
|
33
|
-
*/
|
|
34
|
-
featureId: string;
|
|
35
|
-
/**
|
|
36
|
-
* The subscription this entitlement is associated with, if any.
|
|
37
|
-
*/
|
|
38
|
-
subscriptionId?: string | null | undefined;
|
|
39
|
-
/**
|
|
40
|
-
* Current status of the entitlement.
|
|
41
|
-
*/
|
|
42
|
-
status: EntitlementStatus;
|
|
43
|
-
/**
|
|
44
|
-
* When the entitlement becomes active.
|
|
45
|
-
*/
|
|
46
|
-
activeFrom: Date;
|
|
47
|
-
/**
|
|
48
|
-
* When the entitlement expires. Null means no expiration.
|
|
49
|
-
*/
|
|
50
|
-
activeTo?: Date | null | undefined;
|
|
51
|
-
/**
|
|
52
|
-
* Configuration values for static features.
|
|
53
|
-
*/
|
|
54
|
-
config: {
|
|
55
|
-
[k: string]: any;
|
|
56
|
-
} | null;
|
|
57
|
-
/**
|
|
58
|
-
* Additional metadata for the entitlement.
|
|
59
|
-
*/
|
|
60
|
-
metadata?: {
|
|
61
|
-
[k: string]: string;
|
|
62
|
-
} | undefined;
|
|
63
|
-
};
|
|
64
|
-
/** @internal */
|
|
65
|
-
export declare const EntitlementObject$inboundSchema: z.ZodNativeEnum<typeof EntitlementObject>;
|
|
66
|
-
/** @internal */
|
|
67
|
-
export declare const EntitlementStatus$inboundSchema: z.ZodNativeEnum<typeof EntitlementStatus>;
|
|
68
|
-
/** @internal */
|
|
69
|
-
export declare const Entitlement$inboundSchema: z.ZodType<Entitlement, z.ZodTypeDef, unknown>;
|
|
70
|
-
export declare function entitlementFromJSON(jsonString: string): SafeParseResult<Entitlement, SDKValidationError>;
|
|
71
|
-
//# sourceMappingURL=entitlement.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"entitlement.d.ts","sourceRoot":"","sources":["../../../src/models/entitlement.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAE5B,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAEpE,eAAO,MAAM,iBAAiB;;CAEpB,CAAC;AACX,MAAM,MAAM,iBAAiB,GAAG,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAErE;;GAEG;AACH,eAAO,MAAM,iBAAiB;;;;CAIpB,CAAC;AACX;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAErE,MAAM,MAAM,WAAW,GAAG;IACxB,MAAM,EAAE,iBAAiB,CAAC;IAC1B;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IACX;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAC3C;;OAEG;IACH,MAAM,EAAE,iBAAiB,CAAC;IAC1B;;OAEG;IACH,UAAU,EAAE,IAAI,CAAC;IACjB;;OAEG;IACH,QAAQ,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,SAAS,CAAC;IACnC;;OAEG;IACH,MAAM,EAAE;QAAE,CAAC,CAAC,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,GAAG,IAAI,CAAC;IACpC;;OAEG;IACH,QAAQ,CAAC,E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MAAM,EAAE;IACd,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;IACtB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,cAAc,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IACjD,MAAM,EAAE,uCAA+B;IACvC,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC;IAC7E,QAAQ,EAAE,CAAC,CAAC,QAAQ,CAClB,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,CAClE,CAAC,QAAQ,EAAE;IACZ,MAAM,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC;IACrC,QAAQ,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;CAC1C,CAAC,CAAC;AAEH,SAAgB,mBAAmB,CACjC,UAAkB;IAElB,OAAO,IAAA,sBAAS,EACd,UAAU,EACV,CAAC,CAAC,EAAE,EAAE,CAAC,iCAAyB,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EACrD,yCAAyC,CAC1C,CAAC;AACJ,CAAC"}
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import * as z from "zod/v3";
|
|
2
|
-
import { ClosedEnum } from "../types/enums.js";
|
|
3
|
-
import { Result as SafeParseResult } from "../types/fp.js";
|
|
4
|
-
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
5
|
-
/**
|
|
6
|
-
* The type of feature: `boolean` (on/off), `static` (with config), or `metered` (usage-based).
|
|
7
|
-
*/
|
|
8
|
-
export declare const FeatureTypeEnum: {
|
|
9
|
-
readonly Boolean: "boolean";
|
|
10
|
-
readonly Static: "static";
|
|
11
|
-
readonly Metered: "metered";
|
|
12
|
-
};
|
|
13
|
-
/**
|
|
14
|
-
* The type of feature: `boolean` (on/off), `static` (with config), or `metered` (usage-based).
|
|
15
|
-
*/
|
|
16
|
-
export type FeatureTypeEnum = ClosedEnum<typeof FeatureTypeEnum>;
|
|
17
|
-
/**
|
|
18
|
-
* Current status of the entitlement.
|
|
19
|
-
*/
|
|
20
|
-
export declare const EntitlementAccessResultStatus: {
|
|
21
|
-
readonly Active: "active";
|
|
22
|
-
readonly Canceled: "canceled";
|
|
23
|
-
readonly Expired: "expired";
|
|
24
|
-
};
|
|
25
|
-
/**
|
|
26
|
-
* Current status of the entitlement.
|
|
27
|
-
*/
|
|
28
|
-
export type EntitlementAccessResultStatus = ClosedEnum<typeof EntitlementAccessResultStatus>;
|
|
29
|
-
/**
|
|
30
|
-
* A customer's entitlement to a specific feature.
|
|
31
|
-
*/
|
|
32
|
-
export type EntitlementAccessResult = {
|
|
33
|
-
/**
|
|
34
|
-
* Whether the customer currently has active access to this feature.
|
|
35
|
-
*/
|
|
36
|
-
hasAccess: boolean;
|
|
37
|
-
/**
|
|
38
|
-
* The unique key identifying the feature.
|
|
39
|
-
*/
|
|
40
|
-
featureKey: string;
|
|
41
|
-
/**
|
|
42
|
-
* The type of feature: `boolean` (on/off), `static` (with config), or `metered` (usage-based).
|
|
43
|
-
*/
|
|
44
|
-
featureType: FeatureTypeEnum;
|
|
45
|
-
/**
|
|
46
|
-
* Configuration values for `static` features. Null for other types.
|
|
47
|
-
*/
|
|
48
|
-
config?: {
|
|
49
|
-
[k: string]: any;
|
|
50
|
-
} | null | undefined;
|
|
51
|
-
/**
|
|
52
|
-
* Unique identifier for this entitlement.
|
|
53
|
-
*/
|
|
54
|
-
entitlementId: string;
|
|
55
|
-
/**
|
|
56
|
-
* Unique identifier for a product
|
|
57
|
-
*/
|
|
58
|
-
productId: string;
|
|
59
|
-
/**
|
|
60
|
-
* When the entitlement becomes active.
|
|
61
|
-
*/
|
|
62
|
-
activeFrom: Date;
|
|
63
|
-
/**
|
|
64
|
-
* When the entitlement expires. Null means no expiration.
|
|
65
|
-
*/
|
|
66
|
-
activeTo?: Date | null | undefined;
|
|
67
|
-
/**
|
|
68
|
-
* Current status of the entitlement.
|
|
69
|
-
*/
|
|
70
|
-
status: EntitlementAccessResultStatus;
|
|
71
|
-
/**
|
|
72
|
-
* Remaining grant balance. Only present for `metered` features.
|
|
73
|
-
*/
|
|
74
|
-
balance?: number | null | undefined;
|
|
75
|
-
/**
|
|
76
|
-
* Total usage in the current period. Only present for `metered` features.
|
|
77
|
-
*/
|
|
78
|
-
usageInPeriod?: number | null | undefined;
|
|
79
|
-
/**
|
|
80
|
-
* Amount of overage beyond granted balance. Only present for `metered` features.
|
|
81
|
-
*/
|
|
82
|
-
overage?: number | null | undefined;
|
|
83
|
-
/**
|
|
84
|
-
* Start of the current usage period. Only present for `metered` features with a usage period configured.
|
|
85
|
-
*/
|
|
86
|
-
currentPeriodStart?: Date | null | undefined;
|
|
87
|
-
/**
|
|
88
|
-
* End of the current usage period. Only present for `metered` features with a usage period configured.
|
|
89
|
-
*/
|
|
90
|
-
currentPeriodEnd?: Date | null | undefined;
|
|
91
|
-
};
|
|
92
|
-
/** @internal */
|
|
93
|
-
export declare const FeatureTypeEnum$inboundSchema: z.ZodNativeEnum<typeof FeatureTypeEnum>;
|
|
94
|
-
/** @internal */
|
|
95
|
-
export declare const EntitlementAccessResultStatus$inboundSchema: z.ZodNativeEnum<typeof EntitlementAccessResultStatus>;
|
|
96
|
-
/** @internal */
|
|
97
|
-
export declare const EntitlementAccessResult$inboundSchema: z.ZodType<EntitlementAccessResult, z.ZodTypeDef, unknown>;
|
|
98
|
-
export declare function entitlementAccessResultFromJSON(jsonString: string): SafeParseResult<EntitlementAccessResult, SDKValidationError>;
|
|
99
|
-
//# sourceMappingURL=entitlementaccessresult.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"entitlementaccessresult.d.ts","sourceRoot":"","sources":["../../../src/models/entitlementaccessresult.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAE5B,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAEpE;;GAEG;AACH,eAAO,MAAM,eAAe;;;;CAIlB,CAAC;AACX;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC;AAEjE;;GAEG;AACH,eAAO,MAAM,6BAA6B;;;;CAIhC,CAAC;AACX;;GAEG;AACH,MAAM,MAAM,6BAA6B,GAAG,UAAU,CACpD,OAAO,6BAA6B,CACrC,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAAG;IACpC;;OAEG;IACH,SAAS,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,WAAW,EAAE,eAAe,CAAC;IAC7B;;OAEG;IACH,MAAM,CAAC,EAAE;QAAE,CAAC,CAAC,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,GAAG,IAAI,GAAG,SAAS,CAAC;IACjD;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,UAAU,EAAE,IAAI,CAAC;IACjB;;OAEG;IACH,QAAQ,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,SAAS,CAAC;IACnC;;OAEG;IACH,MAAM,EAAE,6BAA6B,CAAC;IACtC;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IACpC;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAC1C;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IACpC;;OAEG;IACH,kBAAkB,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,SAAS,CAAC;IAC7C;;OAEG;IACH,gBAAgB,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,SAAS,CAAC;CAC5C,CAAC;AAEF,gBAAgB;AAChB,eAAO,MAAM,6BAA6B,EAAE,CAAC,CAAC,aAAa,CACzD,OAAO,eAAe,CACS,CAAC;AAElC,gBAAgB;AAChB,eAAO,MAAM,2CAA2C,EAAE,CAAC,CAAC,aAAa,CACvE,OAAO,6BAA6B,CACS,CAAC;AAEhD,gBAAgB;AAChB,eAAO,MAAM,qCAAqC,EAAE,CAAC,CAAC,OAAO,CAC3D,uBAAuB,EACvB,CAAC,CAAC,UAAU,EACZ,OAAO,CAsBP,CAAC;AAEH,wBAAgB,+BAA+B,CAC7C,UAAU,EAAE,MAAM,GACjB,eAAe,CAAC,uBAAuB,EAAE,kBAAkB,CAAC,CAM9D"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"entitlementaccessresult.js","sourceRoot":"","sources":["../../../src/models/entitlementaccessresult.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwIH,0EAQC;AA9ID,0CAA4B;AAC5B,kDAA8C;AAK9C;;GAEG;AACU,QAAA,eAAe,GAAG;IAC7B,OAAO,EAAE,SAAS;IAClB,MAAM,EAAE,QAAQ;IAChB,OAAO,EAAE,SAAS;CACV,CAAC;AAMX;;GAEG;AACU,QAAA,6BAA6B,GAAG;IAC3C,MAAM,EAAE,QAAQ;IAChB,QAAQ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,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IAC1C,kBAAkB,EAAE,CAAC,CAAC,QAAQ,CAC5B,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,CAClE,CAAC,QAAQ,EAAE;IACZ,gBAAgB,EAAE,CAAC,CAAC,QAAQ,CAC1B,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,CAClE,CAAC,QAAQ,EAAE;CACb,CAAC,CAAC;AAEH,SAAgB,+BAA+B,CAC7C,UAAkB;IAElB,OAAO,IAAA,sBAAS,EACd,UAAU,EACV,CAAC,CAAC,EAAE,EAAE,CAAC,6CAAqC,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EACjE,qDAAqD,CACtD,CAAC;AACJ,CAAC"}
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import * as z from "zod/v3";
|
|
2
|
-
import { ClosedEnum } from "../types/enums.js";
|
|
3
|
-
import { Result as SafeParseResult } from "../types/fp.js";
|
|
4
|
-
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
5
|
-
export declare const EntitlementObject: {
|
|
6
|
-
readonly Entitlement: "entitlement";
|
|
7
|
-
};
|
|
8
|
-
export type EntitlementObject = ClosedEnum<typeof EntitlementObject>;
|
|
9
|
-
/**
|
|
10
|
-
* Current status of the entitlement.
|
|
11
|
-
*/
|
|
12
|
-
export declare const EntitlementStatus: {
|
|
13
|
-
readonly Active: "active";
|
|
14
|
-
readonly Canceled: "canceled";
|
|
15
|
-
readonly Expired: "expired";
|
|
16
|
-
};
|
|
17
|
-
/**
|
|
18
|
-
* Current status of the entitlement.
|
|
19
|
-
*/
|
|
20
|
-
export type EntitlementStatus = ClosedEnum<typeof EntitlementStatus>;
|
|
21
|
-
export type Entitlement = {
|
|
22
|
-
object: EntitlementObject;
|
|
23
|
-
/**
|
|
24
|
-
* Unique identifier for the entitlement.
|
|
25
|
-
*/
|
|
26
|
-
id: string;
|
|
27
|
-
/**
|
|
28
|
-
* Unique identifier for a customer
|
|
29
|
-
*/
|
|
30
|
-
customerId: string;
|
|
31
|
-
/**
|
|
32
|
-
* The feature this entitlement grants access to.
|
|
33
|
-
*/
|
|
34
|
-
featureId: string;
|
|
35
|
-
/**
|
|
36
|
-
* The subscription this entitlement is associated with, if any.
|
|
37
|
-
*/
|
|
38
|
-
subscriptionId?: string | null | undefined;
|
|
39
|
-
/**
|
|
40
|
-
* Current status of the entitlement.
|
|
41
|
-
*/
|
|
42
|
-
status: EntitlementStatus;
|
|
43
|
-
/**
|
|
44
|
-
* When the entitlement becomes active.
|
|
45
|
-
*/
|
|
46
|
-
activeFrom: Date;
|
|
47
|
-
/**
|
|
48
|
-
* When the entitlement expires. Null means no expiration.
|
|
49
|
-
*/
|
|
50
|
-
activeTo?: Date | null | undefined;
|
|
51
|
-
/**
|
|
52
|
-
* Configuration values for static features.
|
|
53
|
-
*/
|
|
54
|
-
config: {
|
|
55
|
-
[k: string]: any;
|
|
56
|
-
} | null;
|
|
57
|
-
/**
|
|
58
|
-
* Additional metadata for the entitlement.
|
|
59
|
-
*/
|
|
60
|
-
metadata?: {
|
|
61
|
-
[k: string]: string;
|
|
62
|
-
} | undefined;
|
|
63
|
-
};
|
|
64
|
-
/** @internal */
|
|
65
|
-
export declare const EntitlementObject$inboundSchema: z.ZodNativeEnum<typeof EntitlementObject>;
|
|
66
|
-
/** @internal */
|
|
67
|
-
export declare const EntitlementStatus$inboundSchema: z.ZodNativeEnum<typeof EntitlementStatus>;
|
|
68
|
-
/** @internal */
|
|
69
|
-
export declare const Entitlement$inboundSchema: z.ZodType<Entitlement, z.ZodTypeDef, unknown>;
|
|
70
|
-
export declare function entitlementFromJSON(jsonString: string): SafeParseResult<Entitlement, SDKValidationError>;
|
|
71
|
-
//# sourceMappingURL=entitlement.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"entitlement.d.ts","sourceRoot":"","sources":["../../../src/models/entitlement.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAE5B,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAEpE,eAAO,MAAM,iBAAiB;;CAEpB,CAAC;AACX,MAAM,MAAM,iBAAiB,GAAG,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAErE;;GAEG;AACH,eAAO,MAAM,iBAAiB;;;;CAIpB,CAAC;AACX;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAErE,MAAM,MAAM,WAAW,GAAG;IACxB,MAAM,EAAE,iBAAiB,CAAC;IAC1B;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IACX;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAC3C;;OAEG;IACH,MAAM,EAAE,iBAAiB,CAAC;IAC1B;;OAEG;IACH,UAAU,EAAE,IAAI,CAAC;IACjB;;OAEG;IACH,QAAQ,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,SAAS,CAAC;IACnC;;OAEG;IACH,MAAM,EAAE;QAAE,CAAC,CAAC,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,GAAG,IAAI,CAAC;IACpC;;OAEG;IACH,QAAQ,CAAC,EAAE;QAAE,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,GAAG,SAAS,CAAC;CAChD,CAAC;AAEF,gBAAgB;AAChB,eAAO,MAAM,+BAA+B,EAAE,CAAC,CAAC,aAAa,CAC3D,OAAO,iBAAiB,CACS,CAAC;AAEpC,gBAAgB;AAChB,eAAO,MAAM,+BAA+B,EAAE,CAAC,CAAC,aAAa,CAC3D,OAAO,iBAAiB,CACS,CAAC;AAEpC,gBAAgB;AAChB,eAAO,MAAM,yBAAyB,EAAE,CAAC,CAAC,OAAO,CAC/C,WAAW,EACX,CAAC,CAAC,UAAU,EACZ,OAAO,CAcP,CAAC;AAEH,wBAAgB,mBAAmB,CACjC,UAAU,EAAE,MAAM,GACjB,eAAe,CAAC,WAAW,EAAE,kBAAkB,CAAC,CAMlD"}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
*/
|
|
4
|
-
import * as z from "zod/v3";
|
|
5
|
-
import { safeParse } from "../lib/schemas.js";
|
|
6
|
-
export const EntitlementObject = {
|
|
7
|
-
Entitlement: "entitlement",
|
|
8
|
-
};
|
|
9
|
-
/**
|
|
10
|
-
* Current status of the entitlement.
|
|
11
|
-
*/
|
|
12
|
-
export const EntitlementStatus = {
|
|
13
|
-
Active: "active",
|
|
14
|
-
Canceled: "canceled",
|
|
15
|
-
Expired: "expired",
|
|
16
|
-
};
|
|
17
|
-
/** @internal */
|
|
18
|
-
export const EntitlementObject$inboundSchema = z.nativeEnum(EntitlementObject);
|
|
19
|
-
/** @internal */
|
|
20
|
-
export const EntitlementStatus$inboundSchema = z.nativeEnum(EntitlementStatus);
|
|
21
|
-
/** @internal */
|
|
22
|
-
export const Entitlement$inboundSchema = z.object({
|
|
23
|
-
object: EntitlementObject$inboundSchema.default("entitlement"),
|
|
24
|
-
id: z.string(),
|
|
25
|
-
customerId: z.string(),
|
|
26
|
-
featureId: z.string(),
|
|
27
|
-
subscriptionId: z.nullable(z.string()).optional(),
|
|
28
|
-
status: EntitlementStatus$inboundSchema,
|
|
29
|
-
activeFrom: z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
30
|
-
activeTo: z.nullable(z.string().datetime({ offset: true }).transform(v => new Date(v))).optional(),
|
|
31
|
-
config: z.nullable(z.record(z.any())),
|
|
32
|
-
metadata: z.record(z.string()).optional(),
|
|
33
|
-
});
|
|
34
|
-
export function entitlementFromJSON(jsonString) {
|
|
35
|
-
return safeParse(jsonString, (x) => Entitlement$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Entitlement' from JSON`);
|
|
36
|
-
}
|
|
37
|
-
//# sourceMappingURL=entitlement.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"entitlement.js","sourceRoot":"","sources":["../../../src/models/entitlement.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAK9C,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,WAAW,EAAE,aAAa;CAClB,CAAC;AAGX;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,MAAM,EAAE,QAAQ;IAChB,QAAQ,EAAE,UAAU;IACpB,OAAO,EAAE,SAAS;CACV,CAAC;AA8CX,gBAAgB;AAChB,MAAM,CAAC,MAAM,+BAA+B,GAExC,CAAC,CAAC,UAAU,CAAC,iBAAiB,CAAC,CAAC;AAEpC,gBAAgB;AAChB,MAAM,CAAC,MAAM,+BAA+B,GAExC,CAAC,CAAC,UAAU,CAAC,iBAAiB,CAAC,CAAC;AAEpC,gBAAgB;AAChB,MAAM,CAAC,MAAM,yBAAyB,GAIlC,CAAC,CAAC,MAA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";
|
|
3
|
-
import { Result as SafeParseResult } from "../types/fp.js";
|
|
4
|
-
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
5
|
-
/**
|
|
6
|
-
* The type of feature: `boolean` (on/off), `static` (with config), or `metered` (usage-based).
|
|
7
|
-
*/
|
|
8
|
-
export declare const FeatureTypeEnum: {
|
|
9
|
-
readonly Boolean: "boolean";
|
|
10
|
-
readonly Static: "static";
|
|
11
|
-
readonly Metered: "metered";
|
|
12
|
-
};
|
|
13
|
-
/**
|
|
14
|
-
* The type of feature: `boolean` (on/off), `static` (with config), or `metered` (usage-based).
|
|
15
|
-
*/
|
|
16
|
-
export type FeatureTypeEnum = ClosedEnum<typeof FeatureTypeEnum>;
|
|
17
|
-
/**
|
|
18
|
-
* Current status of the entitlement.
|
|
19
|
-
*/
|
|
20
|
-
export declare const EntitlementAccessResultStatus: {
|
|
21
|
-
readonly Active: "active";
|
|
22
|
-
readonly Canceled: "canceled";
|
|
23
|
-
readonly Expired: "expired";
|
|
24
|
-
};
|
|
25
|
-
/**
|
|
26
|
-
* Current status of the entitlement.
|
|
27
|
-
*/
|
|
28
|
-
export type EntitlementAccessResultStatus = ClosedEnum<typeof EntitlementAccessResultStatus>;
|
|
29
|
-
/**
|
|
30
|
-
* A customer's entitlement to a specific feature.
|
|
31
|
-
*/
|
|
32
|
-
export type EntitlementAccessResult = {
|
|
33
|
-
/**
|
|
34
|
-
* Whether the customer currently has active access to this feature.
|
|
35
|
-
*/
|
|
36
|
-
hasAccess: boolean;
|
|
37
|
-
/**
|
|
38
|
-
* The unique key identifying the feature.
|
|
39
|
-
*/
|
|
40
|
-
featureKey: string;
|
|
41
|
-
/**
|
|
42
|
-
* The type of feature: `boolean` (on/off), `static` (with config), or `metered` (usage-based).
|
|
43
|
-
*/
|
|
44
|
-
featureType: FeatureTypeEnum;
|
|
45
|
-
/**
|
|
46
|
-
* Configuration values for `static` features. Null for other types.
|
|
47
|
-
*/
|
|
48
|
-
config?: {
|
|
49
|
-
[k: string]: any;
|
|
50
|
-
} | null | undefined;
|
|
51
|
-
/**
|
|
52
|
-
* Unique identifier for this entitlement.
|
|
53
|
-
*/
|
|
54
|
-
entitlementId: string;
|
|
55
|
-
/**
|
|
56
|
-
* Unique identifier for a product
|
|
57
|
-
*/
|
|
58
|
-
productId: string;
|
|
59
|
-
/**
|
|
60
|
-
* When the entitlement becomes active.
|
|
61
|
-
*/
|
|
62
|
-
activeFrom: Date;
|
|
63
|
-
/**
|
|
64
|
-
* When the entitlement expires. Null means no expiration.
|
|
65
|
-
*/
|
|
66
|
-
activeTo?: Date | null | undefined;
|
|
67
|
-
/**
|
|
68
|
-
* Current status of the entitlement.
|
|
69
|
-
*/
|
|
70
|
-
status: EntitlementAccessResultStatus;
|
|
71
|
-
/**
|
|
72
|
-
* Remaining grant balance. Only present for `metered` features.
|
|
73
|
-
*/
|
|
74
|
-
balance?: number | null | undefined;
|
|
75
|
-
/**
|
|
76
|
-
* Total usage in the current period. Only present for `metered` features.
|
|
77
|
-
*/
|
|
78
|
-
usageInPeriod?: number | null | undefined;
|
|
79
|
-
/**
|
|
80
|
-
* Amount of overage beyond granted balance. Only present for `metered` features.
|
|
81
|
-
*/
|
|
82
|
-
overage?: number | null | undefined;
|
|
83
|
-
/**
|
|
84
|
-
* Start of the current usage period. Only present for `metered` features with a usage period configured.
|
|
85
|
-
*/
|
|
86
|
-
currentPeriodStart?: Date | null | undefined;
|
|
87
|
-
/**
|
|
88
|
-
* End of the current usage period. Only present for `metered` features with a usage period configured.
|
|
89
|
-
*/
|
|
90
|
-
currentPeriodEnd?: Date | null | undefined;
|
|
91
|
-
};
|
|
92
|
-
/** @internal */
|
|
93
|
-
export declare const FeatureTypeEnum$inboundSchema: z.ZodNativeEnum<typeof FeatureTypeEnum>;
|
|
94
|
-
/** @internal */
|
|
95
|
-
export declare const EntitlementAccessResultStatus$inboundSchema: z.ZodNativeEnum<typeof EntitlementAccessResultStatus>;
|
|
96
|
-
/** @internal */
|
|
97
|
-
export declare const EntitlementAccessResult$inboundSchema: z.ZodType<EntitlementAccessResult, z.ZodTypeDef, unknown>;
|
|
98
|
-
export declare function entitlementAccessResultFromJSON(jsonString: string): SafeParseResult<EntitlementAccessResult, SDKValidationError>;
|
|
99
|
-
//# sourceMappingURL=entitlementaccessresult.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"entitlementaccessresult.d.ts","sourceRoot":"","sources":["../../../src/models/entitlementaccessresult.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAE5B,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAEpE;;GAEG;AACH,eAAO,MAAM,eAAe;;;;CAIlB,CAAC;AACX;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC;AAEjE;;GAEG;AACH,eAAO,MAAM,6BAA6B;;;;CAIhC,CAAC;AACX;;GAEG;AACH,MAAM,MAAM,6BAA6B,GAAG,UAAU,CACpD,OAAO,6BAA6B,CACrC,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAAG;IACpC;;OAEG;IACH,SAAS,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,WAAW,EAAE,eAAe,CAAC;IAC7B;;OAEG;IACH,MAAM,CAAC,EAAE;QAAE,CAAC,CAAC,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,GAAG,IAAI,GAAG,SAAS,CAAC;IACjD;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,UAAU,EAAE,IAAI,CAAC;IACjB;;OAEG;IACH,QAAQ,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,SAAS,CAAC;IACnC;;OAEG;IACH,MAAM,EAAE,6BAA6B,CAAC;IACtC;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IACpC;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAC1C;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IACpC;;OAEG;IACH,kBAAkB,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,SAAS,CAAC;IAC7C;;OAEG;IACH,gBAAgB,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,SAAS,CAAC;CAC5C,CAAC;AAEF,gBAAgB;AAChB,eAAO,MAAM,6BAA6B,EAAE,CAAC,CAAC,aAAa,CACzD,OAAO,eAAe,CACS,CAAC;AAElC,gBAAgB;AAChB,eAAO,MAAM,2CAA2C,EAAE,CAAC,CAAC,aAAa,CACvE,OAAO,6BAA6B,CACS,CAAC;AAEhD,gBAAgB;AAChB,eAAO,MAAM,qCAAqC,EAAE,CAAC,CAAC,OAAO,CAC3D,uBAAuB,EACvB,CAAC,CAAC,UAAU,EACZ,OAAO,CAsBP,CAAC;AAEH,wBAAgB,+BAA+B,CAC7C,UAAU,EAAE,MAAM,GACjB,eAAe,CAAC,uBAAuB,EAAE,kBAAkB,CAAC,CAM9D"}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
*/
|
|
4
|
-
import * as z from "zod/v3";
|
|
5
|
-
import { safeParse } from "../lib/schemas.js";
|
|
6
|
-
/**
|
|
7
|
-
* The type of feature: `boolean` (on/off), `static` (with config), or `metered` (usage-based).
|
|
8
|
-
*/
|
|
9
|
-
export const FeatureTypeEnum = {
|
|
10
|
-
Boolean: "boolean",
|
|
11
|
-
Static: "static",
|
|
12
|
-
Metered: "metered",
|
|
13
|
-
};
|
|
14
|
-
/**
|
|
15
|
-
* Current status of the entitlement.
|
|
16
|
-
*/
|
|
17
|
-
export const EntitlementAccessResultStatus = {
|
|
18
|
-
Active: "active",
|
|
19
|
-
Canceled: "canceled",
|
|
20
|
-
Expired: "expired",
|
|
21
|
-
};
|
|
22
|
-
/** @internal */
|
|
23
|
-
export const FeatureTypeEnum$inboundSchema = z.nativeEnum(FeatureTypeEnum);
|
|
24
|
-
/** @internal */
|
|
25
|
-
export const EntitlementAccessResultStatus$inboundSchema = z.nativeEnum(EntitlementAccessResultStatus);
|
|
26
|
-
/** @internal */
|
|
27
|
-
export const EntitlementAccessResult$inboundSchema = z.object({
|
|
28
|
-
hasAccess: z.boolean(),
|
|
29
|
-
featureKey: z.string(),
|
|
30
|
-
featureType: FeatureTypeEnum$inboundSchema,
|
|
31
|
-
config: z.nullable(z.record(z.any())).optional(),
|
|
32
|
-
entitlementId: z.string(),
|
|
33
|
-
productId: z.string(),
|
|
34
|
-
activeFrom: z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
35
|
-
activeTo: z.nullable(z.string().datetime({ offset: true }).transform(v => new Date(v))).optional(),
|
|
36
|
-
status: EntitlementAccessResultStatus$inboundSchema,
|
|
37
|
-
balance: z.nullable(z.number()).optional(),
|
|
38
|
-
usageInPeriod: z.nullable(z.number()).optional(),
|
|
39
|
-
overage: z.nullable(z.number()).optional(),
|
|
40
|
-
currentPeriodStart: z.nullable(z.string().datetime({ offset: true }).transform(v => new Date(v))).optional(),
|
|
41
|
-
currentPeriodEnd: z.nullable(z.string().datetime({ offset: true }).transform(v => new Date(v))).optional(),
|
|
42
|
-
});
|
|
43
|
-
export function entitlementAccessResultFromJSON(jsonString) {
|
|
44
|
-
return safeParse(jsonString, (x) => EntitlementAccessResult$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EntitlementAccessResult' from JSON`);
|
|
45
|
-
}
|
|
46
|
-
//# sourceMappingURL=entitlementaccessresult.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"entitlementaccessresult.js","sourceRoot":"","sources":["../../../src/models/entitlementaccessresult.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAK9C;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,OAAO,EAAE,SAAS;IAClB,MAAM,EAAE,QAAQ;IAChB,OAAO,EAAE,SAAS;CACV,CAAC;AAMX;;GAEG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG;IAC3C,MAAM,EAAE,QAAQ;IAChB,QAAQ,EAAE,UAAU;IACpB,OAAO,EAAE,SAAS;CACV,CAAC;AAsEX,gBAAgB;AAChB,MAAM,CAAC,MAAM,6BAA6B,GAEtC,CAAC,CAAC,UAAU,CAAC,eAAe,CAAC,CAAC;AAElC,gBAAgB;AAChB,MAAM,CAAC,MAAM,2CAA2C,GAEpD,CAAC,CAAC,UAAU,CAAC,6BAA6B,CAAC,CAAC;AAEhD,gBAAgB;AAChB,MAAM,CAAC,MAAM,qCAAqC,GAI9C,CAAC,CAAC,MAAM,CAAC;IACX,SAAS,EAAE,CAAC,CAAC,OAAO,EAAE;IACtB,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;IACtB,WAAW,EAAE,6BAA6B;IAC1C,MAAM,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,QAAQ,EAAE;IAChD,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE;IACzB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,SAAS,CAAC,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,CAAC,CAAC,EACjE,qDAAqD,CACtD,CAAC;AACJ,CAAC"}
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import * as z from "zod/v3";
|
|
6
|
-
import { safeParse } from "../lib/schemas.js";
|
|
7
|
-
import { ClosedEnum } from "../types/enums.js";
|
|
8
|
-
import { Result as SafeParseResult } from "../types/fp.js";
|
|
9
|
-
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
10
|
-
|
|
11
|
-
export const EntitlementObject = {
|
|
12
|
-
Entitlement: "entitlement",
|
|
13
|
-
} as const;
|
|
14
|
-
export type EntitlementObject = ClosedEnum<typeof EntitlementObject>;
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Current status of the entitlement.
|
|
18
|
-
*/
|
|
19
|
-
export const EntitlementStatus = {
|
|
20
|
-
Active: "active",
|
|
21
|
-
Canceled: "canceled",
|
|
22
|
-
Expired: "expired",
|
|
23
|
-
} as const;
|
|
24
|
-
/**
|
|
25
|
-
* Current status of the entitlement.
|
|
26
|
-
*/
|
|
27
|
-
export type EntitlementStatus = ClosedEnum<typeof EntitlementStatus>;
|
|
28
|
-
|
|
29
|
-
export type Entitlement = {
|
|
30
|
-
object: EntitlementObject;
|
|
31
|
-
/**
|
|
32
|
-
* Unique identifier for the entitlement.
|
|
33
|
-
*/
|
|
34
|
-
id: string;
|
|
35
|
-
/**
|
|
36
|
-
* Unique identifier for a customer
|
|
37
|
-
*/
|
|
38
|
-
customerId: string;
|
|
39
|
-
/**
|
|
40
|
-
* The feature this entitlement grants access to.
|
|
41
|
-
*/
|
|
42
|
-
featureId: string;
|
|
43
|
-
/**
|
|
44
|
-
* The subscription this entitlement is associated with, if any.
|
|
45
|
-
*/
|
|
46
|
-
subscriptionId?: string | null | undefined;
|
|
47
|
-
/**
|
|
48
|
-
* Current status of the entitlement.
|
|
49
|
-
*/
|
|
50
|
-
status: EntitlementStatus;
|
|
51
|
-
/**
|
|
52
|
-
* When the entitlement becomes active.
|
|
53
|
-
*/
|
|
54
|
-
activeFrom: Date;
|
|
55
|
-
/**
|
|
56
|
-
* When the entitlement expires. Null means no expiration.
|
|
57
|
-
*/
|
|
58
|
-
activeTo?: Date | null | undefined;
|
|
59
|
-
/**
|
|
60
|
-
* Configuration values for static features.
|
|
61
|
-
*/
|
|
62
|
-
config: { [k: string]: any } | null;
|
|
63
|
-
/**
|
|
64
|
-
* Additional metadata for the entitlement.
|
|
65
|
-
*/
|
|
66
|
-
metadata?: { [k: string]: string } | undefined;
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
/** @internal */
|
|
70
|
-
export const EntitlementObject$inboundSchema: z.ZodNativeEnum<
|
|
71
|
-
typeof EntitlementObject
|
|
72
|
-
> = z.nativeEnum(EntitlementObject);
|
|
73
|
-
|
|
74
|
-
/** @internal */
|
|
75
|
-
export const EntitlementStatus$inboundSchema: z.ZodNativeEnum<
|
|
76
|
-
typeof EntitlementStatus
|
|
77
|
-
> = z.nativeEnum(EntitlementStatus);
|
|
78
|
-
|
|
79
|
-
/** @internal */
|
|
80
|
-
export const Entitlement$inboundSchema: z.ZodType<
|
|
81
|
-
Entitlement,
|
|
82
|
-
z.ZodTypeDef,
|
|
83
|
-
unknown
|
|
84
|
-
> = z.object({
|
|
85
|
-
object: EntitlementObject$inboundSchema.default("entitlement"),
|
|
86
|
-
id: z.string(),
|
|
87
|
-
customerId: z.string(),
|
|
88
|
-
featureId: z.string(),
|
|
89
|
-
subscriptionId: z.nullable(z.string()).optional(),
|
|
90
|
-
status: EntitlementStatus$inboundSchema,
|
|
91
|
-
activeFrom: z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
92
|
-
activeTo: z.nullable(
|
|
93
|
-
z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
94
|
-
).optional(),
|
|
95
|
-
config: z.nullable(z.record(z.any())),
|
|
96
|
-
metadata: z.record(z.string()).optional(),
|
|
97
|
-
});
|
|
98
|
-
|
|
99
|
-
export function entitlementFromJSON(
|
|
100
|
-
jsonString: string,
|
|
101
|
-
): SafeParseResult<Entitlement, SDKValidationError> {
|
|
102
|
-
return safeParse(
|
|
103
|
-
jsonString,
|
|
104
|
-
(x) => Entitlement$inboundSchema.parse(JSON.parse(x)),
|
|
105
|
-
`Failed to parse 'Entitlement' from JSON`,
|
|
106
|
-
);
|
|
107
|
-
}
|