@inverted-tech/fragments 0.5.1 → 0.6.1
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/esm/Authentication/Backup_pb.js +1 -1
- package/dist/esm/Authentication/UserInterface_pb.js +5 -105
- package/dist/esm/Authentication/index.js +5 -5
- package/dist/esm/Authorization/Events/AdminEventInterface_pb.js +7 -7
- package/dist/esm/Authorization/Events/EventError_pb.js +97 -223
- package/dist/esm/Authorization/Events/EventInterface_pb.js +6 -6
- package/dist/esm/Authorization/Events/EventRecord_pb.js +2 -2
- package/dist/esm/Authorization/Events/EventsSettings_pb.js +2 -2
- package/dist/esm/Authorization/Events/index.js +8 -8
- package/dist/esm/Authorization/Payment/AdminPaymentInterface_pb.js +5 -4
- package/dist/esm/Authorization/Payment/BackupInterface_pb.js +1 -1
- package/dist/esm/Authorization/Payment/Crypto/Backup_pb.js +2 -2
- package/dist/esm/Authorization/Payment/Crypto/BitcoinInterface_pb.js +2 -2
- package/dist/esm/Authorization/Payment/Crypto/CryptoSettings_pb.js +1 -1
- package/dist/esm/Authorization/Payment/Crypto/index.js +7 -7
- package/dist/esm/Authorization/Payment/DataRecords_pb.js +1 -1
- package/dist/esm/Authorization/Payment/Fortis/FortisInterface_pb.js +2 -2
- package/dist/esm/Authorization/Payment/Fortis/FortisSettings_pb.js +1 -1
- package/dist/esm/Authorization/Payment/Fortis/index.js +4 -4
- package/dist/esm/Authorization/Payment/Manual/Backup_pb.js +1 -1
- package/dist/esm/Authorization/Payment/Manual/ManualPaymentInterface_pb.js +2 -2
- package/dist/esm/Authorization/Payment/Manual/ManualPaymentSettings_pb.js +1 -1
- package/dist/esm/Authorization/Payment/Manual/index.js +5 -5
- package/dist/esm/Authorization/Payment/PaymentError_pb.js +150 -0
- package/dist/esm/Authorization/Payment/PaymentInterface_pb.js +8 -7
- package/dist/esm/Authorization/Payment/Paypal/PaypalInterface_pb.js +4 -3
- package/dist/esm/Authorization/Payment/Paypal/PaypalSettings_pb.js +1 -1
- package/dist/esm/Authorization/Payment/Paypal/index.js +4 -4
- package/dist/esm/Authorization/Payment/Stripe/StripeInterface_pb.js +6 -5
- package/dist/esm/Authorization/Payment/Stripe/StripeSettings_pb.js +1 -1
- package/dist/esm/Authorization/Payment/Stripe/index.js +5 -5
- package/dist/esm/Authorization/Payment/index.js +12 -11
- package/dist/esm/Authorization/index.js +5 -5
- package/dist/esm/Comment/CommentError_pb.js +124 -0
- package/dist/esm/Comment/CommentInterface_pb.js +5 -4
- package/dist/esm/Comment/index.js +5 -4
- package/dist/esm/Content/AssetBackup_pb.js +1 -1
- package/dist/esm/Content/AssetInterface_pb.js +7 -5
- package/dist/esm/Content/AssetRecord_pb.js +2 -2
- package/dist/esm/Content/AudioAssetRecord_pb.js +2 -1
- package/dist/esm/Content/ContentError_pb.js +110 -0
- package/dist/esm/Content/ContentRecord_pb.js +2 -2
- package/dist/esm/Content/Content_pb.js +6 -5
- package/dist/esm/Content/ImageAssetRecord_pb.js +2 -1
- package/dist/esm/Content/Music/MusicInterface_pb.js +2 -2
- package/dist/esm/Content/Music/index.js +3 -3
- package/dist/esm/Content/Rumble_pb.js +3 -1
- package/dist/esm/Content/Stats/StatsLikeInterface_pb.js +1 -1
- package/dist/esm/Content/Stats/StatsProgressInterface_pb.js +3 -2
- package/dist/esm/Content/Stats/StatsQueryInterface_pb.js +2 -2
- package/dist/esm/Content/Stats/StatsSaveInterface_pb.js +1 -1
- package/dist/esm/Content/Stats/StatsShareInterface_pb.js +1 -1
- package/dist/esm/Content/Stats/index.js +8 -8
- package/dist/esm/Content/Video_pb.js +3 -2
- package/dist/esm/Content/connect/Backup_connect.js +1 -1
- package/dist/esm/Content/connect/Content_connect.js +2 -1
- package/dist/esm/Content/index.js +14 -13
- package/dist/esm/CreatorDashboard/Settings/SettingsManager_pb.js +1 -1
- package/dist/esm/CreatorDashboard/Settings/index.js +3 -3
- package/dist/esm/CreatorDashboard/Subscribers/Manage_pb.js +2 -2
- package/dist/esm/CreatorDashboard/Subscribers/index.js +4 -4
- package/dist/esm/CreatorDashboard/index.js +2 -2
- package/dist/esm/Errors_pb.js +1 -1
- package/dist/esm/Generic/index.js +2 -2
- package/dist/esm/Notification/NotificationError_pb.js +68 -0
- package/dist/esm/Notification/NotificationInterface_pb.js +3 -2
- package/dist/esm/Notification/NotificationSettings_pb.js +1 -1
- package/dist/esm/Notification/UserNotificationInterface_pb.js +4 -3
- package/dist/esm/Notification/index.js +7 -6
- package/dist/esm/Page/PageError_pb.js +138 -0
- package/dist/esm/Page/PageInterface_pb.js +4 -3
- package/dist/esm/Page/index.js +4 -3
- package/dist/esm/Settings/Backup_pb.js +1 -1
- package/dist/esm/Settings/SettingsError_pb.js +2 -2
- package/dist/esm/Settings/SettingsInterface_pb.js +8 -26
- package/dist/esm/Settings/SettingsRecord_pb.js +11 -11
- package/dist/esm/Settings/index.js +5 -5
- package/dist/esm/client.js +297 -0
- package/dist/esm/google/api/annotations_pb.js +1 -1
- package/dist/esm/index.js +11 -11
- package/dist/esm/validation.js +10 -10
- package/dist/protos/Authentication/UserInterface_pb.d.ts +10 -106
- package/dist/protos/Authorization/Events/AdminEventInterface_pb.d.ts +5 -5
- package/dist/protos/Authorization/Events/EventError_pb.d.ts +101 -286
- package/dist/protos/Authorization/Events/EventInterface_pb.d.ts +11 -11
- package/dist/protos/Authorization/Payment/AdminPaymentInterface_pb.d.ts +13 -0
- package/dist/protos/Authorization/Payment/PaymentError_pb.d.ts +164 -0
- package/dist/protos/Authorization/Payment/PaymentInterface_pb.d.ts +29 -4
- package/dist/protos/Authorization/Payment/Paypal/PaypalInterface_pb.d.ts +3 -2
- package/dist/protos/Authorization/Payment/Stripe/StripeInterface_pb.d.ts +21 -20
- package/dist/protos/Authorization/Payment/index.d.ts +1 -0
- package/dist/protos/Comment/CommentError_pb.d.ts +138 -0
- package/dist/protos/Comment/CommentInterface_pb.d.ts +5 -4
- package/dist/protos/Comment/index.d.ts +1 -0
- package/dist/protos/Content/AssetInterface_pb.d.ts +21 -0
- package/dist/protos/Content/ContentError_pb.d.ts +124 -0
- package/dist/protos/Content/ContentRecord_pb.d.ts +0 -4
- package/dist/protos/Content/Content_pb.d.ts +2 -1
- package/dist/protos/Content/Rumble_pb.d.ts +7 -6
- package/dist/protos/Content/Stats/StatsProgressInterface_pb.d.ts +3 -2
- package/dist/protos/Content/Video_pb.d.ts +3 -2
- package/dist/protos/Content/connect/Content_connect.d.ts +2 -1
- package/dist/protos/Content/index.d.ts +1 -0
- package/dist/protos/Notification/NotificationError_pb.d.ts +82 -0
- package/dist/protos/Notification/NotificationInterface_pb.d.ts +3 -2
- package/dist/protos/Notification/UserNotificationInterface_pb.d.ts +7 -6
- package/dist/protos/Notification/index.d.ts +1 -0
- package/dist/protos/Page/PageError_pb.d.ts +152 -0
- package/dist/protos/Page/PageInterface_pb.d.ts +49 -0
- package/dist/protos/Page/index.d.ts +1 -0
- package/dist/protos/Settings/SettingsInterface_pb.d.ts +37 -162
- package/dist/protos/client.d.ts +185 -0
- package/package.json +13 -4
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
import { create, toJsonString } from '@bufbuild/protobuf';
|
|
2
|
+
import { getValidator } from './validation.js';
|
|
3
|
+
// Safe logging function that works in all environments
|
|
4
|
+
const safeLog = {
|
|
5
|
+
error: (...args) => {
|
|
6
|
+
// Use globalThis to safely access console in all environments
|
|
7
|
+
const globalConsole = globalThis?.console;
|
|
8
|
+
if (globalConsole && globalConsole.error) {
|
|
9
|
+
globalConsole.error(...args);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Shared client class for standardized API communication with protobuf serialization
|
|
15
|
+
*
|
|
16
|
+
* This client encapsulates common patterns found in action functions like:
|
|
17
|
+
* - Token retrieval and authentication headers
|
|
18
|
+
* - Protobuf serialization using create() and toJsonString()
|
|
19
|
+
* - Consistent error handling with protobuf error responses
|
|
20
|
+
* - Next.js cache invalidation support (framework-agnostic)
|
|
21
|
+
* - Pre-request validation using protovalidate
|
|
22
|
+
*/
|
|
23
|
+
export class FragmentsClient {
|
|
24
|
+
config;
|
|
25
|
+
validator;
|
|
26
|
+
// Expose config for testing purposes
|
|
27
|
+
get _config() {
|
|
28
|
+
return this.config;
|
|
29
|
+
}
|
|
30
|
+
constructor(config = {}) {
|
|
31
|
+
this.config = {
|
|
32
|
+
baseUrl: config.baseUrl ?? 'http://localhost:8001',
|
|
33
|
+
getToken: config.getToken ?? (() => undefined),
|
|
34
|
+
onCacheInvalidate: config.onCacheInvalidate ?? (() => { }),
|
|
35
|
+
validateRequests: config.validateRequests ?? false,
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Create a new client instance with modified configuration
|
|
40
|
+
* @param config Partial configuration to override
|
|
41
|
+
* @returns New FragmentsClient instance
|
|
42
|
+
*/
|
|
43
|
+
withConfig(config) {
|
|
44
|
+
return new FragmentsClient({
|
|
45
|
+
...this.config,
|
|
46
|
+
...config,
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Generic request method that handles all HTTP operations
|
|
51
|
+
* @param endpoint API endpoint (relative to baseUrl)
|
|
52
|
+
* @param reqSchema Request protobuf schema
|
|
53
|
+
* @param resSchema Response protobuf schema
|
|
54
|
+
* @param data Request data (optional for GET requests)
|
|
55
|
+
* @param options Request options
|
|
56
|
+
* @returns Promise resolving to typed response
|
|
57
|
+
*/
|
|
58
|
+
async request(endpoint, reqSchema, resSchema, data, options = {}) {
|
|
59
|
+
const method = options.method ?? 'POST';
|
|
60
|
+
const shouldValidate = options.validate ?? this.config.validateRequests;
|
|
61
|
+
// Get authentication token
|
|
62
|
+
const token = await this.config.getToken();
|
|
63
|
+
// Create request message if data is provided
|
|
64
|
+
let requestMessage;
|
|
65
|
+
let requestBody;
|
|
66
|
+
if (data && method !== 'GET') {
|
|
67
|
+
requestMessage = create(reqSchema, data);
|
|
68
|
+
// Validate request if enabled
|
|
69
|
+
if (shouldValidate) {
|
|
70
|
+
const validationResult = await this.validateMessage(reqSchema, requestMessage);
|
|
71
|
+
if (!validationResult.success) {
|
|
72
|
+
// Return error response instead of making HTTP request
|
|
73
|
+
return this.createValidationErrorResponse(resSchema, validationResult.violations);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
requestBody = toJsonString(reqSchema, requestMessage);
|
|
77
|
+
}
|
|
78
|
+
// Prepare fetch options
|
|
79
|
+
const fetchOptions = {
|
|
80
|
+
method,
|
|
81
|
+
headers: {
|
|
82
|
+
'Content-Type': 'application/json',
|
|
83
|
+
...(token && { Authorization: `Bearer ${token}` }),
|
|
84
|
+
},
|
|
85
|
+
...(requestBody && { body: requestBody }),
|
|
86
|
+
};
|
|
87
|
+
// Add Next.js cache options if provided
|
|
88
|
+
if (options.cacheTags || options.revalidate !== undefined) {
|
|
89
|
+
fetchOptions.next = {
|
|
90
|
+
...(options.cacheTags && { tags: options.cacheTags }),
|
|
91
|
+
...(options.revalidate !== undefined && { revalidate: options.revalidate }),
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
try {
|
|
95
|
+
const url = `${this.config.baseUrl}${endpoint}`;
|
|
96
|
+
const response = await fetch(url, fetchOptions);
|
|
97
|
+
// Handle null response like existing action functions
|
|
98
|
+
if (!response) {
|
|
99
|
+
safeLog.error('FragmentsClient: Network request failed - no response received');
|
|
100
|
+
return this.createNetworkErrorResponse(resSchema);
|
|
101
|
+
}
|
|
102
|
+
// Handle HTTP errors like existing action functions
|
|
103
|
+
if (!response.ok) {
|
|
104
|
+
safeLog.error(`FragmentsClient: HTTP error ${response.status}: ${response.statusText}`);
|
|
105
|
+
return this.createHttpErrorResponse(resSchema, response.status, response.statusText);
|
|
106
|
+
}
|
|
107
|
+
const responseData = await response.json();
|
|
108
|
+
// Handle cache invalidation for successful mutations
|
|
109
|
+
if (method !== 'GET' && (options.cacheTags || options.revalidatePaths)) {
|
|
110
|
+
this.config.onCacheInvalidate(options.cacheTags ?? [], options.revalidatePaths ?? []);
|
|
111
|
+
}
|
|
112
|
+
return responseData;
|
|
113
|
+
}
|
|
114
|
+
catch (error) {
|
|
115
|
+
// Log errors like existing action functions using console.error
|
|
116
|
+
safeLog.error('FragmentsClient request failed:', error);
|
|
117
|
+
// Return error response instead of throwing, matching existing patterns
|
|
118
|
+
const errorMessage = error instanceof Error ? error.message : 'Unknown error';
|
|
119
|
+
return this.createErrorResponse(resSchema, errorMessage);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Convenience method for GET requests
|
|
124
|
+
* @param endpoint API endpoint
|
|
125
|
+
* @param resSchema Response protobuf schema
|
|
126
|
+
* @param options Request options
|
|
127
|
+
* @returns Promise resolving to typed response
|
|
128
|
+
*/
|
|
129
|
+
async get(endpoint, resSchema, options = {}) {
|
|
130
|
+
return this.request(endpoint, {}, resSchema, undefined, {
|
|
131
|
+
...options,
|
|
132
|
+
method: 'GET',
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Convenience method for POST requests
|
|
137
|
+
* @param endpoint API endpoint
|
|
138
|
+
* @param reqSchema Request protobuf schema
|
|
139
|
+
* @param resSchema Response protobuf schema
|
|
140
|
+
* @param data Request data
|
|
141
|
+
* @param options Request options
|
|
142
|
+
* @returns Promise resolving to typed response
|
|
143
|
+
*/
|
|
144
|
+
async post(endpoint, reqSchema, resSchema, data, options = {}) {
|
|
145
|
+
return this.request(endpoint, reqSchema, resSchema, data, {
|
|
146
|
+
...options,
|
|
147
|
+
method: 'POST',
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Static utility method to create protobuf request messages
|
|
152
|
+
* @param schema Protobuf message schema
|
|
153
|
+
* @param data Optional partial data to initialize the message
|
|
154
|
+
* @returns Created message instance
|
|
155
|
+
*/
|
|
156
|
+
static createRequest(schema, data) {
|
|
157
|
+
return create(schema, data);
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Static utility method to create protobuf response messages
|
|
161
|
+
* @param schema Protobuf message schema
|
|
162
|
+
* @param data Optional partial data to initialize the message
|
|
163
|
+
* @returns Created message instance
|
|
164
|
+
*/
|
|
165
|
+
static createResponse(schema, data) {
|
|
166
|
+
return create(schema, data);
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Static utility method to serialize protobuf messages to JSON strings
|
|
170
|
+
* @param schema Protobuf message schema
|
|
171
|
+
* @param data Message data to serialize
|
|
172
|
+
* @returns JSON string representation
|
|
173
|
+
*/
|
|
174
|
+
static serialize(schema, data) {
|
|
175
|
+
return toJsonString(schema, data);
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Static utility method to validate protobuf messages using protovalidate
|
|
179
|
+
* @param schema Protobuf message schema
|
|
180
|
+
* @param data Message data to validate
|
|
181
|
+
* @returns Promise resolving to validation result
|
|
182
|
+
*/
|
|
183
|
+
static async validate(schema, data) {
|
|
184
|
+
try {
|
|
185
|
+
const validator = await getValidator();
|
|
186
|
+
const result = validator.validate(schema, data);
|
|
187
|
+
return {
|
|
188
|
+
success: result.kind === 'valid',
|
|
189
|
+
violations: result.kind === 'invalid' ? result.violations : undefined,
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
catch (error) {
|
|
193
|
+
safeLog.error('Validation error:', error);
|
|
194
|
+
return {
|
|
195
|
+
success: false,
|
|
196
|
+
violations: [{ message: 'Validation system error' }],
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* Private method to validate messages using the instance validator
|
|
202
|
+
*/
|
|
203
|
+
async validateMessage(schema, data) {
|
|
204
|
+
if (!this.validator) {
|
|
205
|
+
this.validator = await getValidator();
|
|
206
|
+
}
|
|
207
|
+
try {
|
|
208
|
+
const result = this.validator.validate(schema, data);
|
|
209
|
+
return {
|
|
210
|
+
success: result.kind === 'valid',
|
|
211
|
+
violations: result.kind === 'invalid' ? result.violations : undefined,
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
catch (error) {
|
|
215
|
+
safeLog.error('Validation error:', error);
|
|
216
|
+
return {
|
|
217
|
+
success: false,
|
|
218
|
+
violations: [{ message: 'Validation system error' }],
|
|
219
|
+
};
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* Private method to create error responses matching existing action function patterns
|
|
224
|
+
* This creates a generic error response structure that matches the patterns used in
|
|
225
|
+
* existing action functions like modifyPublicSubscriptionSettings
|
|
226
|
+
*/
|
|
227
|
+
createErrorResponse(schema, message) {
|
|
228
|
+
// Create error response matching existing action function patterns
|
|
229
|
+
// The structure matches what's used in functions like modifyPublicSubscriptionSettings
|
|
230
|
+
return create(schema, {
|
|
231
|
+
Error: {
|
|
232
|
+
Message: message,
|
|
233
|
+
Type: 'SETTINGS_ERROR_UNKNOWN', // Matches SettingsErrorReason.SETTINGS_ERROR_UNKNOWN
|
|
234
|
+
},
|
|
235
|
+
});
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* Private method to create validation error responses
|
|
239
|
+
* This preserves ValidationIssue[] arrays in error responses as required
|
|
240
|
+
*/
|
|
241
|
+
createValidationErrorResponse(schema, violations) {
|
|
242
|
+
return create(schema, {
|
|
243
|
+
Error: {
|
|
244
|
+
Message: 'Request validation failed',
|
|
245
|
+
Type: 'SETTINGS_ERROR_VALIDATION_FAILED', // Matches validation error type
|
|
246
|
+
Validation: violations ?? [], // Preserve ValidationIssue[] arrays
|
|
247
|
+
},
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
/**
|
|
251
|
+
* Private method to create HTTP error responses
|
|
252
|
+
* Handles HTTP errors uniformly like existing action functions
|
|
253
|
+
*/
|
|
254
|
+
createHttpErrorResponse(schema, status, statusText) {
|
|
255
|
+
const message = `HTTP ${status}: ${statusText}`;
|
|
256
|
+
return create(schema, {
|
|
257
|
+
Error: {
|
|
258
|
+
Message: message,
|
|
259
|
+
Type: 'SETTINGS_ERROR_UNKNOWN',
|
|
260
|
+
},
|
|
261
|
+
});
|
|
262
|
+
}
|
|
263
|
+
/**
|
|
264
|
+
* Private method to create network error responses
|
|
265
|
+
* Handles network failures like existing action functions
|
|
266
|
+
*/
|
|
267
|
+
createNetworkErrorResponse(schema) {
|
|
268
|
+
return create(schema, {
|
|
269
|
+
Error: {
|
|
270
|
+
Message: 'Network request failed',
|
|
271
|
+
Type: 'SETTINGS_ERROR_UNKNOWN',
|
|
272
|
+
},
|
|
273
|
+
});
|
|
274
|
+
}
|
|
275
|
+
/**
|
|
276
|
+
* Static method to create error responses for use in action functions
|
|
277
|
+
* This allows consumers to create consistent error responses outside of the client
|
|
278
|
+
* @param schema Response schema to create error for
|
|
279
|
+
* @param message Error message
|
|
280
|
+
* @param errorType Error type (defaults to SETTINGS_ERROR_UNKNOWN)
|
|
281
|
+
* @param validationIssues Optional validation issues array
|
|
282
|
+
* @returns Error response matching existing action function patterns
|
|
283
|
+
*/
|
|
284
|
+
static createErrorResponse(schema, message, errorType = 'SETTINGS_ERROR_UNKNOWN', validationIssues) {
|
|
285
|
+
const errorData = {
|
|
286
|
+
Message: message,
|
|
287
|
+
Type: errorType,
|
|
288
|
+
};
|
|
289
|
+
// Include validation issues if provided (preserves ValidationIssue[] arrays)
|
|
290
|
+
if (validationIssues && validationIssues.length > 0) {
|
|
291
|
+
errorData.Validation = validationIssues;
|
|
292
|
+
}
|
|
293
|
+
return create(schema, {
|
|
294
|
+
Error: errorData,
|
|
295
|
+
});
|
|
296
|
+
}
|
|
297
|
+
}
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
// See the License for the specific language governing permissions and
|
|
13
13
|
// limitations under the License.
|
|
14
14
|
import { extDesc, fileDesc } from "@bufbuild/protobuf/codegenv2";
|
|
15
|
-
import { file_google_api_http } from "./http_pb";
|
|
15
|
+
import { file_google_api_http } from "./http_pb.js";
|
|
16
16
|
import { file_google_protobuf_descriptor } from "@bufbuild/protobuf/wkt";
|
|
17
17
|
/**
|
|
18
18
|
* Describes the file google/api/annotations.proto.
|
package/dist/esm/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
// Auto-generated - DO NOT EDIT
|
|
2
|
-
export * from './CommonTypes_pb';
|
|
3
|
-
export * from './Errors_pb';
|
|
4
|
-
export * as Authentication from './Authentication';
|
|
5
|
-
export * as Authorization from './Authorization';
|
|
6
|
-
export * as Comment from './Comment';
|
|
7
|
-
export * as Content from './Content';
|
|
8
|
-
export * as CreatorDashboard from './CreatorDashboard';
|
|
9
|
-
export * as Generic from './Generic';
|
|
10
|
-
export * as Notification from './Notification';
|
|
11
|
-
export * as Page from './Page';
|
|
12
|
-
export * as Settings from './Settings';
|
|
2
|
+
export * from './CommonTypes_pb.js';
|
|
3
|
+
export * from './Errors_pb.js';
|
|
4
|
+
export * as Authentication from './Authentication/index.js';
|
|
5
|
+
export * as Authorization from './Authorization/index.js';
|
|
6
|
+
export * as Comment from './Comment/index.js';
|
|
7
|
+
export * as Content from './Content/index.js';
|
|
8
|
+
export * as CreatorDashboard from './CreatorDashboard/index.js';
|
|
9
|
+
export * as Generic from './Generic/index.js';
|
|
10
|
+
export * as Notification from './Notification/index.js';
|
|
11
|
+
export * as Page from './Page/index.js';
|
|
12
|
+
export * as Settings from './Settings/index.js';
|
package/dist/esm/validation.js
CHANGED
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
import { createRegistry } from '@bufbuild/protobuf';
|
|
3
3
|
import { createValidator } from '@bufbuild/protovalidate';
|
|
4
4
|
// Import barrels that re-export your generated descriptors (GenFile)
|
|
5
|
-
import * as Auth from './Authentication';
|
|
6
|
-
import * as Authorization from './Authorization';
|
|
7
|
-
import * as Comment from './Comment';
|
|
8
|
-
import * as Content from './Content';
|
|
9
|
-
import * as CreatorDashboard from './CreatorDashboard';
|
|
10
|
-
import * as Generic from './Generic';
|
|
11
|
-
import * as Notification from './Notification';
|
|
12
|
-
import * as Page from './Page';
|
|
13
|
-
import * as Settings from './Settings';
|
|
14
|
-
import * as FragmentsRoot from '.';
|
|
5
|
+
import * as Auth from './Authentication/index.js';
|
|
6
|
+
import * as Authorization from './Authorization/index.js';
|
|
7
|
+
import * as Comment from './Comment/index.js';
|
|
8
|
+
import * as Content from './Content/index.js';
|
|
9
|
+
import * as CreatorDashboard from './CreatorDashboard/index.js';
|
|
10
|
+
import * as Generic from './Generic/index.js';
|
|
11
|
+
import * as Notification from './Notification/index.js';
|
|
12
|
+
import * as Page from './Page/index.js';
|
|
13
|
+
import * as Settings from './Settings/index.js';
|
|
14
|
+
import * as FragmentsRoot from './index.js';
|
|
15
15
|
// Runtime guard (don’t use a type predicate over a module union)
|
|
16
16
|
function looksLikeGenFile(x) {
|
|
17
17
|
const v = x;
|
|
@@ -102,40 +102,15 @@ export declare const ChangeOtherPasswordRequestSchema: GenMessage<ChangeOtherPas
|
|
|
102
102
|
*/
|
|
103
103
|
export type ChangeOtherPasswordResponse = Message<"IT.WebServices.Fragments.Authentication.ChangeOtherPasswordResponse"> & {
|
|
104
104
|
/**
|
|
105
|
-
* @generated from field: IT.WebServices.Fragments.Authentication.
|
|
105
|
+
* @generated from field: IT.WebServices.Fragments.Authentication.AuthError Error = 1;
|
|
106
106
|
*/
|
|
107
|
-
Error
|
|
107
|
+
Error?: AuthError;
|
|
108
108
|
};
|
|
109
109
|
/**
|
|
110
110
|
* Describes the message IT.WebServices.Fragments.Authentication.ChangeOtherPasswordResponse.
|
|
111
111
|
* Use `create(ChangeOtherPasswordResponseSchema)` to create a new message.
|
|
112
112
|
*/
|
|
113
113
|
export declare const ChangeOtherPasswordResponseSchema: GenMessage<ChangeOtherPasswordResponse>;
|
|
114
|
-
/**
|
|
115
|
-
* @generated from enum IT.WebServices.Fragments.Authentication.ChangeOtherPasswordResponse.ChangeOtherPasswordResponseErrorType
|
|
116
|
-
*/
|
|
117
|
-
export declare enum ChangeOtherPasswordResponse_ChangeOtherPasswordResponseErrorType {
|
|
118
|
-
/**
|
|
119
|
-
* @generated from enum value: NoError = 0;
|
|
120
|
-
*/
|
|
121
|
-
NoError = 0,
|
|
122
|
-
/**
|
|
123
|
-
* @generated from enum value: UnknownError = -1;
|
|
124
|
-
*/
|
|
125
|
-
UnknownError = -1,
|
|
126
|
-
/**
|
|
127
|
-
* @generated from enum value: UserNotFound = 1;
|
|
128
|
-
*/
|
|
129
|
-
UserNotFound = 1,
|
|
130
|
-
/**
|
|
131
|
-
* @generated from enum value: BadNewPassword = 2;
|
|
132
|
-
*/
|
|
133
|
-
BadNewPassword = 2
|
|
134
|
-
}
|
|
135
|
-
/**
|
|
136
|
-
* Describes the enum IT.WebServices.Fragments.Authentication.ChangeOtherPasswordResponse.ChangeOtherPasswordResponseErrorType.
|
|
137
|
-
*/
|
|
138
|
-
export declare const ChangeOtherPasswordResponse_ChangeOtherPasswordResponseErrorTypeSchema: GenEnum<ChangeOtherPasswordResponse_ChangeOtherPasswordResponseErrorType>;
|
|
139
114
|
/**
|
|
140
115
|
* @generated from message IT.WebServices.Fragments.Authentication.ChangeOtherProfileImageRequest
|
|
141
116
|
*/
|
|
@@ -161,40 +136,15 @@ export declare const ChangeOtherProfileImageRequestSchema: GenMessage<ChangeOthe
|
|
|
161
136
|
*/
|
|
162
137
|
export type ChangeOtherProfileImageResponse = Message<"IT.WebServices.Fragments.Authentication.ChangeOtherProfileImageResponse"> & {
|
|
163
138
|
/**
|
|
164
|
-
* @generated from field: IT.WebServices.Fragments.Authentication.
|
|
139
|
+
* @generated from field: IT.WebServices.Fragments.Authentication.AuthError Error = 1;
|
|
165
140
|
*/
|
|
166
|
-
Error
|
|
141
|
+
Error?: AuthError;
|
|
167
142
|
};
|
|
168
143
|
/**
|
|
169
144
|
* Describes the message IT.WebServices.Fragments.Authentication.ChangeOtherProfileImageResponse.
|
|
170
145
|
* Use `create(ChangeOtherProfileImageResponseSchema)` to create a new message.
|
|
171
146
|
*/
|
|
172
147
|
export declare const ChangeOtherProfileImageResponseSchema: GenMessage<ChangeOtherProfileImageResponse>;
|
|
173
|
-
/**
|
|
174
|
-
* @generated from enum IT.WebServices.Fragments.Authentication.ChangeOtherProfileImageResponse.ChangeOtherProfileImageResponseErrorType
|
|
175
|
-
*/
|
|
176
|
-
export declare enum ChangeOtherProfileImageResponse_ChangeOtherProfileImageResponseErrorType {
|
|
177
|
-
/**
|
|
178
|
-
* @generated from enum value: NoError = 0;
|
|
179
|
-
*/
|
|
180
|
-
NoError = 0,
|
|
181
|
-
/**
|
|
182
|
-
* @generated from enum value: UnknownError = -1;
|
|
183
|
-
*/
|
|
184
|
-
UnknownError = -1,
|
|
185
|
-
/**
|
|
186
|
-
* @generated from enum value: UserNotFound = 1;
|
|
187
|
-
*/
|
|
188
|
-
UserNotFound = 1,
|
|
189
|
-
/**
|
|
190
|
-
* @generated from enum value: BadFormat = 2;
|
|
191
|
-
*/
|
|
192
|
-
BadFormat = 2
|
|
193
|
-
}
|
|
194
|
-
/**
|
|
195
|
-
* Describes the enum IT.WebServices.Fragments.Authentication.ChangeOtherProfileImageResponse.ChangeOtherProfileImageResponseErrorType.
|
|
196
|
-
*/
|
|
197
|
-
export declare const ChangeOtherProfileImageResponse_ChangeOtherProfileImageResponseErrorTypeSchema: GenEnum<ChangeOtherProfileImageResponse_ChangeOtherProfileImageResponseErrorType>;
|
|
198
148
|
/**
|
|
199
149
|
* @generated from message IT.WebServices.Fragments.Authentication.ChangeOwnPasswordRequest
|
|
200
150
|
*/
|
|
@@ -218,40 +168,15 @@ export declare const ChangeOwnPasswordRequestSchema: GenMessage<ChangeOwnPasswor
|
|
|
218
168
|
*/
|
|
219
169
|
export type ChangeOwnPasswordResponse = Message<"IT.WebServices.Fragments.Authentication.ChangeOwnPasswordResponse"> & {
|
|
220
170
|
/**
|
|
221
|
-
* @generated from field: IT.WebServices.Fragments.Authentication.
|
|
171
|
+
* @generated from field: IT.WebServices.Fragments.Authentication.AuthError Error = 1;
|
|
222
172
|
*/
|
|
223
|
-
Error
|
|
173
|
+
Error?: AuthError;
|
|
224
174
|
};
|
|
225
175
|
/**
|
|
226
176
|
* Describes the message IT.WebServices.Fragments.Authentication.ChangeOwnPasswordResponse.
|
|
227
177
|
* Use `create(ChangeOwnPasswordResponseSchema)` to create a new message.
|
|
228
178
|
*/
|
|
229
179
|
export declare const ChangeOwnPasswordResponseSchema: GenMessage<ChangeOwnPasswordResponse>;
|
|
230
|
-
/**
|
|
231
|
-
* @generated from enum IT.WebServices.Fragments.Authentication.ChangeOwnPasswordResponse.ChangeOwnPasswordResponseErrorType
|
|
232
|
-
*/
|
|
233
|
-
export declare enum ChangeOwnPasswordResponse_ChangeOwnPasswordResponseErrorType {
|
|
234
|
-
/**
|
|
235
|
-
* @generated from enum value: NoError = 0;
|
|
236
|
-
*/
|
|
237
|
-
NoError = 0,
|
|
238
|
-
/**
|
|
239
|
-
* @generated from enum value: UnknownError = -1;
|
|
240
|
-
*/
|
|
241
|
-
UnknownError = -1,
|
|
242
|
-
/**
|
|
243
|
-
* @generated from enum value: BadOldPassword = 1;
|
|
244
|
-
*/
|
|
245
|
-
BadOldPassword = 1,
|
|
246
|
-
/**
|
|
247
|
-
* @generated from enum value: BadNewPassword = 2;
|
|
248
|
-
*/
|
|
249
|
-
BadNewPassword = 2
|
|
250
|
-
}
|
|
251
|
-
/**
|
|
252
|
-
* Describes the enum IT.WebServices.Fragments.Authentication.ChangeOwnPasswordResponse.ChangeOwnPasswordResponseErrorType.
|
|
253
|
-
*/
|
|
254
|
-
export declare const ChangeOwnPasswordResponse_ChangeOwnPasswordResponseErrorTypeSchema: GenEnum<ChangeOwnPasswordResponse_ChangeOwnPasswordResponseErrorType>;
|
|
255
180
|
/**
|
|
256
181
|
* @generated from message IT.WebServices.Fragments.Authentication.ChangeOwnProfileImageRequest
|
|
257
182
|
*/
|
|
@@ -271,36 +196,15 @@ export declare const ChangeOwnProfileImageRequestSchema: GenMessage<ChangeOwnPro
|
|
|
271
196
|
*/
|
|
272
197
|
export type ChangeOwnProfileImageResponse = Message<"IT.WebServices.Fragments.Authentication.ChangeOwnProfileImageResponse"> & {
|
|
273
198
|
/**
|
|
274
|
-
* @generated from field: IT.WebServices.Fragments.Authentication.
|
|
199
|
+
* @generated from field: IT.WebServices.Fragments.Authentication.AuthError Error = 1;
|
|
275
200
|
*/
|
|
276
|
-
Error
|
|
201
|
+
Error?: AuthError;
|
|
277
202
|
};
|
|
278
203
|
/**
|
|
279
204
|
* Describes the message IT.WebServices.Fragments.Authentication.ChangeOwnProfileImageResponse.
|
|
280
205
|
* Use `create(ChangeOwnProfileImageResponseSchema)` to create a new message.
|
|
281
206
|
*/
|
|
282
207
|
export declare const ChangeOwnProfileImageResponseSchema: GenMessage<ChangeOwnProfileImageResponse>;
|
|
283
|
-
/**
|
|
284
|
-
* @generated from enum IT.WebServices.Fragments.Authentication.ChangeOwnProfileImageResponse.ChangeOwnProfileImageResponseErrorType
|
|
285
|
-
*/
|
|
286
|
-
export declare enum ChangeOwnProfileImageResponse_ChangeOwnProfileImageResponseErrorType {
|
|
287
|
-
/**
|
|
288
|
-
* @generated from enum value: NoError = 0;
|
|
289
|
-
*/
|
|
290
|
-
NoError = 0,
|
|
291
|
-
/**
|
|
292
|
-
* @generated from enum value: UnknownError = -1;
|
|
293
|
-
*/
|
|
294
|
-
UnknownError = -1,
|
|
295
|
-
/**
|
|
296
|
-
* @generated from enum value: BadFormat = 1;
|
|
297
|
-
*/
|
|
298
|
-
BadFormat = 1
|
|
299
|
-
}
|
|
300
|
-
/**
|
|
301
|
-
* Describes the enum IT.WebServices.Fragments.Authentication.ChangeOwnProfileImageResponse.ChangeOwnProfileImageResponseErrorType.
|
|
302
|
-
*/
|
|
303
|
-
export declare const ChangeOwnProfileImageResponse_ChangeOwnProfileImageResponseErrorTypeSchema: GenEnum<ChangeOwnProfileImageResponse_ChangeOwnProfileImageResponseErrorType>;
|
|
304
208
|
/**
|
|
305
209
|
* @generated from message IT.WebServices.Fragments.Authentication.CreateUserRequest
|
|
306
210
|
*/
|
|
@@ -380,9 +284,9 @@ export declare const DisableEnableOtherUserRequestSchema: GenMessage<DisableEnab
|
|
|
380
284
|
*/
|
|
381
285
|
export type DisableEnableOtherUserResponse = Message<"IT.WebServices.Fragments.Authentication.DisableEnableOtherUserResponse"> & {
|
|
382
286
|
/**
|
|
383
|
-
* @generated from field: IT.WebServices.Fragments.Authentication.
|
|
287
|
+
* @generated from field: IT.WebServices.Fragments.Authentication.AuthError Error = 10;
|
|
384
288
|
*/
|
|
385
|
-
Error
|
|
289
|
+
Error?: AuthError;
|
|
386
290
|
};
|
|
387
291
|
/**
|
|
388
292
|
* Describes the message IT.WebServices.Fragments.Authentication.DisableEnableOtherUserResponse.
|
|
@@ -3,7 +3,7 @@ import type { Timestamp } from "@bufbuild/protobuf/wkt";
|
|
|
3
3
|
import type { EventRecord, EventRecurrenceRule, EventVenue } from "./EventRecord_pb";
|
|
4
4
|
import type { EventTicketRecord } from "./EventTicketRecord_pb";
|
|
5
5
|
import type { EventTicketClass } from "./TicketClassRecord_pb";
|
|
6
|
-
import type { EventError
|
|
6
|
+
import type { EventError } from "./EventError_pb";
|
|
7
7
|
import type { Pagination } from "../../CommonTypes_pb";
|
|
8
8
|
import type { Message } from "@bufbuild/protobuf";
|
|
9
9
|
/**
|
|
@@ -469,9 +469,9 @@ export declare const AdminCancelOtherTicketRequestSchema: GenMessage<AdminCancel
|
|
|
469
469
|
*/
|
|
470
470
|
export type AdminCancelOtherTicketResponse = Message<"IT.WebServices.Fragments.Authorization.Events.AdminCancelOtherTicketResponse"> & {
|
|
471
471
|
/**
|
|
472
|
-
* @generated from field: IT.WebServices.Fragments.Authorization.Events.
|
|
472
|
+
* @generated from field: IT.WebServices.Fragments.Authorization.Events.EventError Error = 1;
|
|
473
473
|
*/
|
|
474
|
-
Error?:
|
|
474
|
+
Error?: EventError;
|
|
475
475
|
};
|
|
476
476
|
/**
|
|
477
477
|
* Describes the message IT.WebServices.Fragments.Authorization.Events.AdminCancelOtherTicketResponse.
|
|
@@ -519,9 +519,9 @@ export type AdminReserveEventTicketForUserResponse = Message<"IT.WebServices.Fra
|
|
|
519
519
|
/**
|
|
520
520
|
* Error information if reservation failed
|
|
521
521
|
*
|
|
522
|
-
* @generated from field: IT.WebServices.Fragments.Authorization.Events.
|
|
522
|
+
* @generated from field: IT.WebServices.Fragments.Authorization.Events.EventError Error = 1;
|
|
523
523
|
*/
|
|
524
|
-
Error?:
|
|
524
|
+
Error?: EventError;
|
|
525
525
|
/**
|
|
526
526
|
* List of reserved tickets if successful
|
|
527
527
|
*
|