@casual-simulation/aux-records 3.2.3 → 3.2.4-alpha.5940763320
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/AIChatInterface.d.ts +8 -0
- package/AIChatInterface.js.map +1 -1
- package/AIController.d.ts +10 -4
- package/AIController.js +112 -3
- package/AIController.js.map +1 -1
- package/AuthController.d.ts +4 -8
- package/AuthController.js +39 -45
- package/AuthController.js.map +1 -1
- package/AuthStore.d.ts +236 -4
- package/ConfigurationStore.d.ts +12 -0
- package/ConfigurationStore.js +2 -0
- package/ConfigurationStore.js.map +1 -0
- package/DataRecordsController.d.ts +18 -6
- package/DataRecordsController.js +31 -5
- package/DataRecordsController.js.map +1 -1
- package/Errors.d.ts +4 -0
- package/EventRecordsController.d.ts +12 -3
- package/EventRecordsController.js +27 -5
- package/EventRecordsController.js.map +1 -1
- package/FileRecordsController.d.ts +13 -3
- package/FileRecordsController.js +46 -9
- package/FileRecordsController.js.map +1 -1
- package/MemoryFileRecordsLookup.d.ts +11 -0
- package/MemoryFileRecordsLookup.js +128 -0
- package/MemoryFileRecordsLookup.js.map +1 -0
- package/MemoryStore.d.ts +191 -0
- package/MemoryStore.js +1381 -0
- package/MemoryStore.js.map +1 -0
- package/MetricsStore.d.ts +186 -0
- package/MetricsStore.js +2 -0
- package/MetricsStore.js.map +1 -0
- package/OpenAIChatInterface.js +1 -0
- package/OpenAIChatInterface.js.map +1 -1
- package/PolicyController.d.ts +7 -4
- package/PolicyController.js +33 -8
- package/PolicyController.js.map +1 -1
- package/RecordsController.d.ts +185 -7
- package/RecordsController.js +588 -70
- package/RecordsController.js.map +1 -1
- package/RecordsHttpServer.d.ts +8 -0
- package/RecordsHttpServer.js +450 -8
- package/RecordsHttpServer.js.map +1 -1
- package/RecordsStore.d.ts +263 -5
- package/StripeInterface.d.ts +331 -0
- package/StripeInterface.js +37 -1
- package/StripeInterface.js.map +1 -1
- package/SubscriptionConfiguration.d.ts +2523 -33
- package/SubscriptionConfiguration.js +130 -1
- package/SubscriptionConfiguration.js.map +1 -1
- package/SubscriptionController.d.ts +23 -6
- package/SubscriptionController.js +344 -69
- package/SubscriptionController.js.map +1 -1
- package/TestUtils.d.ts +7 -6
- package/TestUtils.js +28 -14
- package/TestUtils.js.map +1 -1
- package/Utils.js +9 -0
- package/Utils.js.map +1 -1
- package/index.d.ts +5 -4
- package/index.js +5 -4
- package/index.js.map +1 -1
- package/package.json +2 -2
- package/MemoryAuthStore.d.ts +0 -33
- package/MemoryAuthStore.js +0 -186
- package/MemoryAuthStore.js.map +0 -1
- package/MemoryDataRecordsStore.d.ts +0 -10
- package/MemoryDataRecordsStore.js +0 -98
- package/MemoryDataRecordsStore.js.map +0 -1
- package/MemoryEventRecordsStore.d.ts +0 -10
- package/MemoryEventRecordsStore.js +0 -89
- package/MemoryEventRecordsStore.js.map +0 -1
- package/MemoryFileRecordsStore.d.ts +0 -25
- package/MemoryFileRecordsStore.js +0 -310
- package/MemoryFileRecordsStore.js.map +0 -1
- package/MemoryPolicyStore.d.ts +0 -43
- package/MemoryPolicyStore.js +0 -255
- package/MemoryPolicyStore.js.map +0 -1
- package/MemoryRecordsStore.d.ts +0 -13
- package/MemoryRecordsStore.js +0 -67
- package/MemoryRecordsStore.js.map +0 -1
|
@@ -1,2 +1,131 @@
|
|
|
1
|
-
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { isActiveSubscription } from './Utils';
|
|
3
|
+
export const subscriptionFeaturesSchema = z.object({
|
|
4
|
+
data: z.object({
|
|
5
|
+
allowed: z.boolean(),
|
|
6
|
+
maxItems: z.number({}).int().positive().optional(),
|
|
7
|
+
maxReadsPerPeriod: z.number().int().positive().optional(),
|
|
8
|
+
maxWritesPerPeriod: z.number().int().positive().optional(),
|
|
9
|
+
}),
|
|
10
|
+
files: z.object({
|
|
11
|
+
allowed: z.boolean(),
|
|
12
|
+
maxFiles: z.number().int().positive().optional(),
|
|
13
|
+
maxBytesPerFile: z.number().int().positive().optional(),
|
|
14
|
+
maxBytesTotal: z.number().int().positive().optional(),
|
|
15
|
+
}),
|
|
16
|
+
events: z.object({
|
|
17
|
+
allowed: z.boolean(),
|
|
18
|
+
maxEvents: z.number().int().positive().optional(),
|
|
19
|
+
maxUpdatesPerPeriod: z.number().int().positive().optional(),
|
|
20
|
+
}),
|
|
21
|
+
policies: z.object({
|
|
22
|
+
allowed: z.boolean(),
|
|
23
|
+
maxPolicies: z.number().int().positive().optional(),
|
|
24
|
+
}),
|
|
25
|
+
ai: z.object({
|
|
26
|
+
chat: z.object({
|
|
27
|
+
allowed: z.boolean(),
|
|
28
|
+
maxTokensPerPeriod: z.number().int().positive().optional(),
|
|
29
|
+
}),
|
|
30
|
+
images: z.object({
|
|
31
|
+
allowed: z.boolean(),
|
|
32
|
+
maxSquarePixelsPerPeriod: z.number().int().positive().optional(),
|
|
33
|
+
}),
|
|
34
|
+
skyboxes: z.object({
|
|
35
|
+
allowed: z.boolean(),
|
|
36
|
+
maxSquarePixelsPerPeriod: z.number().int().positive().optional(),
|
|
37
|
+
}),
|
|
38
|
+
}),
|
|
39
|
+
});
|
|
40
|
+
export const subscriptionConfigSchema = z.object({
|
|
41
|
+
webhookSecret: z.string().nonempty(),
|
|
42
|
+
successUrl: z.string().nonempty(),
|
|
43
|
+
cancelUrl: z.string().nonempty(),
|
|
44
|
+
returnUrl: z.string().nonempty(),
|
|
45
|
+
portalConfig: z.object({}).passthrough().optional().nullable(),
|
|
46
|
+
checkoutConfig: z.object({}).passthrough().optional().nullable(),
|
|
47
|
+
subscriptions: z.array(z.object({
|
|
48
|
+
id: z.string().nonempty(),
|
|
49
|
+
product: z.string().nonempty(),
|
|
50
|
+
featureList: z.array(z.string().nonempty()),
|
|
51
|
+
eligibleProducts: z.array(z.string().nonempty()),
|
|
52
|
+
defaultSubscription: z.boolean().optional(),
|
|
53
|
+
purchasable: z.boolean().optional(),
|
|
54
|
+
tier: z.string().nonempty().optional(),
|
|
55
|
+
userOnly: z.boolean().optional(),
|
|
56
|
+
studioOnly: z.boolean().optional(),
|
|
57
|
+
})),
|
|
58
|
+
tiers: z
|
|
59
|
+
.object({})
|
|
60
|
+
.catchall(z.object({
|
|
61
|
+
features: subscriptionFeaturesSchema.optional(),
|
|
62
|
+
}))
|
|
63
|
+
.optional(),
|
|
64
|
+
defaultFeatures: z
|
|
65
|
+
.object({
|
|
66
|
+
user: subscriptionFeaturesSchema.optional(),
|
|
67
|
+
studio: subscriptionFeaturesSchema.optional(),
|
|
68
|
+
defaultPeriodLength: z
|
|
69
|
+
.object({
|
|
70
|
+
days: z.number().int().positive().optional(),
|
|
71
|
+
months: z.number().int().positive().optional(),
|
|
72
|
+
})
|
|
73
|
+
.default({
|
|
74
|
+
days: 0,
|
|
75
|
+
months: 1,
|
|
76
|
+
}),
|
|
77
|
+
})
|
|
78
|
+
.optional(),
|
|
79
|
+
});
|
|
80
|
+
export function parseSubscriptionConfig(config, defaultConfig) {
|
|
81
|
+
if (config) {
|
|
82
|
+
const result = subscriptionConfigSchema.safeParse(config);
|
|
83
|
+
if (result.success) {
|
|
84
|
+
return result.data;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
return defaultConfig;
|
|
88
|
+
}
|
|
89
|
+
export function allowAllFeatures() {
|
|
90
|
+
return {
|
|
91
|
+
records: {
|
|
92
|
+
allowed: true,
|
|
93
|
+
},
|
|
94
|
+
ai: {
|
|
95
|
+
chat: {
|
|
96
|
+
allowed: true,
|
|
97
|
+
},
|
|
98
|
+
images: {
|
|
99
|
+
allowed: true,
|
|
100
|
+
},
|
|
101
|
+
skyboxes: {
|
|
102
|
+
allowed: true,
|
|
103
|
+
},
|
|
104
|
+
},
|
|
105
|
+
data: {
|
|
106
|
+
allowed: true,
|
|
107
|
+
},
|
|
108
|
+
events: {
|
|
109
|
+
allowed: true,
|
|
110
|
+
},
|
|
111
|
+
files: {
|
|
112
|
+
allowed: true,
|
|
113
|
+
},
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
export function getSubscriptionFeatures(config, subscriptionStatus, subscriptionId, type) {
|
|
117
|
+
var _a, _b, _c;
|
|
118
|
+
if (!config) {
|
|
119
|
+
return allowAllFeatures();
|
|
120
|
+
}
|
|
121
|
+
if (isActiveSubscription(subscriptionStatus)) {
|
|
122
|
+
const sub = config.subscriptions.find((s) => s.id === subscriptionId);
|
|
123
|
+
const tier = sub === null || sub === void 0 ? void 0 : sub.tier;
|
|
124
|
+
const features = tier ? (_a = config.tiers[tier]) === null || _a === void 0 ? void 0 : _a.features : null;
|
|
125
|
+
if (features) {
|
|
126
|
+
return features;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
return (_c = (_b = config.defaultFeatures) === null || _b === void 0 ? void 0 : _b[type]) !== null && _c !== void 0 ? _c : allowAllFeatures();
|
|
130
|
+
}
|
|
2
131
|
//# sourceMappingURL=SubscriptionConfiguration.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SubscriptionConfiguration.js","sourceRoot":"","sources":["SubscriptionConfiguration.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"SubscriptionConfiguration.js","sourceRoot":"","sources":["SubscriptionConfiguration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAE/C,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC,MAAM,CAAC;IAC/C,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC;QACX,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE;QACpB,QAAQ,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;QAClD,iBAAiB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;QACzD,kBAAk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gBAAgB,EAAE,CAAC;AAChE,CAAC"}
|
|
@@ -3,6 +3,8 @@ import { AuthStore } from './AuthStore';
|
|
|
3
3
|
import { StripeInterface } from './StripeInterface';
|
|
4
4
|
import { ServerError } from './Errors';
|
|
5
5
|
import { SubscriptionConfiguration } from './SubscriptionConfiguration';
|
|
6
|
+
import { RecordsStore } from './RecordsStore';
|
|
7
|
+
import { ConfigurationStore } from './ConfigurationStore';
|
|
6
8
|
/**
|
|
7
9
|
* Defines a class that is able to handle subscriptions.
|
|
8
10
|
*/
|
|
@@ -10,13 +12,16 @@ export declare class SubscriptionController {
|
|
|
10
12
|
private _stripe;
|
|
11
13
|
private _auth;
|
|
12
14
|
private _authStore;
|
|
15
|
+
private _recordsStore;
|
|
13
16
|
private _config;
|
|
14
|
-
constructor(stripe: StripeInterface, auth: AuthController, authStore: AuthStore, config:
|
|
17
|
+
constructor(stripe: StripeInterface, auth: AuthController, authStore: AuthStore, recordsStore: RecordsStore, config: ConfigurationStore);
|
|
18
|
+
private _getConfig;
|
|
15
19
|
/**
|
|
16
20
|
* Gets the status of the given user's scription.
|
|
17
21
|
* @param request
|
|
18
22
|
*/
|
|
19
23
|
getSubscriptionStatus(request: GetSubscriptionStatusRequest): Promise<GetSubscriptionStatusResult>;
|
|
24
|
+
private _getPurchasableSubscriptionsForRole;
|
|
20
25
|
private _getPurchasableSubscriptions;
|
|
21
26
|
/**
|
|
22
27
|
* Creates a link that the user can be redirected to in order to manage their subscription.
|
|
@@ -45,7 +50,11 @@ export interface CreateManageSubscriptionRequest {
|
|
|
45
50
|
/**
|
|
46
51
|
* The User ID that the management session should be created for.
|
|
47
52
|
*/
|
|
48
|
-
userId
|
|
53
|
+
userId?: string;
|
|
54
|
+
/**
|
|
55
|
+
* The ID of the studio that the management session should be created for.
|
|
56
|
+
*/
|
|
57
|
+
studioId?: string;
|
|
49
58
|
/**
|
|
50
59
|
* The subscription that was selected for purcahse by the user.
|
|
51
60
|
*/
|
|
@@ -73,7 +82,7 @@ export interface CreateManageSubscriptionFailure {
|
|
|
73
82
|
/**
|
|
74
83
|
* The error code.
|
|
75
84
|
*/
|
|
76
|
-
errorCode: ServerError | ValidateSessionKeyFailure['errorCode'] | 'unacceptable_user_id' | 'unacceptable_request' | 'price_does_not_match' | 'not_supported';
|
|
85
|
+
errorCode: ServerError | ValidateSessionKeyFailure['errorCode'] | 'unacceptable_user_id' | 'unacceptable_studio_id' | 'unacceptable_request' | 'price_does_not_match' | 'not_supported';
|
|
77
86
|
/**
|
|
78
87
|
* The error message.
|
|
79
88
|
*/
|
|
@@ -87,7 +96,11 @@ export interface GetSubscriptionStatusRequest {
|
|
|
87
96
|
/**
|
|
88
97
|
* The ID of the user whose subscription status should be retrieved.
|
|
89
98
|
*/
|
|
90
|
-
userId
|
|
99
|
+
userId?: string;
|
|
100
|
+
/**
|
|
101
|
+
* The ID of the studio whose subscrition status should be retrieved.
|
|
102
|
+
*/
|
|
103
|
+
studioId?: string;
|
|
91
104
|
}
|
|
92
105
|
export type GetSubscriptionStatusResult = GetSubscriptionStatusSuccess | GetSubscriptionStatusFailure;
|
|
93
106
|
export interface GetSubscriptionStatusSuccess {
|
|
@@ -95,7 +108,11 @@ export interface GetSubscriptionStatusSuccess {
|
|
|
95
108
|
/**
|
|
96
109
|
* The ID of the user.
|
|
97
110
|
*/
|
|
98
|
-
userId
|
|
111
|
+
userId?: string;
|
|
112
|
+
/**
|
|
113
|
+
* The ID of the studio.
|
|
114
|
+
*/
|
|
115
|
+
studioId?: string;
|
|
99
116
|
/**
|
|
100
117
|
* The publishable stripe API key.
|
|
101
118
|
*/
|
|
@@ -224,7 +241,7 @@ export interface GetSubscriptionStatusFailure {
|
|
|
224
241
|
/**
|
|
225
242
|
* The error code.
|
|
226
243
|
*/
|
|
227
|
-
errorCode: ServerError | ValidateSessionKeyFailure['errorCode'] | 'unacceptable_user_id' | 'not_supported';
|
|
244
|
+
errorCode: ServerError | ValidateSessionKeyFailure['errorCode'] | 'unacceptable_user_id' | 'unacceptable_studio_id' | 'unacceptable_request' | 'not_supported';
|
|
228
245
|
/**
|
|
229
246
|
* The error message.
|
|
230
247
|
*/
|