@objectstack/spec 0.1.1 → 0.2.0

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.
Files changed (174) hide show
  1. package/README.md +73 -1
  2. package/dist/api/contract.zod.d.ts +1733 -0
  3. package/dist/api/contract.zod.d.ts.map +1 -0
  4. package/dist/api/contract.zod.js +138 -0
  5. package/dist/data/dataset.zod.d.ts +2 -2
  6. package/dist/data/field.zod.d.ts +1648 -10
  7. package/dist/data/field.zod.d.ts.map +1 -1
  8. package/dist/data/field.zod.js +149 -8
  9. package/dist/data/filter.zod.d.ts +295 -0
  10. package/dist/data/filter.zod.d.ts.map +1 -0
  11. package/dist/data/filter.zod.js +226 -0
  12. package/dist/data/mapping.zod.d.ts +215 -2
  13. package/dist/data/mapping.zod.d.ts.map +1 -1
  14. package/dist/data/object.zod.d.ts +505 -25
  15. package/dist/data/object.zod.d.ts.map +1 -1
  16. package/dist/data/object.zod.js +32 -5
  17. package/dist/data/query.zod.d.ts +349 -0
  18. package/dist/data/query.zod.d.ts.map +1 -1
  19. package/dist/data/query.zod.js +77 -1
  20. package/dist/data/trigger.zod.d.ts +354 -0
  21. package/dist/data/trigger.zod.d.ts.map +1 -0
  22. package/dist/data/trigger.zod.js +195 -0
  23. package/dist/data/validation.zod.d.ts +83 -43
  24. package/dist/data/validation.zod.d.ts.map +1 -1
  25. package/dist/data/validation.zod.js +51 -5
  26. package/dist/index.d.ts +10 -0
  27. package/dist/index.d.ts.map +1 -1
  28. package/dist/index.js +11 -0
  29. package/dist/system/api.zod.d.ts +130 -4
  30. package/dist/system/api.zod.d.ts.map +1 -1
  31. package/dist/system/api.zod.js +4 -1
  32. package/dist/system/auth.zod.d.ts +2287 -0
  33. package/dist/system/auth.zod.d.ts.map +1 -0
  34. package/dist/system/auth.zod.js +365 -0
  35. package/dist/system/datasource.zod.d.ts +193 -30
  36. package/dist/system/datasource.zod.d.ts.map +1 -1
  37. package/dist/system/datasource.zod.js +58 -11
  38. package/dist/system/discovery.zod.d.ts +174 -0
  39. package/dist/system/discovery.zod.d.ts.map +1 -0
  40. package/dist/system/discovery.zod.js +53 -0
  41. package/dist/system/driver.zod.d.ts +1631 -0
  42. package/dist/system/driver.zod.d.ts.map +1 -0
  43. package/dist/system/driver.zod.js +337 -0
  44. package/dist/system/license.zod.d.ts +2 -2
  45. package/dist/system/manifest.zod.d.ts +323 -52
  46. package/dist/system/manifest.zod.d.ts.map +1 -1
  47. package/dist/system/manifest.zod.js +91 -17
  48. package/dist/system/plugin.zod.d.ts +3516 -0
  49. package/dist/system/plugin.zod.d.ts.map +1 -0
  50. package/dist/system/plugin.zod.js +226 -0
  51. package/dist/system/policy.zod.d.ts +10 -10
  52. package/dist/system/territory.zod.d.ts +1 -1
  53. package/dist/system/webhook.zod.d.ts +3 -3
  54. package/dist/ui/action.zod.d.ts +19 -12
  55. package/dist/ui/action.zod.d.ts.map +1 -1
  56. package/dist/ui/action.zod.js +7 -1
  57. package/dist/ui/app.zod.d.ts +109 -3
  58. package/dist/ui/app.zod.d.ts.map +1 -1
  59. package/dist/ui/app.zod.js +13 -2
  60. package/dist/ui/dashboard.zod.d.ts +19 -13
  61. package/dist/ui/dashboard.zod.d.ts.map +1 -1
  62. package/dist/ui/dashboard.zod.js +10 -3
  63. package/dist/ui/page.zod.d.ts +6 -6
  64. package/dist/ui/report.zod.d.ts +13 -32
  65. package/dist/ui/report.zod.d.ts.map +1 -1
  66. package/dist/ui/report.zod.js +10 -9
  67. package/dist/ui/theme.zod.d.ts +1221 -0
  68. package/dist/ui/theme.zod.d.ts.map +1 -0
  69. package/dist/ui/theme.zod.js +202 -0
  70. package/dist/ui/widget.zod.d.ts +350 -0
  71. package/dist/ui/widget.zod.d.ts.map +1 -0
  72. package/dist/ui/widget.zod.js +66 -0
  73. package/json-schema/AccountLinkingConfig.json +27 -0
  74. package/json-schema/Action.json +8 -2
  75. package/json-schema/ActionParam.json +8 -2
  76. package/json-schema/Address.json +40 -0
  77. package/json-schema/AggregationFunction.json +19 -0
  78. package/json-schema/AggregationNode.json +42 -0
  79. package/json-schema/Animation.json +56 -0
  80. package/json-schema/ApiCapabilities.json +28 -0
  81. package/json-schema/ApiError.json +27 -0
  82. package/json-schema/ApiRoutes.json +41 -0
  83. package/json-schema/App.json +13 -2
  84. package/json-schema/AsyncValidation.json +70 -0
  85. package/json-schema/AuthConfig.json +606 -0
  86. package/json-schema/AuthPluginConfig.json +28 -0
  87. package/json-schema/AuthStrategy.json +17 -0
  88. package/json-schema/AuthenticationConfig.json +601 -0
  89. package/json-schema/AuthenticationProvider.json +617 -0
  90. package/json-schema/BaseResponse.json +63 -0
  91. package/json-schema/BorderRadius.json +44 -0
  92. package/json-schema/Breakpoints.json +36 -0
  93. package/json-schema/BulkRequest.json +29 -0
  94. package/json-schema/BulkResponse.json +108 -0
  95. package/json-schema/CSRFConfig.json +31 -0
  96. package/json-schema/ColorPalette.json +83 -0
  97. package/json-schema/ComparisonOperator.json +56 -0
  98. package/json-schema/ConditionalValidation.json +793 -0
  99. package/json-schema/CreateRequest.json +20 -0
  100. package/json-schema/CrossFieldValidation.json +56 -0
  101. package/json-schema/CustomValidator.json +57 -0
  102. package/json-schema/Dashboard.json +20 -0
  103. package/json-schema/DashboardWidget.json +20 -0
  104. package/json-schema/DatabaseAdapter.json +38 -0
  105. package/json-schema/Datasource.json +25 -23
  106. package/json-schema/DatasourceCapabilities.json +25 -5
  107. package/json-schema/DeleteResponse.json +68 -0
  108. package/json-schema/Discovery.json +114 -0
  109. package/json-schema/DriverCapabilities.json +69 -0
  110. package/json-schema/DriverDefinition.json +86 -0
  111. package/json-schema/DriverInterface.json +88 -0
  112. package/json-schema/DriverOptions.json +23 -0
  113. package/json-schema/DriverType.json +1 -18
  114. package/json-schema/EmailPasswordConfig.json +43 -0
  115. package/json-schema/EqualityOperator.json +14 -0
  116. package/json-schema/ExportRequest.json +786 -0
  117. package/json-schema/Field.json +75 -4
  118. package/json-schema/FieldOperators.json +108 -0
  119. package/json-schema/FieldType.json +8 -2
  120. package/json-schema/FieldWidgetProps.json +327 -0
  121. package/json-schema/FilterCondition.json +28 -0
  122. package/json-schema/I18nContext.json +12 -0
  123. package/json-schema/JoinNode.json +455 -0
  124. package/json-schema/JoinType.json +15 -0
  125. package/json-schema/ListRecordResponse.json +103 -0
  126. package/json-schema/LocationCoordinates.json +36 -0
  127. package/json-schema/Logger.json +25 -0
  128. package/json-schema/MagicLinkConfig.json +21 -0
  129. package/json-schema/Manifest.json +243 -18
  130. package/json-schema/Mapping.json +328 -0
  131. package/json-schema/ModificationResult.json +46 -0
  132. package/json-schema/NormalizedFilter.json +348 -0
  133. package/json-schema/OAuthProvider.json +66 -0
  134. package/json-schema/Object.json +103 -6
  135. package/json-schema/ObjectCapabilities.json +26 -0
  136. package/json-schema/ObjectQLClient.json +12 -0
  137. package/json-schema/PasskeyConfig.json +54 -0
  138. package/json-schema/Plugin.json +20 -0
  139. package/json-schema/PluginContext.json +91 -0
  140. package/json-schema/PluginLifecycle.json +11 -0
  141. package/json-schema/Query.json +328 -0
  142. package/json-schema/QueryFilter.json +34 -0
  143. package/json-schema/RangeOperator.json +41 -0
  144. package/json-schema/RateLimitConfig.json +36 -0
  145. package/json-schema/RecordData.json +11 -0
  146. package/json-schema/Report.json +20 -26
  147. package/json-schema/Router.json +12 -0
  148. package/json-schema/Scheduler.json +12 -0
  149. package/json-schema/ScopedStorage.json +12 -0
  150. package/json-schema/SessionConfig.json +56 -0
  151. package/json-schema/SetOperator.json +18 -0
  152. package/json-schema/Shadow.json +44 -0
  153. package/json-schema/SingleRecordResponse.json +69 -0
  154. package/json-schema/Spacing.json +64 -0
  155. package/json-schema/SpecialOperator.json +18 -0
  156. package/json-schema/StandardAuthProvider.json +622 -0
  157. package/json-schema/StringOperator.json +21 -0
  158. package/json-schema/SystemAPI.json +12 -0
  159. package/json-schema/Theme.json +543 -0
  160. package/json-schema/ThemeMode.json +14 -0
  161. package/json-schema/Trigger.json +73 -0
  162. package/json-schema/TriggerAction.json +14 -0
  163. package/json-schema/TriggerContext.json +61 -0
  164. package/json-schema/TriggerTiming.json +13 -0
  165. package/json-schema/TwoFactorConfig.json +40 -0
  166. package/json-schema/Typography.json +142 -0
  167. package/json-schema/UpdateRequest.json +20 -0
  168. package/json-schema/UserFieldMapping.json +47 -0
  169. package/json-schema/ValidationRule.json +583 -0
  170. package/json-schema/WindowFunction.json +24 -0
  171. package/json-schema/WindowFunctionNode.json +104 -0
  172. package/json-schema/WindowSpec.json +65 -0
  173. package/json-schema/ZIndex.json +44 -0
  174. package/package.json +8 -3
@@ -0,0 +1,3516 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * Interface schemas for Context Capabilities
4
+ */
5
+ export declare const LoggerSchema: z.ZodObject<{
6
+ debug: z.ZodAny;
7
+ info: z.ZodAny;
8
+ warn: z.ZodAny;
9
+ error: z.ZodAny;
10
+ }, "strip", z.ZodTypeAny, {
11
+ error?: any;
12
+ info?: any;
13
+ debug?: any;
14
+ warn?: any;
15
+ }, {
16
+ error?: any;
17
+ info?: any;
18
+ debug?: any;
19
+ warn?: any;
20
+ }>;
21
+ export declare const ObjectQLClientSchema: z.ZodObject<{
22
+ object: z.ZodFunction<z.ZodTuple<[z.ZodString], z.ZodUnknown>, z.ZodAny>;
23
+ query: z.ZodFunction<z.ZodTuple<[z.ZodString], z.ZodUnknown>, z.ZodPromise<z.ZodAny>>;
24
+ }, "strip", z.ZodTypeAny, {
25
+ object: (args_0: string, ...args: unknown[]) => any;
26
+ query: (args_0: string, ...args: unknown[]) => Promise<any>;
27
+ }, {
28
+ object: (args_0: string, ...args: unknown[]) => any;
29
+ query: (args_0: string, ...args: unknown[]) => Promise<any>;
30
+ }>;
31
+ export declare const RouterSchema: z.ZodObject<{
32
+ get: z.ZodFunction<z.ZodTuple<[z.ZodString, z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>], z.ZodUnknown>, z.ZodUnknown>;
33
+ post: z.ZodFunction<z.ZodTuple<[z.ZodString, z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>], z.ZodUnknown>, z.ZodUnknown>;
34
+ use: z.ZodFunction<z.ZodTuple<[z.ZodOptional<z.ZodString>, z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>], z.ZodUnknown>, z.ZodUnknown>;
35
+ }, "strip", z.ZodTypeAny, {
36
+ get: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
37
+ post: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
38
+ use: (args_0: string | undefined, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
39
+ }, {
40
+ get: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
41
+ post: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
42
+ use: (args_0: string | undefined, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
43
+ }>;
44
+ export declare const SchedulerSchema: z.ZodObject<{
45
+ schedule: z.ZodFunction<z.ZodTuple<[z.ZodString, z.ZodString, z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>], z.ZodUnknown>, z.ZodUnknown>;
46
+ }, "strip", z.ZodTypeAny, {
47
+ schedule: (args_0: string, args_1: string, args_2: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
48
+ }, {
49
+ schedule: (args_0: string, args_1: string, args_2: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
50
+ }>;
51
+ export declare const SystemAPISchema: z.ZodObject<{
52
+ getCurrentUser: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodPromise<z.ZodAny>>;
53
+ getConfig: z.ZodFunction<z.ZodTuple<[z.ZodString], z.ZodUnknown>, z.ZodPromise<z.ZodAny>>;
54
+ }, "strip", z.ZodTypeAny, {
55
+ getCurrentUser: (...args: unknown[]) => Promise<any>;
56
+ getConfig: (args_0: string, ...args: unknown[]) => Promise<any>;
57
+ }, {
58
+ getCurrentUser: (...args: unknown[]) => Promise<any>;
59
+ getConfig: (args_0: string, ...args: unknown[]) => Promise<any>;
60
+ }>;
61
+ export declare const ScopedStorageSchema: z.ZodObject<{
62
+ get: z.ZodFunction<z.ZodTuple<[z.ZodString], z.ZodUnknown>, z.ZodPromise<z.ZodAny>>;
63
+ set: z.ZodFunction<z.ZodTuple<[z.ZodString, z.ZodAny], z.ZodUnknown>, z.ZodPromise<z.ZodVoid>>;
64
+ delete: z.ZodFunction<z.ZodTuple<[z.ZodString], z.ZodUnknown>, z.ZodPromise<z.ZodVoid>>;
65
+ }, "strip", z.ZodTypeAny, {
66
+ set: (args_0: string, args_1: any, ...args: unknown[]) => Promise<void>;
67
+ get: (args_0: string, ...args: unknown[]) => Promise<any>;
68
+ delete: (args_0: string, ...args: unknown[]) => Promise<void>;
69
+ }, {
70
+ set: (args_0: string, args_1: any, ...args: unknown[]) => Promise<void>;
71
+ get: (args_0: string, ...args: unknown[]) => Promise<any>;
72
+ delete: (args_0: string, ...args: unknown[]) => Promise<void>;
73
+ }>;
74
+ export declare const I18nContextSchema: z.ZodObject<{
75
+ t: z.ZodFunction<z.ZodTuple<[z.ZodString, z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>], z.ZodUnknown>, z.ZodString>;
76
+ getLocale: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodString>;
77
+ }, "strip", z.ZodTypeAny, {
78
+ t: (args_0: string, args_1: Record<string, any> | undefined, ...args: unknown[]) => string;
79
+ getLocale: (...args: unknown[]) => string;
80
+ }, {
81
+ t: (args_0: string, args_1: Record<string, any> | undefined, ...args: unknown[]) => string;
82
+ getLocale: (...args: unknown[]) => string;
83
+ }>;
84
+ /**
85
+ * Plugin Context Schema
86
+ *
87
+ * This defines the runtime context available to plugins during their lifecycle.
88
+ * The context provides access to core ObjectStack APIs and services.
89
+ *
90
+ * @example
91
+ * export default {
92
+ * onEnable: async (context: PluginContext) => {
93
+ * const { ql, os, logger } = context;
94
+ * logger.info('Plugin enabled');
95
+ * await ql.object('custom_object').find({});
96
+ * }
97
+ * };
98
+ */
99
+ export declare const PluginContextSchema: z.ZodObject<{
100
+ /**
101
+ * ObjectQL data access API.
102
+ * Provides methods to query and manipulate business objects.
103
+ *
104
+ * @example
105
+ * await context.ql.object('account').find({ status: 'active' });
106
+ * await context.ql.object('contact').create({ name: 'John Doe' });
107
+ */
108
+ ql: z.ZodObject<{
109
+ object: z.ZodFunction<z.ZodTuple<[z.ZodString], z.ZodUnknown>, z.ZodAny>;
110
+ query: z.ZodFunction<z.ZodTuple<[z.ZodString], z.ZodUnknown>, z.ZodPromise<z.ZodAny>>;
111
+ }, "strip", z.ZodTypeAny, {
112
+ object: (args_0: string, ...args: unknown[]) => any;
113
+ query: (args_0: string, ...args: unknown[]) => Promise<any>;
114
+ }, {
115
+ object: (args_0: string, ...args: unknown[]) => any;
116
+ query: (args_0: string, ...args: unknown[]) => Promise<any>;
117
+ }>;
118
+ /**
119
+ * ObjectOS system API.
120
+ * Provides access to system-level functionality and configuration.
121
+ *
122
+ * @example
123
+ * const user = await context.os.getCurrentUser();
124
+ * const config = await context.os.getConfig('plugin.settings');
125
+ */
126
+ os: z.ZodObject<{
127
+ getCurrentUser: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodPromise<z.ZodAny>>;
128
+ getConfig: z.ZodFunction<z.ZodTuple<[z.ZodString], z.ZodUnknown>, z.ZodPromise<z.ZodAny>>;
129
+ }, "strip", z.ZodTypeAny, {
130
+ getCurrentUser: (...args: unknown[]) => Promise<any>;
131
+ getConfig: (args_0: string, ...args: unknown[]) => Promise<any>;
132
+ }, {
133
+ getCurrentUser: (...args: unknown[]) => Promise<any>;
134
+ getConfig: (args_0: string, ...args: unknown[]) => Promise<any>;
135
+ }>;
136
+ /**
137
+ * Logging interface.
138
+ * Provides structured logging capabilities with different levels.
139
+ *
140
+ * @example
141
+ * context.logger.info('Operation completed');
142
+ * context.logger.error('Operation failed', { error });
143
+ */
144
+ logger: z.ZodObject<{
145
+ debug: z.ZodAny;
146
+ info: z.ZodAny;
147
+ warn: z.ZodAny;
148
+ error: z.ZodAny;
149
+ }, "strip", z.ZodTypeAny, {
150
+ error?: any;
151
+ info?: any;
152
+ debug?: any;
153
+ warn?: any;
154
+ }, {
155
+ error?: any;
156
+ info?: any;
157
+ debug?: any;
158
+ warn?: any;
159
+ }>;
160
+ /**
161
+ * Scoped Storage.
162
+ * Key-Value store isolated for this plugin.
163
+ *
164
+ * @example
165
+ * await context.storage.set('last_sync', Date.now());
166
+ */
167
+ storage: z.ZodObject<{
168
+ get: z.ZodFunction<z.ZodTuple<[z.ZodString], z.ZodUnknown>, z.ZodPromise<z.ZodAny>>;
169
+ set: z.ZodFunction<z.ZodTuple<[z.ZodString, z.ZodAny], z.ZodUnknown>, z.ZodPromise<z.ZodVoid>>;
170
+ delete: z.ZodFunction<z.ZodTuple<[z.ZodString], z.ZodUnknown>, z.ZodPromise<z.ZodVoid>>;
171
+ }, "strip", z.ZodTypeAny, {
172
+ set: (args_0: string, args_1: any, ...args: unknown[]) => Promise<void>;
173
+ get: (args_0: string, ...args: unknown[]) => Promise<any>;
174
+ delete: (args_0: string, ...args: unknown[]) => Promise<void>;
175
+ }, {
176
+ set: (args_0: string, args_1: any, ...args: unknown[]) => Promise<void>;
177
+ get: (args_0: string, ...args: unknown[]) => Promise<any>;
178
+ delete: (args_0: string, ...args: unknown[]) => Promise<void>;
179
+ }>;
180
+ /**
181
+ * I18n Helper.
182
+ *
183
+ * @example
184
+ * const msg = context.i18n.t('error.invalid_input');
185
+ */
186
+ i18n: z.ZodObject<{
187
+ t: z.ZodFunction<z.ZodTuple<[z.ZodString, z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>], z.ZodUnknown>, z.ZodString>;
188
+ getLocale: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodString>;
189
+ }, "strip", z.ZodTypeAny, {
190
+ t: (args_0: string, args_1: Record<string, any> | undefined, ...args: unknown[]) => string;
191
+ getLocale: (...args: unknown[]) => string;
192
+ }, {
193
+ t: (args_0: string, args_1: Record<string, any> | undefined, ...args: unknown[]) => string;
194
+ getLocale: (...args: unknown[]) => string;
195
+ }>;
196
+ /**
197
+ * Metadata registry.
198
+ * Provides access to system metadata like object schemas, field definitions, etc.
199
+ *
200
+ * @example
201
+ * const schema = await context.metadata.getObject('account');
202
+ * const fields = await context.metadata.getFields('account');
203
+ */
204
+ metadata: z.ZodAny;
205
+ /**
206
+ * Event bus.
207
+ * Provides pub/sub capabilities for system and custom events.
208
+ *
209
+ * @example
210
+ * context.events.on('record.created', handler);
211
+ * context.events.emit('custom.event', data);
212
+ */
213
+ events: z.ZodAny;
214
+ /**
215
+ * Application Runtime Capabilities.
216
+ * Provides mechanisms to extend the running application (Routes, Jobs, etc).
217
+ */
218
+ app: z.ZodObject<{
219
+ router: z.ZodObject<{
220
+ get: z.ZodFunction<z.ZodTuple<[z.ZodString, z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>], z.ZodUnknown>, z.ZodUnknown>;
221
+ post: z.ZodFunction<z.ZodTuple<[z.ZodString, z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>], z.ZodUnknown>, z.ZodUnknown>;
222
+ use: z.ZodFunction<z.ZodTuple<[z.ZodOptional<z.ZodString>, z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>], z.ZodUnknown>, z.ZodUnknown>;
223
+ }, "strip", z.ZodTypeAny, {
224
+ get: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
225
+ post: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
226
+ use: (args_0: string | undefined, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
227
+ }, {
228
+ get: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
229
+ post: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
230
+ use: (args_0: string | undefined, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
231
+ }>;
232
+ scheduler: z.ZodOptional<z.ZodObject<{
233
+ schedule: z.ZodFunction<z.ZodTuple<[z.ZodString, z.ZodString, z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>], z.ZodUnknown>, z.ZodUnknown>;
234
+ }, "strip", z.ZodTypeAny, {
235
+ schedule: (args_0: string, args_1: string, args_2: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
236
+ }, {
237
+ schedule: (args_0: string, args_1: string, args_2: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
238
+ }>>;
239
+ }, "strip", z.ZodTypeAny, {
240
+ router: {
241
+ get: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
242
+ post: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
243
+ use: (args_0: string | undefined, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
244
+ };
245
+ scheduler?: {
246
+ schedule: (args_0: string, args_1: string, args_2: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
247
+ } | undefined;
248
+ }, {
249
+ router: {
250
+ get: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
251
+ post: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
252
+ use: (args_0: string | undefined, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
253
+ };
254
+ scheduler?: {
255
+ schedule: (args_0: string, args_1: string, args_2: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
256
+ } | undefined;
257
+ }>;
258
+ }, "strip", z.ZodTypeAny, {
259
+ ql: {
260
+ object: (args_0: string, ...args: unknown[]) => any;
261
+ query: (args_0: string, ...args: unknown[]) => Promise<any>;
262
+ };
263
+ logger: {
264
+ error?: any;
265
+ info?: any;
266
+ debug?: any;
267
+ warn?: any;
268
+ };
269
+ app: {
270
+ router: {
271
+ get: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
272
+ post: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
273
+ use: (args_0: string | undefined, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
274
+ };
275
+ scheduler?: {
276
+ schedule: (args_0: string, args_1: string, args_2: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
277
+ } | undefined;
278
+ };
279
+ storage: {
280
+ set: (args_0: string, args_1: any, ...args: unknown[]) => Promise<void>;
281
+ get: (args_0: string, ...args: unknown[]) => Promise<any>;
282
+ delete: (args_0: string, ...args: unknown[]) => Promise<void>;
283
+ };
284
+ os: {
285
+ getCurrentUser: (...args: unknown[]) => Promise<any>;
286
+ getConfig: (args_0: string, ...args: unknown[]) => Promise<any>;
287
+ };
288
+ i18n: {
289
+ t: (args_0: string, args_1: Record<string, any> | undefined, ...args: unknown[]) => string;
290
+ getLocale: (...args: unknown[]) => string;
291
+ };
292
+ events?: any;
293
+ metadata?: any;
294
+ }, {
295
+ ql: {
296
+ object: (args_0: string, ...args: unknown[]) => any;
297
+ query: (args_0: string, ...args: unknown[]) => Promise<any>;
298
+ };
299
+ logger: {
300
+ error?: any;
301
+ info?: any;
302
+ debug?: any;
303
+ warn?: any;
304
+ };
305
+ app: {
306
+ router: {
307
+ get: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
308
+ post: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
309
+ use: (args_0: string | undefined, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
310
+ };
311
+ scheduler?: {
312
+ schedule: (args_0: string, args_1: string, args_2: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
313
+ } | undefined;
314
+ };
315
+ storage: {
316
+ set: (args_0: string, args_1: any, ...args: unknown[]) => Promise<void>;
317
+ get: (args_0: string, ...args: unknown[]) => Promise<any>;
318
+ delete: (args_0: string, ...args: unknown[]) => Promise<void>;
319
+ };
320
+ os: {
321
+ getCurrentUser: (...args: unknown[]) => Promise<any>;
322
+ getConfig: (args_0: string, ...args: unknown[]) => Promise<any>;
323
+ };
324
+ i18n: {
325
+ t: (args_0: string, args_1: Record<string, any> | undefined, ...args: unknown[]) => string;
326
+ getLocale: (...args: unknown[]) => string;
327
+ };
328
+ events?: any;
329
+ metadata?: any;
330
+ }>;
331
+ /**
332
+ * Plugin Lifecycle Schema
333
+ *
334
+ * This defines the lifecycle hooks available to plugins.
335
+ * Plugins can implement any or all of these hooks to respond to lifecycle events.
336
+ *
337
+ * All hooks receive PluginContext as their first parameter.
338
+ * All hooks are optional and asynchronous.
339
+ *
340
+ * @example
341
+ * export default {
342
+ * onInstall: async (context) => {
343
+ * // Initialize database tables
344
+ * await context.ql.object('plugin_data').syncSchema();
345
+ * },
346
+ *
347
+ * onEnable: async (context) => {
348
+ * // Start background services
349
+ * await startScheduler(context);
350
+ * },
351
+ *
352
+ * onDisable: async (context) => {
353
+ * // Stop background services
354
+ * await stopScheduler();
355
+ * }
356
+ * };
357
+ */
358
+ export declare const PluginLifecycleSchema: z.ZodObject<{
359
+ /**
360
+ * Called when the plugin is first installed.
361
+ * Use this to set up initial data, create database tables, or register resources.
362
+ *
363
+ * @param context - Plugin runtime context
364
+ */
365
+ onInstall: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodObject<{
366
+ /**
367
+ * ObjectQL data access API.
368
+ * Provides methods to query and manipulate business objects.
369
+ *
370
+ * @example
371
+ * await context.ql.object('account').find({ status: 'active' });
372
+ * await context.ql.object('contact').create({ name: 'John Doe' });
373
+ */
374
+ ql: z.ZodObject<{
375
+ object: z.ZodFunction<z.ZodTuple<[z.ZodString], z.ZodUnknown>, z.ZodAny>;
376
+ query: z.ZodFunction<z.ZodTuple<[z.ZodString], z.ZodUnknown>, z.ZodPromise<z.ZodAny>>;
377
+ }, "strip", z.ZodTypeAny, {
378
+ object: (args_0: string, ...args: unknown[]) => any;
379
+ query: (args_0: string, ...args: unknown[]) => Promise<any>;
380
+ }, {
381
+ object: (args_0: string, ...args: unknown[]) => any;
382
+ query: (args_0: string, ...args: unknown[]) => Promise<any>;
383
+ }>;
384
+ /**
385
+ * ObjectOS system API.
386
+ * Provides access to system-level functionality and configuration.
387
+ *
388
+ * @example
389
+ * const user = await context.os.getCurrentUser();
390
+ * const config = await context.os.getConfig('plugin.settings');
391
+ */
392
+ os: z.ZodObject<{
393
+ getCurrentUser: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodPromise<z.ZodAny>>;
394
+ getConfig: z.ZodFunction<z.ZodTuple<[z.ZodString], z.ZodUnknown>, z.ZodPromise<z.ZodAny>>;
395
+ }, "strip", z.ZodTypeAny, {
396
+ getCurrentUser: (...args: unknown[]) => Promise<any>;
397
+ getConfig: (args_0: string, ...args: unknown[]) => Promise<any>;
398
+ }, {
399
+ getCurrentUser: (...args: unknown[]) => Promise<any>;
400
+ getConfig: (args_0: string, ...args: unknown[]) => Promise<any>;
401
+ }>;
402
+ /**
403
+ * Logging interface.
404
+ * Provides structured logging capabilities with different levels.
405
+ *
406
+ * @example
407
+ * context.logger.info('Operation completed');
408
+ * context.logger.error('Operation failed', { error });
409
+ */
410
+ logger: z.ZodObject<{
411
+ debug: z.ZodAny;
412
+ info: z.ZodAny;
413
+ warn: z.ZodAny;
414
+ error: z.ZodAny;
415
+ }, "strip", z.ZodTypeAny, {
416
+ error?: any;
417
+ info?: any;
418
+ debug?: any;
419
+ warn?: any;
420
+ }, {
421
+ error?: any;
422
+ info?: any;
423
+ debug?: any;
424
+ warn?: any;
425
+ }>;
426
+ /**
427
+ * Scoped Storage.
428
+ * Key-Value store isolated for this plugin.
429
+ *
430
+ * @example
431
+ * await context.storage.set('last_sync', Date.now());
432
+ */
433
+ storage: z.ZodObject<{
434
+ get: z.ZodFunction<z.ZodTuple<[z.ZodString], z.ZodUnknown>, z.ZodPromise<z.ZodAny>>;
435
+ set: z.ZodFunction<z.ZodTuple<[z.ZodString, z.ZodAny], z.ZodUnknown>, z.ZodPromise<z.ZodVoid>>;
436
+ delete: z.ZodFunction<z.ZodTuple<[z.ZodString], z.ZodUnknown>, z.ZodPromise<z.ZodVoid>>;
437
+ }, "strip", z.ZodTypeAny, {
438
+ set: (args_0: string, args_1: any, ...args: unknown[]) => Promise<void>;
439
+ get: (args_0: string, ...args: unknown[]) => Promise<any>;
440
+ delete: (args_0: string, ...args: unknown[]) => Promise<void>;
441
+ }, {
442
+ set: (args_0: string, args_1: any, ...args: unknown[]) => Promise<void>;
443
+ get: (args_0: string, ...args: unknown[]) => Promise<any>;
444
+ delete: (args_0: string, ...args: unknown[]) => Promise<void>;
445
+ }>;
446
+ /**
447
+ * I18n Helper.
448
+ *
449
+ * @example
450
+ * const msg = context.i18n.t('error.invalid_input');
451
+ */
452
+ i18n: z.ZodObject<{
453
+ t: z.ZodFunction<z.ZodTuple<[z.ZodString, z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>], z.ZodUnknown>, z.ZodString>;
454
+ getLocale: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodString>;
455
+ }, "strip", z.ZodTypeAny, {
456
+ t: (args_0: string, args_1: Record<string, any> | undefined, ...args: unknown[]) => string;
457
+ getLocale: (...args: unknown[]) => string;
458
+ }, {
459
+ t: (args_0: string, args_1: Record<string, any> | undefined, ...args: unknown[]) => string;
460
+ getLocale: (...args: unknown[]) => string;
461
+ }>;
462
+ /**
463
+ * Metadata registry.
464
+ * Provides access to system metadata like object schemas, field definitions, etc.
465
+ *
466
+ * @example
467
+ * const schema = await context.metadata.getObject('account');
468
+ * const fields = await context.metadata.getFields('account');
469
+ */
470
+ metadata: z.ZodAny;
471
+ /**
472
+ * Event bus.
473
+ * Provides pub/sub capabilities for system and custom events.
474
+ *
475
+ * @example
476
+ * context.events.on('record.created', handler);
477
+ * context.events.emit('custom.event', data);
478
+ */
479
+ events: z.ZodAny;
480
+ /**
481
+ * Application Runtime Capabilities.
482
+ * Provides mechanisms to extend the running application (Routes, Jobs, etc).
483
+ */
484
+ app: z.ZodObject<{
485
+ router: z.ZodObject<{
486
+ get: z.ZodFunction<z.ZodTuple<[z.ZodString, z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>], z.ZodUnknown>, z.ZodUnknown>;
487
+ post: z.ZodFunction<z.ZodTuple<[z.ZodString, z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>], z.ZodUnknown>, z.ZodUnknown>;
488
+ use: z.ZodFunction<z.ZodTuple<[z.ZodOptional<z.ZodString>, z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>], z.ZodUnknown>, z.ZodUnknown>;
489
+ }, "strip", z.ZodTypeAny, {
490
+ get: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
491
+ post: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
492
+ use: (args_0: string | undefined, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
493
+ }, {
494
+ get: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
495
+ post: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
496
+ use: (args_0: string | undefined, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
497
+ }>;
498
+ scheduler: z.ZodOptional<z.ZodObject<{
499
+ schedule: z.ZodFunction<z.ZodTuple<[z.ZodString, z.ZodString, z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>], z.ZodUnknown>, z.ZodUnknown>;
500
+ }, "strip", z.ZodTypeAny, {
501
+ schedule: (args_0: string, args_1: string, args_2: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
502
+ }, {
503
+ schedule: (args_0: string, args_1: string, args_2: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
504
+ }>>;
505
+ }, "strip", z.ZodTypeAny, {
506
+ router: {
507
+ get: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
508
+ post: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
509
+ use: (args_0: string | undefined, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
510
+ };
511
+ scheduler?: {
512
+ schedule: (args_0: string, args_1: string, args_2: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
513
+ } | undefined;
514
+ }, {
515
+ router: {
516
+ get: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
517
+ post: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
518
+ use: (args_0: string | undefined, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
519
+ };
520
+ scheduler?: {
521
+ schedule: (args_0: string, args_1: string, args_2: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
522
+ } | undefined;
523
+ }>;
524
+ }, "strip", z.ZodTypeAny, {
525
+ ql: {
526
+ object: (args_0: string, ...args: unknown[]) => any;
527
+ query: (args_0: string, ...args: unknown[]) => Promise<any>;
528
+ };
529
+ logger: {
530
+ error?: any;
531
+ info?: any;
532
+ debug?: any;
533
+ warn?: any;
534
+ };
535
+ app: {
536
+ router: {
537
+ get: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
538
+ post: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
539
+ use: (args_0: string | undefined, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
540
+ };
541
+ scheduler?: {
542
+ schedule: (args_0: string, args_1: string, args_2: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
543
+ } | undefined;
544
+ };
545
+ storage: {
546
+ set: (args_0: string, args_1: any, ...args: unknown[]) => Promise<void>;
547
+ get: (args_0: string, ...args: unknown[]) => Promise<any>;
548
+ delete: (args_0: string, ...args: unknown[]) => Promise<void>;
549
+ };
550
+ os: {
551
+ getCurrentUser: (...args: unknown[]) => Promise<any>;
552
+ getConfig: (args_0: string, ...args: unknown[]) => Promise<any>;
553
+ };
554
+ i18n: {
555
+ t: (args_0: string, args_1: Record<string, any> | undefined, ...args: unknown[]) => string;
556
+ getLocale: (...args: unknown[]) => string;
557
+ };
558
+ events?: any;
559
+ metadata?: any;
560
+ }, {
561
+ ql: {
562
+ object: (args_0: string, ...args: unknown[]) => any;
563
+ query: (args_0: string, ...args: unknown[]) => Promise<any>;
564
+ };
565
+ logger: {
566
+ error?: any;
567
+ info?: any;
568
+ debug?: any;
569
+ warn?: any;
570
+ };
571
+ app: {
572
+ router: {
573
+ get: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
574
+ post: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
575
+ use: (args_0: string | undefined, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
576
+ };
577
+ scheduler?: {
578
+ schedule: (args_0: string, args_1: string, args_2: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
579
+ } | undefined;
580
+ };
581
+ storage: {
582
+ set: (args_0: string, args_1: any, ...args: unknown[]) => Promise<void>;
583
+ get: (args_0: string, ...args: unknown[]) => Promise<any>;
584
+ delete: (args_0: string, ...args: unknown[]) => Promise<void>;
585
+ };
586
+ os: {
587
+ getCurrentUser: (...args: unknown[]) => Promise<any>;
588
+ getConfig: (args_0: string, ...args: unknown[]) => Promise<any>;
589
+ };
590
+ i18n: {
591
+ t: (args_0: string, args_1: Record<string, any> | undefined, ...args: unknown[]) => string;
592
+ getLocale: (...args: unknown[]) => string;
593
+ };
594
+ events?: any;
595
+ metadata?: any;
596
+ }>], z.ZodUnknown>, z.ZodPromise<z.ZodVoid>>>;
597
+ /**
598
+ * Called when the plugin is enabled.
599
+ * Use this to start services, register event handlers, or initialize runtime state.
600
+ *
601
+ * @param context - Plugin runtime context
602
+ */
603
+ onEnable: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodObject<{
604
+ /**
605
+ * ObjectQL data access API.
606
+ * Provides methods to query and manipulate business objects.
607
+ *
608
+ * @example
609
+ * await context.ql.object('account').find({ status: 'active' });
610
+ * await context.ql.object('contact').create({ name: 'John Doe' });
611
+ */
612
+ ql: z.ZodObject<{
613
+ object: z.ZodFunction<z.ZodTuple<[z.ZodString], z.ZodUnknown>, z.ZodAny>;
614
+ query: z.ZodFunction<z.ZodTuple<[z.ZodString], z.ZodUnknown>, z.ZodPromise<z.ZodAny>>;
615
+ }, "strip", z.ZodTypeAny, {
616
+ object: (args_0: string, ...args: unknown[]) => any;
617
+ query: (args_0: string, ...args: unknown[]) => Promise<any>;
618
+ }, {
619
+ object: (args_0: string, ...args: unknown[]) => any;
620
+ query: (args_0: string, ...args: unknown[]) => Promise<any>;
621
+ }>;
622
+ /**
623
+ * ObjectOS system API.
624
+ * Provides access to system-level functionality and configuration.
625
+ *
626
+ * @example
627
+ * const user = await context.os.getCurrentUser();
628
+ * const config = await context.os.getConfig('plugin.settings');
629
+ */
630
+ os: z.ZodObject<{
631
+ getCurrentUser: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodPromise<z.ZodAny>>;
632
+ getConfig: z.ZodFunction<z.ZodTuple<[z.ZodString], z.ZodUnknown>, z.ZodPromise<z.ZodAny>>;
633
+ }, "strip", z.ZodTypeAny, {
634
+ getCurrentUser: (...args: unknown[]) => Promise<any>;
635
+ getConfig: (args_0: string, ...args: unknown[]) => Promise<any>;
636
+ }, {
637
+ getCurrentUser: (...args: unknown[]) => Promise<any>;
638
+ getConfig: (args_0: string, ...args: unknown[]) => Promise<any>;
639
+ }>;
640
+ /**
641
+ * Logging interface.
642
+ * Provides structured logging capabilities with different levels.
643
+ *
644
+ * @example
645
+ * context.logger.info('Operation completed');
646
+ * context.logger.error('Operation failed', { error });
647
+ */
648
+ logger: z.ZodObject<{
649
+ debug: z.ZodAny;
650
+ info: z.ZodAny;
651
+ warn: z.ZodAny;
652
+ error: z.ZodAny;
653
+ }, "strip", z.ZodTypeAny, {
654
+ error?: any;
655
+ info?: any;
656
+ debug?: any;
657
+ warn?: any;
658
+ }, {
659
+ error?: any;
660
+ info?: any;
661
+ debug?: any;
662
+ warn?: any;
663
+ }>;
664
+ /**
665
+ * Scoped Storage.
666
+ * Key-Value store isolated for this plugin.
667
+ *
668
+ * @example
669
+ * await context.storage.set('last_sync', Date.now());
670
+ */
671
+ storage: z.ZodObject<{
672
+ get: z.ZodFunction<z.ZodTuple<[z.ZodString], z.ZodUnknown>, z.ZodPromise<z.ZodAny>>;
673
+ set: z.ZodFunction<z.ZodTuple<[z.ZodString, z.ZodAny], z.ZodUnknown>, z.ZodPromise<z.ZodVoid>>;
674
+ delete: z.ZodFunction<z.ZodTuple<[z.ZodString], z.ZodUnknown>, z.ZodPromise<z.ZodVoid>>;
675
+ }, "strip", z.ZodTypeAny, {
676
+ set: (args_0: string, args_1: any, ...args: unknown[]) => Promise<void>;
677
+ get: (args_0: string, ...args: unknown[]) => Promise<any>;
678
+ delete: (args_0: string, ...args: unknown[]) => Promise<void>;
679
+ }, {
680
+ set: (args_0: string, args_1: any, ...args: unknown[]) => Promise<void>;
681
+ get: (args_0: string, ...args: unknown[]) => Promise<any>;
682
+ delete: (args_0: string, ...args: unknown[]) => Promise<void>;
683
+ }>;
684
+ /**
685
+ * I18n Helper.
686
+ *
687
+ * @example
688
+ * const msg = context.i18n.t('error.invalid_input');
689
+ */
690
+ i18n: z.ZodObject<{
691
+ t: z.ZodFunction<z.ZodTuple<[z.ZodString, z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>], z.ZodUnknown>, z.ZodString>;
692
+ getLocale: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodString>;
693
+ }, "strip", z.ZodTypeAny, {
694
+ t: (args_0: string, args_1: Record<string, any> | undefined, ...args: unknown[]) => string;
695
+ getLocale: (...args: unknown[]) => string;
696
+ }, {
697
+ t: (args_0: string, args_1: Record<string, any> | undefined, ...args: unknown[]) => string;
698
+ getLocale: (...args: unknown[]) => string;
699
+ }>;
700
+ /**
701
+ * Metadata registry.
702
+ * Provides access to system metadata like object schemas, field definitions, etc.
703
+ *
704
+ * @example
705
+ * const schema = await context.metadata.getObject('account');
706
+ * const fields = await context.metadata.getFields('account');
707
+ */
708
+ metadata: z.ZodAny;
709
+ /**
710
+ * Event bus.
711
+ * Provides pub/sub capabilities for system and custom events.
712
+ *
713
+ * @example
714
+ * context.events.on('record.created', handler);
715
+ * context.events.emit('custom.event', data);
716
+ */
717
+ events: z.ZodAny;
718
+ /**
719
+ * Application Runtime Capabilities.
720
+ * Provides mechanisms to extend the running application (Routes, Jobs, etc).
721
+ */
722
+ app: z.ZodObject<{
723
+ router: z.ZodObject<{
724
+ get: z.ZodFunction<z.ZodTuple<[z.ZodString, z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>], z.ZodUnknown>, z.ZodUnknown>;
725
+ post: z.ZodFunction<z.ZodTuple<[z.ZodString, z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>], z.ZodUnknown>, z.ZodUnknown>;
726
+ use: z.ZodFunction<z.ZodTuple<[z.ZodOptional<z.ZodString>, z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>], z.ZodUnknown>, z.ZodUnknown>;
727
+ }, "strip", z.ZodTypeAny, {
728
+ get: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
729
+ post: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
730
+ use: (args_0: string | undefined, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
731
+ }, {
732
+ get: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
733
+ post: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
734
+ use: (args_0: string | undefined, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
735
+ }>;
736
+ scheduler: z.ZodOptional<z.ZodObject<{
737
+ schedule: z.ZodFunction<z.ZodTuple<[z.ZodString, z.ZodString, z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>], z.ZodUnknown>, z.ZodUnknown>;
738
+ }, "strip", z.ZodTypeAny, {
739
+ schedule: (args_0: string, args_1: string, args_2: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
740
+ }, {
741
+ schedule: (args_0: string, args_1: string, args_2: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
742
+ }>>;
743
+ }, "strip", z.ZodTypeAny, {
744
+ router: {
745
+ get: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
746
+ post: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
747
+ use: (args_0: string | undefined, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
748
+ };
749
+ scheduler?: {
750
+ schedule: (args_0: string, args_1: string, args_2: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
751
+ } | undefined;
752
+ }, {
753
+ router: {
754
+ get: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
755
+ post: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
756
+ use: (args_0: string | undefined, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
757
+ };
758
+ scheduler?: {
759
+ schedule: (args_0: string, args_1: string, args_2: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
760
+ } | undefined;
761
+ }>;
762
+ }, "strip", z.ZodTypeAny, {
763
+ ql: {
764
+ object: (args_0: string, ...args: unknown[]) => any;
765
+ query: (args_0: string, ...args: unknown[]) => Promise<any>;
766
+ };
767
+ logger: {
768
+ error?: any;
769
+ info?: any;
770
+ debug?: any;
771
+ warn?: any;
772
+ };
773
+ app: {
774
+ router: {
775
+ get: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
776
+ post: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
777
+ use: (args_0: string | undefined, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
778
+ };
779
+ scheduler?: {
780
+ schedule: (args_0: string, args_1: string, args_2: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
781
+ } | undefined;
782
+ };
783
+ storage: {
784
+ set: (args_0: string, args_1: any, ...args: unknown[]) => Promise<void>;
785
+ get: (args_0: string, ...args: unknown[]) => Promise<any>;
786
+ delete: (args_0: string, ...args: unknown[]) => Promise<void>;
787
+ };
788
+ os: {
789
+ getCurrentUser: (...args: unknown[]) => Promise<any>;
790
+ getConfig: (args_0: string, ...args: unknown[]) => Promise<any>;
791
+ };
792
+ i18n: {
793
+ t: (args_0: string, args_1: Record<string, any> | undefined, ...args: unknown[]) => string;
794
+ getLocale: (...args: unknown[]) => string;
795
+ };
796
+ events?: any;
797
+ metadata?: any;
798
+ }, {
799
+ ql: {
800
+ object: (args_0: string, ...args: unknown[]) => any;
801
+ query: (args_0: string, ...args: unknown[]) => Promise<any>;
802
+ };
803
+ logger: {
804
+ error?: any;
805
+ info?: any;
806
+ debug?: any;
807
+ warn?: any;
808
+ };
809
+ app: {
810
+ router: {
811
+ get: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
812
+ post: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
813
+ use: (args_0: string | undefined, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
814
+ };
815
+ scheduler?: {
816
+ schedule: (args_0: string, args_1: string, args_2: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
817
+ } | undefined;
818
+ };
819
+ storage: {
820
+ set: (args_0: string, args_1: any, ...args: unknown[]) => Promise<void>;
821
+ get: (args_0: string, ...args: unknown[]) => Promise<any>;
822
+ delete: (args_0: string, ...args: unknown[]) => Promise<void>;
823
+ };
824
+ os: {
825
+ getCurrentUser: (...args: unknown[]) => Promise<any>;
826
+ getConfig: (args_0: string, ...args: unknown[]) => Promise<any>;
827
+ };
828
+ i18n: {
829
+ t: (args_0: string, args_1: Record<string, any> | undefined, ...args: unknown[]) => string;
830
+ getLocale: (...args: unknown[]) => string;
831
+ };
832
+ events?: any;
833
+ metadata?: any;
834
+ }>], z.ZodUnknown>, z.ZodPromise<z.ZodVoid>>>;
835
+ /**
836
+ * Called when the plugin is disabled.
837
+ * Use this to stop services, unregister handlers, or clean up runtime state.
838
+ *
839
+ * @param context - Plugin runtime context
840
+ */
841
+ onDisable: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodObject<{
842
+ /**
843
+ * ObjectQL data access API.
844
+ * Provides methods to query and manipulate business objects.
845
+ *
846
+ * @example
847
+ * await context.ql.object('account').find({ status: 'active' });
848
+ * await context.ql.object('contact').create({ name: 'John Doe' });
849
+ */
850
+ ql: z.ZodObject<{
851
+ object: z.ZodFunction<z.ZodTuple<[z.ZodString], z.ZodUnknown>, z.ZodAny>;
852
+ query: z.ZodFunction<z.ZodTuple<[z.ZodString], z.ZodUnknown>, z.ZodPromise<z.ZodAny>>;
853
+ }, "strip", z.ZodTypeAny, {
854
+ object: (args_0: string, ...args: unknown[]) => any;
855
+ query: (args_0: string, ...args: unknown[]) => Promise<any>;
856
+ }, {
857
+ object: (args_0: string, ...args: unknown[]) => any;
858
+ query: (args_0: string, ...args: unknown[]) => Promise<any>;
859
+ }>;
860
+ /**
861
+ * ObjectOS system API.
862
+ * Provides access to system-level functionality and configuration.
863
+ *
864
+ * @example
865
+ * const user = await context.os.getCurrentUser();
866
+ * const config = await context.os.getConfig('plugin.settings');
867
+ */
868
+ os: z.ZodObject<{
869
+ getCurrentUser: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodPromise<z.ZodAny>>;
870
+ getConfig: z.ZodFunction<z.ZodTuple<[z.ZodString], z.ZodUnknown>, z.ZodPromise<z.ZodAny>>;
871
+ }, "strip", z.ZodTypeAny, {
872
+ getCurrentUser: (...args: unknown[]) => Promise<any>;
873
+ getConfig: (args_0: string, ...args: unknown[]) => Promise<any>;
874
+ }, {
875
+ getCurrentUser: (...args: unknown[]) => Promise<any>;
876
+ getConfig: (args_0: string, ...args: unknown[]) => Promise<any>;
877
+ }>;
878
+ /**
879
+ * Logging interface.
880
+ * Provides structured logging capabilities with different levels.
881
+ *
882
+ * @example
883
+ * context.logger.info('Operation completed');
884
+ * context.logger.error('Operation failed', { error });
885
+ */
886
+ logger: z.ZodObject<{
887
+ debug: z.ZodAny;
888
+ info: z.ZodAny;
889
+ warn: z.ZodAny;
890
+ error: z.ZodAny;
891
+ }, "strip", z.ZodTypeAny, {
892
+ error?: any;
893
+ info?: any;
894
+ debug?: any;
895
+ warn?: any;
896
+ }, {
897
+ error?: any;
898
+ info?: any;
899
+ debug?: any;
900
+ warn?: any;
901
+ }>;
902
+ /**
903
+ * Scoped Storage.
904
+ * Key-Value store isolated for this plugin.
905
+ *
906
+ * @example
907
+ * await context.storage.set('last_sync', Date.now());
908
+ */
909
+ storage: z.ZodObject<{
910
+ get: z.ZodFunction<z.ZodTuple<[z.ZodString], z.ZodUnknown>, z.ZodPromise<z.ZodAny>>;
911
+ set: z.ZodFunction<z.ZodTuple<[z.ZodString, z.ZodAny], z.ZodUnknown>, z.ZodPromise<z.ZodVoid>>;
912
+ delete: z.ZodFunction<z.ZodTuple<[z.ZodString], z.ZodUnknown>, z.ZodPromise<z.ZodVoid>>;
913
+ }, "strip", z.ZodTypeAny, {
914
+ set: (args_0: string, args_1: any, ...args: unknown[]) => Promise<void>;
915
+ get: (args_0: string, ...args: unknown[]) => Promise<any>;
916
+ delete: (args_0: string, ...args: unknown[]) => Promise<void>;
917
+ }, {
918
+ set: (args_0: string, args_1: any, ...args: unknown[]) => Promise<void>;
919
+ get: (args_0: string, ...args: unknown[]) => Promise<any>;
920
+ delete: (args_0: string, ...args: unknown[]) => Promise<void>;
921
+ }>;
922
+ /**
923
+ * I18n Helper.
924
+ *
925
+ * @example
926
+ * const msg = context.i18n.t('error.invalid_input');
927
+ */
928
+ i18n: z.ZodObject<{
929
+ t: z.ZodFunction<z.ZodTuple<[z.ZodString, z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>], z.ZodUnknown>, z.ZodString>;
930
+ getLocale: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodString>;
931
+ }, "strip", z.ZodTypeAny, {
932
+ t: (args_0: string, args_1: Record<string, any> | undefined, ...args: unknown[]) => string;
933
+ getLocale: (...args: unknown[]) => string;
934
+ }, {
935
+ t: (args_0: string, args_1: Record<string, any> | undefined, ...args: unknown[]) => string;
936
+ getLocale: (...args: unknown[]) => string;
937
+ }>;
938
+ /**
939
+ * Metadata registry.
940
+ * Provides access to system metadata like object schemas, field definitions, etc.
941
+ *
942
+ * @example
943
+ * const schema = await context.metadata.getObject('account');
944
+ * const fields = await context.metadata.getFields('account');
945
+ */
946
+ metadata: z.ZodAny;
947
+ /**
948
+ * Event bus.
949
+ * Provides pub/sub capabilities for system and custom events.
950
+ *
951
+ * @example
952
+ * context.events.on('record.created', handler);
953
+ * context.events.emit('custom.event', data);
954
+ */
955
+ events: z.ZodAny;
956
+ /**
957
+ * Application Runtime Capabilities.
958
+ * Provides mechanisms to extend the running application (Routes, Jobs, etc).
959
+ */
960
+ app: z.ZodObject<{
961
+ router: z.ZodObject<{
962
+ get: z.ZodFunction<z.ZodTuple<[z.ZodString, z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>], z.ZodUnknown>, z.ZodUnknown>;
963
+ post: z.ZodFunction<z.ZodTuple<[z.ZodString, z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>], z.ZodUnknown>, z.ZodUnknown>;
964
+ use: z.ZodFunction<z.ZodTuple<[z.ZodOptional<z.ZodString>, z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>], z.ZodUnknown>, z.ZodUnknown>;
965
+ }, "strip", z.ZodTypeAny, {
966
+ get: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
967
+ post: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
968
+ use: (args_0: string | undefined, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
969
+ }, {
970
+ get: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
971
+ post: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
972
+ use: (args_0: string | undefined, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
973
+ }>;
974
+ scheduler: z.ZodOptional<z.ZodObject<{
975
+ schedule: z.ZodFunction<z.ZodTuple<[z.ZodString, z.ZodString, z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>], z.ZodUnknown>, z.ZodUnknown>;
976
+ }, "strip", z.ZodTypeAny, {
977
+ schedule: (args_0: string, args_1: string, args_2: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
978
+ }, {
979
+ schedule: (args_0: string, args_1: string, args_2: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
980
+ }>>;
981
+ }, "strip", z.ZodTypeAny, {
982
+ router: {
983
+ get: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
984
+ post: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
985
+ use: (args_0: string | undefined, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
986
+ };
987
+ scheduler?: {
988
+ schedule: (args_0: string, args_1: string, args_2: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
989
+ } | undefined;
990
+ }, {
991
+ router: {
992
+ get: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
993
+ post: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
994
+ use: (args_0: string | undefined, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
995
+ };
996
+ scheduler?: {
997
+ schedule: (args_0: string, args_1: string, args_2: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
998
+ } | undefined;
999
+ }>;
1000
+ }, "strip", z.ZodTypeAny, {
1001
+ ql: {
1002
+ object: (args_0: string, ...args: unknown[]) => any;
1003
+ query: (args_0: string, ...args: unknown[]) => Promise<any>;
1004
+ };
1005
+ logger: {
1006
+ error?: any;
1007
+ info?: any;
1008
+ debug?: any;
1009
+ warn?: any;
1010
+ };
1011
+ app: {
1012
+ router: {
1013
+ get: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
1014
+ post: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
1015
+ use: (args_0: string | undefined, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
1016
+ };
1017
+ scheduler?: {
1018
+ schedule: (args_0: string, args_1: string, args_2: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
1019
+ } | undefined;
1020
+ };
1021
+ storage: {
1022
+ set: (args_0: string, args_1: any, ...args: unknown[]) => Promise<void>;
1023
+ get: (args_0: string, ...args: unknown[]) => Promise<any>;
1024
+ delete: (args_0: string, ...args: unknown[]) => Promise<void>;
1025
+ };
1026
+ os: {
1027
+ getCurrentUser: (...args: unknown[]) => Promise<any>;
1028
+ getConfig: (args_0: string, ...args: unknown[]) => Promise<any>;
1029
+ };
1030
+ i18n: {
1031
+ t: (args_0: string, args_1: Record<string, any> | undefined, ...args: unknown[]) => string;
1032
+ getLocale: (...args: unknown[]) => string;
1033
+ };
1034
+ events?: any;
1035
+ metadata?: any;
1036
+ }, {
1037
+ ql: {
1038
+ object: (args_0: string, ...args: unknown[]) => any;
1039
+ query: (args_0: string, ...args: unknown[]) => Promise<any>;
1040
+ };
1041
+ logger: {
1042
+ error?: any;
1043
+ info?: any;
1044
+ debug?: any;
1045
+ warn?: any;
1046
+ };
1047
+ app: {
1048
+ router: {
1049
+ get: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
1050
+ post: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
1051
+ use: (args_0: string | undefined, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
1052
+ };
1053
+ scheduler?: {
1054
+ schedule: (args_0: string, args_1: string, args_2: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
1055
+ } | undefined;
1056
+ };
1057
+ storage: {
1058
+ set: (args_0: string, args_1: any, ...args: unknown[]) => Promise<void>;
1059
+ get: (args_0: string, ...args: unknown[]) => Promise<any>;
1060
+ delete: (args_0: string, ...args: unknown[]) => Promise<void>;
1061
+ };
1062
+ os: {
1063
+ getCurrentUser: (...args: unknown[]) => Promise<any>;
1064
+ getConfig: (args_0: string, ...args: unknown[]) => Promise<any>;
1065
+ };
1066
+ i18n: {
1067
+ t: (args_0: string, args_1: Record<string, any> | undefined, ...args: unknown[]) => string;
1068
+ getLocale: (...args: unknown[]) => string;
1069
+ };
1070
+ events?: any;
1071
+ metadata?: any;
1072
+ }>], z.ZodUnknown>, z.ZodPromise<z.ZodVoid>>>;
1073
+ /**
1074
+ * Called when the plugin is uninstalled.
1075
+ * Use this to clean up data, remove database tables, or unregister resources.
1076
+ *
1077
+ * @param context - Plugin runtime context
1078
+ */
1079
+ onUninstall: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodObject<{
1080
+ /**
1081
+ * ObjectQL data access API.
1082
+ * Provides methods to query and manipulate business objects.
1083
+ *
1084
+ * @example
1085
+ * await context.ql.object('account').find({ status: 'active' });
1086
+ * await context.ql.object('contact').create({ name: 'John Doe' });
1087
+ */
1088
+ ql: z.ZodObject<{
1089
+ object: z.ZodFunction<z.ZodTuple<[z.ZodString], z.ZodUnknown>, z.ZodAny>;
1090
+ query: z.ZodFunction<z.ZodTuple<[z.ZodString], z.ZodUnknown>, z.ZodPromise<z.ZodAny>>;
1091
+ }, "strip", z.ZodTypeAny, {
1092
+ object: (args_0: string, ...args: unknown[]) => any;
1093
+ query: (args_0: string, ...args: unknown[]) => Promise<any>;
1094
+ }, {
1095
+ object: (args_0: string, ...args: unknown[]) => any;
1096
+ query: (args_0: string, ...args: unknown[]) => Promise<any>;
1097
+ }>;
1098
+ /**
1099
+ * ObjectOS system API.
1100
+ * Provides access to system-level functionality and configuration.
1101
+ *
1102
+ * @example
1103
+ * const user = await context.os.getCurrentUser();
1104
+ * const config = await context.os.getConfig('plugin.settings');
1105
+ */
1106
+ os: z.ZodObject<{
1107
+ getCurrentUser: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodPromise<z.ZodAny>>;
1108
+ getConfig: z.ZodFunction<z.ZodTuple<[z.ZodString], z.ZodUnknown>, z.ZodPromise<z.ZodAny>>;
1109
+ }, "strip", z.ZodTypeAny, {
1110
+ getCurrentUser: (...args: unknown[]) => Promise<any>;
1111
+ getConfig: (args_0: string, ...args: unknown[]) => Promise<any>;
1112
+ }, {
1113
+ getCurrentUser: (...args: unknown[]) => Promise<any>;
1114
+ getConfig: (args_0: string, ...args: unknown[]) => Promise<any>;
1115
+ }>;
1116
+ /**
1117
+ * Logging interface.
1118
+ * Provides structured logging capabilities with different levels.
1119
+ *
1120
+ * @example
1121
+ * context.logger.info('Operation completed');
1122
+ * context.logger.error('Operation failed', { error });
1123
+ */
1124
+ logger: z.ZodObject<{
1125
+ debug: z.ZodAny;
1126
+ info: z.ZodAny;
1127
+ warn: z.ZodAny;
1128
+ error: z.ZodAny;
1129
+ }, "strip", z.ZodTypeAny, {
1130
+ error?: any;
1131
+ info?: any;
1132
+ debug?: any;
1133
+ warn?: any;
1134
+ }, {
1135
+ error?: any;
1136
+ info?: any;
1137
+ debug?: any;
1138
+ warn?: any;
1139
+ }>;
1140
+ /**
1141
+ * Scoped Storage.
1142
+ * Key-Value store isolated for this plugin.
1143
+ *
1144
+ * @example
1145
+ * await context.storage.set('last_sync', Date.now());
1146
+ */
1147
+ storage: z.ZodObject<{
1148
+ get: z.ZodFunction<z.ZodTuple<[z.ZodString], z.ZodUnknown>, z.ZodPromise<z.ZodAny>>;
1149
+ set: z.ZodFunction<z.ZodTuple<[z.ZodString, z.ZodAny], z.ZodUnknown>, z.ZodPromise<z.ZodVoid>>;
1150
+ delete: z.ZodFunction<z.ZodTuple<[z.ZodString], z.ZodUnknown>, z.ZodPromise<z.ZodVoid>>;
1151
+ }, "strip", z.ZodTypeAny, {
1152
+ set: (args_0: string, args_1: any, ...args: unknown[]) => Promise<void>;
1153
+ get: (args_0: string, ...args: unknown[]) => Promise<any>;
1154
+ delete: (args_0: string, ...args: unknown[]) => Promise<void>;
1155
+ }, {
1156
+ set: (args_0: string, args_1: any, ...args: unknown[]) => Promise<void>;
1157
+ get: (args_0: string, ...args: unknown[]) => Promise<any>;
1158
+ delete: (args_0: string, ...args: unknown[]) => Promise<void>;
1159
+ }>;
1160
+ /**
1161
+ * I18n Helper.
1162
+ *
1163
+ * @example
1164
+ * const msg = context.i18n.t('error.invalid_input');
1165
+ */
1166
+ i18n: z.ZodObject<{
1167
+ t: z.ZodFunction<z.ZodTuple<[z.ZodString, z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>], z.ZodUnknown>, z.ZodString>;
1168
+ getLocale: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodString>;
1169
+ }, "strip", z.ZodTypeAny, {
1170
+ t: (args_0: string, args_1: Record<string, any> | undefined, ...args: unknown[]) => string;
1171
+ getLocale: (...args: unknown[]) => string;
1172
+ }, {
1173
+ t: (args_0: string, args_1: Record<string, any> | undefined, ...args: unknown[]) => string;
1174
+ getLocale: (...args: unknown[]) => string;
1175
+ }>;
1176
+ /**
1177
+ * Metadata registry.
1178
+ * Provides access to system metadata like object schemas, field definitions, etc.
1179
+ *
1180
+ * @example
1181
+ * const schema = await context.metadata.getObject('account');
1182
+ * const fields = await context.metadata.getFields('account');
1183
+ */
1184
+ metadata: z.ZodAny;
1185
+ /**
1186
+ * Event bus.
1187
+ * Provides pub/sub capabilities for system and custom events.
1188
+ *
1189
+ * @example
1190
+ * context.events.on('record.created', handler);
1191
+ * context.events.emit('custom.event', data);
1192
+ */
1193
+ events: z.ZodAny;
1194
+ /**
1195
+ * Application Runtime Capabilities.
1196
+ * Provides mechanisms to extend the running application (Routes, Jobs, etc).
1197
+ */
1198
+ app: z.ZodObject<{
1199
+ router: z.ZodObject<{
1200
+ get: z.ZodFunction<z.ZodTuple<[z.ZodString, z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>], z.ZodUnknown>, z.ZodUnknown>;
1201
+ post: z.ZodFunction<z.ZodTuple<[z.ZodString, z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>], z.ZodUnknown>, z.ZodUnknown>;
1202
+ use: z.ZodFunction<z.ZodTuple<[z.ZodOptional<z.ZodString>, z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>], z.ZodUnknown>, z.ZodUnknown>;
1203
+ }, "strip", z.ZodTypeAny, {
1204
+ get: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
1205
+ post: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
1206
+ use: (args_0: string | undefined, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
1207
+ }, {
1208
+ get: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
1209
+ post: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
1210
+ use: (args_0: string | undefined, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
1211
+ }>;
1212
+ scheduler: z.ZodOptional<z.ZodObject<{
1213
+ schedule: z.ZodFunction<z.ZodTuple<[z.ZodString, z.ZodString, z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>], z.ZodUnknown>, z.ZodUnknown>;
1214
+ }, "strip", z.ZodTypeAny, {
1215
+ schedule: (args_0: string, args_1: string, args_2: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
1216
+ }, {
1217
+ schedule: (args_0: string, args_1: string, args_2: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
1218
+ }>>;
1219
+ }, "strip", z.ZodTypeAny, {
1220
+ router: {
1221
+ get: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
1222
+ post: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
1223
+ use: (args_0: string | undefined, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
1224
+ };
1225
+ scheduler?: {
1226
+ schedule: (args_0: string, args_1: string, args_2: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
1227
+ } | undefined;
1228
+ }, {
1229
+ router: {
1230
+ get: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
1231
+ post: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
1232
+ use: (args_0: string | undefined, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
1233
+ };
1234
+ scheduler?: {
1235
+ schedule: (args_0: string, args_1: string, args_2: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
1236
+ } | undefined;
1237
+ }>;
1238
+ }, "strip", z.ZodTypeAny, {
1239
+ ql: {
1240
+ object: (args_0: string, ...args: unknown[]) => any;
1241
+ query: (args_0: string, ...args: unknown[]) => Promise<any>;
1242
+ };
1243
+ logger: {
1244
+ error?: any;
1245
+ info?: any;
1246
+ debug?: any;
1247
+ warn?: any;
1248
+ };
1249
+ app: {
1250
+ router: {
1251
+ get: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
1252
+ post: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
1253
+ use: (args_0: string | undefined, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
1254
+ };
1255
+ scheduler?: {
1256
+ schedule: (args_0: string, args_1: string, args_2: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
1257
+ } | undefined;
1258
+ };
1259
+ storage: {
1260
+ set: (args_0: string, args_1: any, ...args: unknown[]) => Promise<void>;
1261
+ get: (args_0: string, ...args: unknown[]) => Promise<any>;
1262
+ delete: (args_0: string, ...args: unknown[]) => Promise<void>;
1263
+ };
1264
+ os: {
1265
+ getCurrentUser: (...args: unknown[]) => Promise<any>;
1266
+ getConfig: (args_0: string, ...args: unknown[]) => Promise<any>;
1267
+ };
1268
+ i18n: {
1269
+ t: (args_0: string, args_1: Record<string, any> | undefined, ...args: unknown[]) => string;
1270
+ getLocale: (...args: unknown[]) => string;
1271
+ };
1272
+ events?: any;
1273
+ metadata?: any;
1274
+ }, {
1275
+ ql: {
1276
+ object: (args_0: string, ...args: unknown[]) => any;
1277
+ query: (args_0: string, ...args: unknown[]) => Promise<any>;
1278
+ };
1279
+ logger: {
1280
+ error?: any;
1281
+ info?: any;
1282
+ debug?: any;
1283
+ warn?: any;
1284
+ };
1285
+ app: {
1286
+ router: {
1287
+ get: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
1288
+ post: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
1289
+ use: (args_0: string | undefined, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
1290
+ };
1291
+ scheduler?: {
1292
+ schedule: (args_0: string, args_1: string, args_2: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
1293
+ } | undefined;
1294
+ };
1295
+ storage: {
1296
+ set: (args_0: string, args_1: any, ...args: unknown[]) => Promise<void>;
1297
+ get: (args_0: string, ...args: unknown[]) => Promise<any>;
1298
+ delete: (args_0: string, ...args: unknown[]) => Promise<void>;
1299
+ };
1300
+ os: {
1301
+ getCurrentUser: (...args: unknown[]) => Promise<any>;
1302
+ getConfig: (args_0: string, ...args: unknown[]) => Promise<any>;
1303
+ };
1304
+ i18n: {
1305
+ t: (args_0: string, args_1: Record<string, any> | undefined, ...args: unknown[]) => string;
1306
+ getLocale: (...args: unknown[]) => string;
1307
+ };
1308
+ events?: any;
1309
+ metadata?: any;
1310
+ }>], z.ZodUnknown>, z.ZodPromise<z.ZodVoid>>>;
1311
+ /**
1312
+ * Called when the plugin is upgraded to a new version.
1313
+ * Use this to migrate data, update schemas, or handle breaking changes.
1314
+ *
1315
+ * @param context - Plugin runtime context
1316
+ * @param fromVersion - Previous version string
1317
+ * @param toVersion - New version string
1318
+ */
1319
+ onUpgrade: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodObject<{
1320
+ /**
1321
+ * ObjectQL data access API.
1322
+ * Provides methods to query and manipulate business objects.
1323
+ *
1324
+ * @example
1325
+ * await context.ql.object('account').find({ status: 'active' });
1326
+ * await context.ql.object('contact').create({ name: 'John Doe' });
1327
+ */
1328
+ ql: z.ZodObject<{
1329
+ object: z.ZodFunction<z.ZodTuple<[z.ZodString], z.ZodUnknown>, z.ZodAny>;
1330
+ query: z.ZodFunction<z.ZodTuple<[z.ZodString], z.ZodUnknown>, z.ZodPromise<z.ZodAny>>;
1331
+ }, "strip", z.ZodTypeAny, {
1332
+ object: (args_0: string, ...args: unknown[]) => any;
1333
+ query: (args_0: string, ...args: unknown[]) => Promise<any>;
1334
+ }, {
1335
+ object: (args_0: string, ...args: unknown[]) => any;
1336
+ query: (args_0: string, ...args: unknown[]) => Promise<any>;
1337
+ }>;
1338
+ /**
1339
+ * ObjectOS system API.
1340
+ * Provides access to system-level functionality and configuration.
1341
+ *
1342
+ * @example
1343
+ * const user = await context.os.getCurrentUser();
1344
+ * const config = await context.os.getConfig('plugin.settings');
1345
+ */
1346
+ os: z.ZodObject<{
1347
+ getCurrentUser: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodPromise<z.ZodAny>>;
1348
+ getConfig: z.ZodFunction<z.ZodTuple<[z.ZodString], z.ZodUnknown>, z.ZodPromise<z.ZodAny>>;
1349
+ }, "strip", z.ZodTypeAny, {
1350
+ getCurrentUser: (...args: unknown[]) => Promise<any>;
1351
+ getConfig: (args_0: string, ...args: unknown[]) => Promise<any>;
1352
+ }, {
1353
+ getCurrentUser: (...args: unknown[]) => Promise<any>;
1354
+ getConfig: (args_0: string, ...args: unknown[]) => Promise<any>;
1355
+ }>;
1356
+ /**
1357
+ * Logging interface.
1358
+ * Provides structured logging capabilities with different levels.
1359
+ *
1360
+ * @example
1361
+ * context.logger.info('Operation completed');
1362
+ * context.logger.error('Operation failed', { error });
1363
+ */
1364
+ logger: z.ZodObject<{
1365
+ debug: z.ZodAny;
1366
+ info: z.ZodAny;
1367
+ warn: z.ZodAny;
1368
+ error: z.ZodAny;
1369
+ }, "strip", z.ZodTypeAny, {
1370
+ error?: any;
1371
+ info?: any;
1372
+ debug?: any;
1373
+ warn?: any;
1374
+ }, {
1375
+ error?: any;
1376
+ info?: any;
1377
+ debug?: any;
1378
+ warn?: any;
1379
+ }>;
1380
+ /**
1381
+ * Scoped Storage.
1382
+ * Key-Value store isolated for this plugin.
1383
+ *
1384
+ * @example
1385
+ * await context.storage.set('last_sync', Date.now());
1386
+ */
1387
+ storage: z.ZodObject<{
1388
+ get: z.ZodFunction<z.ZodTuple<[z.ZodString], z.ZodUnknown>, z.ZodPromise<z.ZodAny>>;
1389
+ set: z.ZodFunction<z.ZodTuple<[z.ZodString, z.ZodAny], z.ZodUnknown>, z.ZodPromise<z.ZodVoid>>;
1390
+ delete: z.ZodFunction<z.ZodTuple<[z.ZodString], z.ZodUnknown>, z.ZodPromise<z.ZodVoid>>;
1391
+ }, "strip", z.ZodTypeAny, {
1392
+ set: (args_0: string, args_1: any, ...args: unknown[]) => Promise<void>;
1393
+ get: (args_0: string, ...args: unknown[]) => Promise<any>;
1394
+ delete: (args_0: string, ...args: unknown[]) => Promise<void>;
1395
+ }, {
1396
+ set: (args_0: string, args_1: any, ...args: unknown[]) => Promise<void>;
1397
+ get: (args_0: string, ...args: unknown[]) => Promise<any>;
1398
+ delete: (args_0: string, ...args: unknown[]) => Promise<void>;
1399
+ }>;
1400
+ /**
1401
+ * I18n Helper.
1402
+ *
1403
+ * @example
1404
+ * const msg = context.i18n.t('error.invalid_input');
1405
+ */
1406
+ i18n: z.ZodObject<{
1407
+ t: z.ZodFunction<z.ZodTuple<[z.ZodString, z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>], z.ZodUnknown>, z.ZodString>;
1408
+ getLocale: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodString>;
1409
+ }, "strip", z.ZodTypeAny, {
1410
+ t: (args_0: string, args_1: Record<string, any> | undefined, ...args: unknown[]) => string;
1411
+ getLocale: (...args: unknown[]) => string;
1412
+ }, {
1413
+ t: (args_0: string, args_1: Record<string, any> | undefined, ...args: unknown[]) => string;
1414
+ getLocale: (...args: unknown[]) => string;
1415
+ }>;
1416
+ /**
1417
+ * Metadata registry.
1418
+ * Provides access to system metadata like object schemas, field definitions, etc.
1419
+ *
1420
+ * @example
1421
+ * const schema = await context.metadata.getObject('account');
1422
+ * const fields = await context.metadata.getFields('account');
1423
+ */
1424
+ metadata: z.ZodAny;
1425
+ /**
1426
+ * Event bus.
1427
+ * Provides pub/sub capabilities for system and custom events.
1428
+ *
1429
+ * @example
1430
+ * context.events.on('record.created', handler);
1431
+ * context.events.emit('custom.event', data);
1432
+ */
1433
+ events: z.ZodAny;
1434
+ /**
1435
+ * Application Runtime Capabilities.
1436
+ * Provides mechanisms to extend the running application (Routes, Jobs, etc).
1437
+ */
1438
+ app: z.ZodObject<{
1439
+ router: z.ZodObject<{
1440
+ get: z.ZodFunction<z.ZodTuple<[z.ZodString, z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>], z.ZodUnknown>, z.ZodUnknown>;
1441
+ post: z.ZodFunction<z.ZodTuple<[z.ZodString, z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>], z.ZodUnknown>, z.ZodUnknown>;
1442
+ use: z.ZodFunction<z.ZodTuple<[z.ZodOptional<z.ZodString>, z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>], z.ZodUnknown>, z.ZodUnknown>;
1443
+ }, "strip", z.ZodTypeAny, {
1444
+ get: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
1445
+ post: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
1446
+ use: (args_0: string | undefined, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
1447
+ }, {
1448
+ get: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
1449
+ post: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
1450
+ use: (args_0: string | undefined, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
1451
+ }>;
1452
+ scheduler: z.ZodOptional<z.ZodObject<{
1453
+ schedule: z.ZodFunction<z.ZodTuple<[z.ZodString, z.ZodString, z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>], z.ZodUnknown>, z.ZodUnknown>;
1454
+ }, "strip", z.ZodTypeAny, {
1455
+ schedule: (args_0: string, args_1: string, args_2: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
1456
+ }, {
1457
+ schedule: (args_0: string, args_1: string, args_2: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
1458
+ }>>;
1459
+ }, "strip", z.ZodTypeAny, {
1460
+ router: {
1461
+ get: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
1462
+ post: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
1463
+ use: (args_0: string | undefined, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
1464
+ };
1465
+ scheduler?: {
1466
+ schedule: (args_0: string, args_1: string, args_2: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
1467
+ } | undefined;
1468
+ }, {
1469
+ router: {
1470
+ get: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
1471
+ post: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
1472
+ use: (args_0: string | undefined, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
1473
+ };
1474
+ scheduler?: {
1475
+ schedule: (args_0: string, args_1: string, args_2: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
1476
+ } | undefined;
1477
+ }>;
1478
+ }, "strip", z.ZodTypeAny, {
1479
+ ql: {
1480
+ object: (args_0: string, ...args: unknown[]) => any;
1481
+ query: (args_0: string, ...args: unknown[]) => Promise<any>;
1482
+ };
1483
+ logger: {
1484
+ error?: any;
1485
+ info?: any;
1486
+ debug?: any;
1487
+ warn?: any;
1488
+ };
1489
+ app: {
1490
+ router: {
1491
+ get: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
1492
+ post: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
1493
+ use: (args_0: string | undefined, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
1494
+ };
1495
+ scheduler?: {
1496
+ schedule: (args_0: string, args_1: string, args_2: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
1497
+ } | undefined;
1498
+ };
1499
+ storage: {
1500
+ set: (args_0: string, args_1: any, ...args: unknown[]) => Promise<void>;
1501
+ get: (args_0: string, ...args: unknown[]) => Promise<any>;
1502
+ delete: (args_0: string, ...args: unknown[]) => Promise<void>;
1503
+ };
1504
+ os: {
1505
+ getCurrentUser: (...args: unknown[]) => Promise<any>;
1506
+ getConfig: (args_0: string, ...args: unknown[]) => Promise<any>;
1507
+ };
1508
+ i18n: {
1509
+ t: (args_0: string, args_1: Record<string, any> | undefined, ...args: unknown[]) => string;
1510
+ getLocale: (...args: unknown[]) => string;
1511
+ };
1512
+ events?: any;
1513
+ metadata?: any;
1514
+ }, {
1515
+ ql: {
1516
+ object: (args_0: string, ...args: unknown[]) => any;
1517
+ query: (args_0: string, ...args: unknown[]) => Promise<any>;
1518
+ };
1519
+ logger: {
1520
+ error?: any;
1521
+ info?: any;
1522
+ debug?: any;
1523
+ warn?: any;
1524
+ };
1525
+ app: {
1526
+ router: {
1527
+ get: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
1528
+ post: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
1529
+ use: (args_0: string | undefined, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
1530
+ };
1531
+ scheduler?: {
1532
+ schedule: (args_0: string, args_1: string, args_2: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
1533
+ } | undefined;
1534
+ };
1535
+ storage: {
1536
+ set: (args_0: string, args_1: any, ...args: unknown[]) => Promise<void>;
1537
+ get: (args_0: string, ...args: unknown[]) => Promise<any>;
1538
+ delete: (args_0: string, ...args: unknown[]) => Promise<void>;
1539
+ };
1540
+ os: {
1541
+ getCurrentUser: (...args: unknown[]) => Promise<any>;
1542
+ getConfig: (args_0: string, ...args: unknown[]) => Promise<any>;
1543
+ };
1544
+ i18n: {
1545
+ t: (args_0: string, args_1: Record<string, any> | undefined, ...args: unknown[]) => string;
1546
+ getLocale: (...args: unknown[]) => string;
1547
+ };
1548
+ events?: any;
1549
+ metadata?: any;
1550
+ }>, z.ZodString, z.ZodString], z.ZodUnknown>, z.ZodPromise<z.ZodVoid>>>;
1551
+ }, "strip", z.ZodTypeAny, {
1552
+ onInstall?: ((args_0: {
1553
+ ql: {
1554
+ object: (args_0: string, ...args: unknown[]) => any;
1555
+ query: (args_0: string, ...args: unknown[]) => Promise<any>;
1556
+ };
1557
+ logger: {
1558
+ error?: any;
1559
+ info?: any;
1560
+ debug?: any;
1561
+ warn?: any;
1562
+ };
1563
+ app: {
1564
+ router: {
1565
+ get: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
1566
+ post: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
1567
+ use: (args_0: string | undefined, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
1568
+ };
1569
+ scheduler?: {
1570
+ schedule: (args_0: string, args_1: string, args_2: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
1571
+ } | undefined;
1572
+ };
1573
+ storage: {
1574
+ set: (args_0: string, args_1: any, ...args: unknown[]) => Promise<void>;
1575
+ get: (args_0: string, ...args: unknown[]) => Promise<any>;
1576
+ delete: (args_0: string, ...args: unknown[]) => Promise<void>;
1577
+ };
1578
+ os: {
1579
+ getCurrentUser: (...args: unknown[]) => Promise<any>;
1580
+ getConfig: (args_0: string, ...args: unknown[]) => Promise<any>;
1581
+ };
1582
+ i18n: {
1583
+ t: (args_0: string, args_1: Record<string, any> | undefined, ...args: unknown[]) => string;
1584
+ getLocale: (...args: unknown[]) => string;
1585
+ };
1586
+ events?: any;
1587
+ metadata?: any;
1588
+ }, ...args: unknown[]) => Promise<void>) | undefined;
1589
+ onEnable?: ((args_0: {
1590
+ ql: {
1591
+ object: (args_0: string, ...args: unknown[]) => any;
1592
+ query: (args_0: string, ...args: unknown[]) => Promise<any>;
1593
+ };
1594
+ logger: {
1595
+ error?: any;
1596
+ info?: any;
1597
+ debug?: any;
1598
+ warn?: any;
1599
+ };
1600
+ app: {
1601
+ router: {
1602
+ get: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
1603
+ post: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
1604
+ use: (args_0: string | undefined, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
1605
+ };
1606
+ scheduler?: {
1607
+ schedule: (args_0: string, args_1: string, args_2: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
1608
+ } | undefined;
1609
+ };
1610
+ storage: {
1611
+ set: (args_0: string, args_1: any, ...args: unknown[]) => Promise<void>;
1612
+ get: (args_0: string, ...args: unknown[]) => Promise<any>;
1613
+ delete: (args_0: string, ...args: unknown[]) => Promise<void>;
1614
+ };
1615
+ os: {
1616
+ getCurrentUser: (...args: unknown[]) => Promise<any>;
1617
+ getConfig: (args_0: string, ...args: unknown[]) => Promise<any>;
1618
+ };
1619
+ i18n: {
1620
+ t: (args_0: string, args_1: Record<string, any> | undefined, ...args: unknown[]) => string;
1621
+ getLocale: (...args: unknown[]) => string;
1622
+ };
1623
+ events?: any;
1624
+ metadata?: any;
1625
+ }, ...args: unknown[]) => Promise<void>) | undefined;
1626
+ onDisable?: ((args_0: {
1627
+ ql: {
1628
+ object: (args_0: string, ...args: unknown[]) => any;
1629
+ query: (args_0: string, ...args: unknown[]) => Promise<any>;
1630
+ };
1631
+ logger: {
1632
+ error?: any;
1633
+ info?: any;
1634
+ debug?: any;
1635
+ warn?: any;
1636
+ };
1637
+ app: {
1638
+ router: {
1639
+ get: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
1640
+ post: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
1641
+ use: (args_0: string | undefined, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
1642
+ };
1643
+ scheduler?: {
1644
+ schedule: (args_0: string, args_1: string, args_2: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
1645
+ } | undefined;
1646
+ };
1647
+ storage: {
1648
+ set: (args_0: string, args_1: any, ...args: unknown[]) => Promise<void>;
1649
+ get: (args_0: string, ...args: unknown[]) => Promise<any>;
1650
+ delete: (args_0: string, ...args: unknown[]) => Promise<void>;
1651
+ };
1652
+ os: {
1653
+ getCurrentUser: (...args: unknown[]) => Promise<any>;
1654
+ getConfig: (args_0: string, ...args: unknown[]) => Promise<any>;
1655
+ };
1656
+ i18n: {
1657
+ t: (args_0: string, args_1: Record<string, any> | undefined, ...args: unknown[]) => string;
1658
+ getLocale: (...args: unknown[]) => string;
1659
+ };
1660
+ events?: any;
1661
+ metadata?: any;
1662
+ }, ...args: unknown[]) => Promise<void>) | undefined;
1663
+ onUninstall?: ((args_0: {
1664
+ ql: {
1665
+ object: (args_0: string, ...args: unknown[]) => any;
1666
+ query: (args_0: string, ...args: unknown[]) => Promise<any>;
1667
+ };
1668
+ logger: {
1669
+ error?: any;
1670
+ info?: any;
1671
+ debug?: any;
1672
+ warn?: any;
1673
+ };
1674
+ app: {
1675
+ router: {
1676
+ get: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
1677
+ post: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
1678
+ use: (args_0: string | undefined, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
1679
+ };
1680
+ scheduler?: {
1681
+ schedule: (args_0: string, args_1: string, args_2: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
1682
+ } | undefined;
1683
+ };
1684
+ storage: {
1685
+ set: (args_0: string, args_1: any, ...args: unknown[]) => Promise<void>;
1686
+ get: (args_0: string, ...args: unknown[]) => Promise<any>;
1687
+ delete: (args_0: string, ...args: unknown[]) => Promise<void>;
1688
+ };
1689
+ os: {
1690
+ getCurrentUser: (...args: unknown[]) => Promise<any>;
1691
+ getConfig: (args_0: string, ...args: unknown[]) => Promise<any>;
1692
+ };
1693
+ i18n: {
1694
+ t: (args_0: string, args_1: Record<string, any> | undefined, ...args: unknown[]) => string;
1695
+ getLocale: (...args: unknown[]) => string;
1696
+ };
1697
+ events?: any;
1698
+ metadata?: any;
1699
+ }, ...args: unknown[]) => Promise<void>) | undefined;
1700
+ onUpgrade?: ((args_0: {
1701
+ ql: {
1702
+ object: (args_0: string, ...args: unknown[]) => any;
1703
+ query: (args_0: string, ...args: unknown[]) => Promise<any>;
1704
+ };
1705
+ logger: {
1706
+ error?: any;
1707
+ info?: any;
1708
+ debug?: any;
1709
+ warn?: any;
1710
+ };
1711
+ app: {
1712
+ router: {
1713
+ get: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
1714
+ post: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
1715
+ use: (args_0: string | undefined, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
1716
+ };
1717
+ scheduler?: {
1718
+ schedule: (args_0: string, args_1: string, args_2: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
1719
+ } | undefined;
1720
+ };
1721
+ storage: {
1722
+ set: (args_0: string, args_1: any, ...args: unknown[]) => Promise<void>;
1723
+ get: (args_0: string, ...args: unknown[]) => Promise<any>;
1724
+ delete: (args_0: string, ...args: unknown[]) => Promise<void>;
1725
+ };
1726
+ os: {
1727
+ getCurrentUser: (...args: unknown[]) => Promise<any>;
1728
+ getConfig: (args_0: string, ...args: unknown[]) => Promise<any>;
1729
+ };
1730
+ i18n: {
1731
+ t: (args_0: string, args_1: Record<string, any> | undefined, ...args: unknown[]) => string;
1732
+ getLocale: (...args: unknown[]) => string;
1733
+ };
1734
+ events?: any;
1735
+ metadata?: any;
1736
+ }, args_1: string, args_2: string, ...args: unknown[]) => Promise<void>) | undefined;
1737
+ }, {
1738
+ onInstall?: ((args_0: {
1739
+ ql: {
1740
+ object: (args_0: string, ...args: unknown[]) => any;
1741
+ query: (args_0: string, ...args: unknown[]) => Promise<any>;
1742
+ };
1743
+ logger: {
1744
+ error?: any;
1745
+ info?: any;
1746
+ debug?: any;
1747
+ warn?: any;
1748
+ };
1749
+ app: {
1750
+ router: {
1751
+ get: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
1752
+ post: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
1753
+ use: (args_0: string | undefined, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
1754
+ };
1755
+ scheduler?: {
1756
+ schedule: (args_0: string, args_1: string, args_2: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
1757
+ } | undefined;
1758
+ };
1759
+ storage: {
1760
+ set: (args_0: string, args_1: any, ...args: unknown[]) => Promise<void>;
1761
+ get: (args_0: string, ...args: unknown[]) => Promise<any>;
1762
+ delete: (args_0: string, ...args: unknown[]) => Promise<void>;
1763
+ };
1764
+ os: {
1765
+ getCurrentUser: (...args: unknown[]) => Promise<any>;
1766
+ getConfig: (args_0: string, ...args: unknown[]) => Promise<any>;
1767
+ };
1768
+ i18n: {
1769
+ t: (args_0: string, args_1: Record<string, any> | undefined, ...args: unknown[]) => string;
1770
+ getLocale: (...args: unknown[]) => string;
1771
+ };
1772
+ events?: any;
1773
+ metadata?: any;
1774
+ }, ...args: unknown[]) => Promise<void>) | undefined;
1775
+ onEnable?: ((args_0: {
1776
+ ql: {
1777
+ object: (args_0: string, ...args: unknown[]) => any;
1778
+ query: (args_0: string, ...args: unknown[]) => Promise<any>;
1779
+ };
1780
+ logger: {
1781
+ error?: any;
1782
+ info?: any;
1783
+ debug?: any;
1784
+ warn?: any;
1785
+ };
1786
+ app: {
1787
+ router: {
1788
+ get: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
1789
+ post: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
1790
+ use: (args_0: string | undefined, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
1791
+ };
1792
+ scheduler?: {
1793
+ schedule: (args_0: string, args_1: string, args_2: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
1794
+ } | undefined;
1795
+ };
1796
+ storage: {
1797
+ set: (args_0: string, args_1: any, ...args: unknown[]) => Promise<void>;
1798
+ get: (args_0: string, ...args: unknown[]) => Promise<any>;
1799
+ delete: (args_0: string, ...args: unknown[]) => Promise<void>;
1800
+ };
1801
+ os: {
1802
+ getCurrentUser: (...args: unknown[]) => Promise<any>;
1803
+ getConfig: (args_0: string, ...args: unknown[]) => Promise<any>;
1804
+ };
1805
+ i18n: {
1806
+ t: (args_0: string, args_1: Record<string, any> | undefined, ...args: unknown[]) => string;
1807
+ getLocale: (...args: unknown[]) => string;
1808
+ };
1809
+ events?: any;
1810
+ metadata?: any;
1811
+ }, ...args: unknown[]) => Promise<void>) | undefined;
1812
+ onDisable?: ((args_0: {
1813
+ ql: {
1814
+ object: (args_0: string, ...args: unknown[]) => any;
1815
+ query: (args_0: string, ...args: unknown[]) => Promise<any>;
1816
+ };
1817
+ logger: {
1818
+ error?: any;
1819
+ info?: any;
1820
+ debug?: any;
1821
+ warn?: any;
1822
+ };
1823
+ app: {
1824
+ router: {
1825
+ get: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
1826
+ post: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
1827
+ use: (args_0: string | undefined, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
1828
+ };
1829
+ scheduler?: {
1830
+ schedule: (args_0: string, args_1: string, args_2: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
1831
+ } | undefined;
1832
+ };
1833
+ storage: {
1834
+ set: (args_0: string, args_1: any, ...args: unknown[]) => Promise<void>;
1835
+ get: (args_0: string, ...args: unknown[]) => Promise<any>;
1836
+ delete: (args_0: string, ...args: unknown[]) => Promise<void>;
1837
+ };
1838
+ os: {
1839
+ getCurrentUser: (...args: unknown[]) => Promise<any>;
1840
+ getConfig: (args_0: string, ...args: unknown[]) => Promise<any>;
1841
+ };
1842
+ i18n: {
1843
+ t: (args_0: string, args_1: Record<string, any> | undefined, ...args: unknown[]) => string;
1844
+ getLocale: (...args: unknown[]) => string;
1845
+ };
1846
+ events?: any;
1847
+ metadata?: any;
1848
+ }, ...args: unknown[]) => Promise<void>) | undefined;
1849
+ onUninstall?: ((args_0: {
1850
+ ql: {
1851
+ object: (args_0: string, ...args: unknown[]) => any;
1852
+ query: (args_0: string, ...args: unknown[]) => Promise<any>;
1853
+ };
1854
+ logger: {
1855
+ error?: any;
1856
+ info?: any;
1857
+ debug?: any;
1858
+ warn?: any;
1859
+ };
1860
+ app: {
1861
+ router: {
1862
+ get: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
1863
+ post: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
1864
+ use: (args_0: string | undefined, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
1865
+ };
1866
+ scheduler?: {
1867
+ schedule: (args_0: string, args_1: string, args_2: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
1868
+ } | undefined;
1869
+ };
1870
+ storage: {
1871
+ set: (args_0: string, args_1: any, ...args: unknown[]) => Promise<void>;
1872
+ get: (args_0: string, ...args: unknown[]) => Promise<any>;
1873
+ delete: (args_0: string, ...args: unknown[]) => Promise<void>;
1874
+ };
1875
+ os: {
1876
+ getCurrentUser: (...args: unknown[]) => Promise<any>;
1877
+ getConfig: (args_0: string, ...args: unknown[]) => Promise<any>;
1878
+ };
1879
+ i18n: {
1880
+ t: (args_0: string, args_1: Record<string, any> | undefined, ...args: unknown[]) => string;
1881
+ getLocale: (...args: unknown[]) => string;
1882
+ };
1883
+ events?: any;
1884
+ metadata?: any;
1885
+ }, ...args: unknown[]) => Promise<void>) | undefined;
1886
+ onUpgrade?: ((args_0: {
1887
+ ql: {
1888
+ object: (args_0: string, ...args: unknown[]) => any;
1889
+ query: (args_0: string, ...args: unknown[]) => Promise<any>;
1890
+ };
1891
+ logger: {
1892
+ error?: any;
1893
+ info?: any;
1894
+ debug?: any;
1895
+ warn?: any;
1896
+ };
1897
+ app: {
1898
+ router: {
1899
+ get: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
1900
+ post: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
1901
+ use: (args_0: string | undefined, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
1902
+ };
1903
+ scheduler?: {
1904
+ schedule: (args_0: string, args_1: string, args_2: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
1905
+ } | undefined;
1906
+ };
1907
+ storage: {
1908
+ set: (args_0: string, args_1: any, ...args: unknown[]) => Promise<void>;
1909
+ get: (args_0: string, ...args: unknown[]) => Promise<any>;
1910
+ delete: (args_0: string, ...args: unknown[]) => Promise<void>;
1911
+ };
1912
+ os: {
1913
+ getCurrentUser: (...args: unknown[]) => Promise<any>;
1914
+ getConfig: (args_0: string, ...args: unknown[]) => Promise<any>;
1915
+ };
1916
+ i18n: {
1917
+ t: (args_0: string, args_1: Record<string, any> | undefined, ...args: unknown[]) => string;
1918
+ getLocale: (...args: unknown[]) => string;
1919
+ };
1920
+ events?: any;
1921
+ metadata?: any;
1922
+ }, args_1: string, args_2: string, ...args: unknown[]) => Promise<void>) | undefined;
1923
+ }>;
1924
+ /**
1925
+ * Complete Plugin Definition Schema
1926
+ *
1927
+ * Combines lifecycle hooks with plugin metadata.
1928
+ */
1929
+ export declare const PluginSchema: z.ZodObject<{
1930
+ /**
1931
+ * Called when the plugin is first installed.
1932
+ * Use this to set up initial data, create database tables, or register resources.
1933
+ *
1934
+ * @param context - Plugin runtime context
1935
+ */
1936
+ onInstall: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodObject<{
1937
+ /**
1938
+ * ObjectQL data access API.
1939
+ * Provides methods to query and manipulate business objects.
1940
+ *
1941
+ * @example
1942
+ * await context.ql.object('account').find({ status: 'active' });
1943
+ * await context.ql.object('contact').create({ name: 'John Doe' });
1944
+ */
1945
+ ql: z.ZodObject<{
1946
+ object: z.ZodFunction<z.ZodTuple<[z.ZodString], z.ZodUnknown>, z.ZodAny>;
1947
+ query: z.ZodFunction<z.ZodTuple<[z.ZodString], z.ZodUnknown>, z.ZodPromise<z.ZodAny>>;
1948
+ }, "strip", z.ZodTypeAny, {
1949
+ object: (args_0: string, ...args: unknown[]) => any;
1950
+ query: (args_0: string, ...args: unknown[]) => Promise<any>;
1951
+ }, {
1952
+ object: (args_0: string, ...args: unknown[]) => any;
1953
+ query: (args_0: string, ...args: unknown[]) => Promise<any>;
1954
+ }>;
1955
+ /**
1956
+ * ObjectOS system API.
1957
+ * Provides access to system-level functionality and configuration.
1958
+ *
1959
+ * @example
1960
+ * const user = await context.os.getCurrentUser();
1961
+ * const config = await context.os.getConfig('plugin.settings');
1962
+ */
1963
+ os: z.ZodObject<{
1964
+ getCurrentUser: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodPromise<z.ZodAny>>;
1965
+ getConfig: z.ZodFunction<z.ZodTuple<[z.ZodString], z.ZodUnknown>, z.ZodPromise<z.ZodAny>>;
1966
+ }, "strip", z.ZodTypeAny, {
1967
+ getCurrentUser: (...args: unknown[]) => Promise<any>;
1968
+ getConfig: (args_0: string, ...args: unknown[]) => Promise<any>;
1969
+ }, {
1970
+ getCurrentUser: (...args: unknown[]) => Promise<any>;
1971
+ getConfig: (args_0: string, ...args: unknown[]) => Promise<any>;
1972
+ }>;
1973
+ /**
1974
+ * Logging interface.
1975
+ * Provides structured logging capabilities with different levels.
1976
+ *
1977
+ * @example
1978
+ * context.logger.info('Operation completed');
1979
+ * context.logger.error('Operation failed', { error });
1980
+ */
1981
+ logger: z.ZodObject<{
1982
+ debug: z.ZodAny;
1983
+ info: z.ZodAny;
1984
+ warn: z.ZodAny;
1985
+ error: z.ZodAny;
1986
+ }, "strip", z.ZodTypeAny, {
1987
+ error?: any;
1988
+ info?: any;
1989
+ debug?: any;
1990
+ warn?: any;
1991
+ }, {
1992
+ error?: any;
1993
+ info?: any;
1994
+ debug?: any;
1995
+ warn?: any;
1996
+ }>;
1997
+ /**
1998
+ * Scoped Storage.
1999
+ * Key-Value store isolated for this plugin.
2000
+ *
2001
+ * @example
2002
+ * await context.storage.set('last_sync', Date.now());
2003
+ */
2004
+ storage: z.ZodObject<{
2005
+ get: z.ZodFunction<z.ZodTuple<[z.ZodString], z.ZodUnknown>, z.ZodPromise<z.ZodAny>>;
2006
+ set: z.ZodFunction<z.ZodTuple<[z.ZodString, z.ZodAny], z.ZodUnknown>, z.ZodPromise<z.ZodVoid>>;
2007
+ delete: z.ZodFunction<z.ZodTuple<[z.ZodString], z.ZodUnknown>, z.ZodPromise<z.ZodVoid>>;
2008
+ }, "strip", z.ZodTypeAny, {
2009
+ set: (args_0: string, args_1: any, ...args: unknown[]) => Promise<void>;
2010
+ get: (args_0: string, ...args: unknown[]) => Promise<any>;
2011
+ delete: (args_0: string, ...args: unknown[]) => Promise<void>;
2012
+ }, {
2013
+ set: (args_0: string, args_1: any, ...args: unknown[]) => Promise<void>;
2014
+ get: (args_0: string, ...args: unknown[]) => Promise<any>;
2015
+ delete: (args_0: string, ...args: unknown[]) => Promise<void>;
2016
+ }>;
2017
+ /**
2018
+ * I18n Helper.
2019
+ *
2020
+ * @example
2021
+ * const msg = context.i18n.t('error.invalid_input');
2022
+ */
2023
+ i18n: z.ZodObject<{
2024
+ t: z.ZodFunction<z.ZodTuple<[z.ZodString, z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>], z.ZodUnknown>, z.ZodString>;
2025
+ getLocale: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodString>;
2026
+ }, "strip", z.ZodTypeAny, {
2027
+ t: (args_0: string, args_1: Record<string, any> | undefined, ...args: unknown[]) => string;
2028
+ getLocale: (...args: unknown[]) => string;
2029
+ }, {
2030
+ t: (args_0: string, args_1: Record<string, any> | undefined, ...args: unknown[]) => string;
2031
+ getLocale: (...args: unknown[]) => string;
2032
+ }>;
2033
+ /**
2034
+ * Metadata registry.
2035
+ * Provides access to system metadata like object schemas, field definitions, etc.
2036
+ *
2037
+ * @example
2038
+ * const schema = await context.metadata.getObject('account');
2039
+ * const fields = await context.metadata.getFields('account');
2040
+ */
2041
+ metadata: z.ZodAny;
2042
+ /**
2043
+ * Event bus.
2044
+ * Provides pub/sub capabilities for system and custom events.
2045
+ *
2046
+ * @example
2047
+ * context.events.on('record.created', handler);
2048
+ * context.events.emit('custom.event', data);
2049
+ */
2050
+ events: z.ZodAny;
2051
+ /**
2052
+ * Application Runtime Capabilities.
2053
+ * Provides mechanisms to extend the running application (Routes, Jobs, etc).
2054
+ */
2055
+ app: z.ZodObject<{
2056
+ router: z.ZodObject<{
2057
+ get: z.ZodFunction<z.ZodTuple<[z.ZodString, z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>], z.ZodUnknown>, z.ZodUnknown>;
2058
+ post: z.ZodFunction<z.ZodTuple<[z.ZodString, z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>], z.ZodUnknown>, z.ZodUnknown>;
2059
+ use: z.ZodFunction<z.ZodTuple<[z.ZodOptional<z.ZodString>, z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>], z.ZodUnknown>, z.ZodUnknown>;
2060
+ }, "strip", z.ZodTypeAny, {
2061
+ get: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
2062
+ post: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
2063
+ use: (args_0: string | undefined, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
2064
+ }, {
2065
+ get: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
2066
+ post: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
2067
+ use: (args_0: string | undefined, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
2068
+ }>;
2069
+ scheduler: z.ZodOptional<z.ZodObject<{
2070
+ schedule: z.ZodFunction<z.ZodTuple<[z.ZodString, z.ZodString, z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>], z.ZodUnknown>, z.ZodUnknown>;
2071
+ }, "strip", z.ZodTypeAny, {
2072
+ schedule: (args_0: string, args_1: string, args_2: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
2073
+ }, {
2074
+ schedule: (args_0: string, args_1: string, args_2: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
2075
+ }>>;
2076
+ }, "strip", z.ZodTypeAny, {
2077
+ router: {
2078
+ get: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
2079
+ post: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
2080
+ use: (args_0: string | undefined, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
2081
+ };
2082
+ scheduler?: {
2083
+ schedule: (args_0: string, args_1: string, args_2: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
2084
+ } | undefined;
2085
+ }, {
2086
+ router: {
2087
+ get: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
2088
+ post: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
2089
+ use: (args_0: string | undefined, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
2090
+ };
2091
+ scheduler?: {
2092
+ schedule: (args_0: string, args_1: string, args_2: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
2093
+ } | undefined;
2094
+ }>;
2095
+ }, "strip", z.ZodTypeAny, {
2096
+ ql: {
2097
+ object: (args_0: string, ...args: unknown[]) => any;
2098
+ query: (args_0: string, ...args: unknown[]) => Promise<any>;
2099
+ };
2100
+ logger: {
2101
+ error?: any;
2102
+ info?: any;
2103
+ debug?: any;
2104
+ warn?: any;
2105
+ };
2106
+ app: {
2107
+ router: {
2108
+ get: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
2109
+ post: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
2110
+ use: (args_0: string | undefined, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
2111
+ };
2112
+ scheduler?: {
2113
+ schedule: (args_0: string, args_1: string, args_2: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
2114
+ } | undefined;
2115
+ };
2116
+ storage: {
2117
+ set: (args_0: string, args_1: any, ...args: unknown[]) => Promise<void>;
2118
+ get: (args_0: string, ...args: unknown[]) => Promise<any>;
2119
+ delete: (args_0: string, ...args: unknown[]) => Promise<void>;
2120
+ };
2121
+ os: {
2122
+ getCurrentUser: (...args: unknown[]) => Promise<any>;
2123
+ getConfig: (args_0: string, ...args: unknown[]) => Promise<any>;
2124
+ };
2125
+ i18n: {
2126
+ t: (args_0: string, args_1: Record<string, any> | undefined, ...args: unknown[]) => string;
2127
+ getLocale: (...args: unknown[]) => string;
2128
+ };
2129
+ events?: any;
2130
+ metadata?: any;
2131
+ }, {
2132
+ ql: {
2133
+ object: (args_0: string, ...args: unknown[]) => any;
2134
+ query: (args_0: string, ...args: unknown[]) => Promise<any>;
2135
+ };
2136
+ logger: {
2137
+ error?: any;
2138
+ info?: any;
2139
+ debug?: any;
2140
+ warn?: any;
2141
+ };
2142
+ app: {
2143
+ router: {
2144
+ get: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
2145
+ post: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
2146
+ use: (args_0: string | undefined, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
2147
+ };
2148
+ scheduler?: {
2149
+ schedule: (args_0: string, args_1: string, args_2: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
2150
+ } | undefined;
2151
+ };
2152
+ storage: {
2153
+ set: (args_0: string, args_1: any, ...args: unknown[]) => Promise<void>;
2154
+ get: (args_0: string, ...args: unknown[]) => Promise<any>;
2155
+ delete: (args_0: string, ...args: unknown[]) => Promise<void>;
2156
+ };
2157
+ os: {
2158
+ getCurrentUser: (...args: unknown[]) => Promise<any>;
2159
+ getConfig: (args_0: string, ...args: unknown[]) => Promise<any>;
2160
+ };
2161
+ i18n: {
2162
+ t: (args_0: string, args_1: Record<string, any> | undefined, ...args: unknown[]) => string;
2163
+ getLocale: (...args: unknown[]) => string;
2164
+ };
2165
+ events?: any;
2166
+ metadata?: any;
2167
+ }>], z.ZodUnknown>, z.ZodPromise<z.ZodVoid>>>;
2168
+ /**
2169
+ * Called when the plugin is enabled.
2170
+ * Use this to start services, register event handlers, or initialize runtime state.
2171
+ *
2172
+ * @param context - Plugin runtime context
2173
+ */
2174
+ onEnable: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodObject<{
2175
+ /**
2176
+ * ObjectQL data access API.
2177
+ * Provides methods to query and manipulate business objects.
2178
+ *
2179
+ * @example
2180
+ * await context.ql.object('account').find({ status: 'active' });
2181
+ * await context.ql.object('contact').create({ name: 'John Doe' });
2182
+ */
2183
+ ql: z.ZodObject<{
2184
+ object: z.ZodFunction<z.ZodTuple<[z.ZodString], z.ZodUnknown>, z.ZodAny>;
2185
+ query: z.ZodFunction<z.ZodTuple<[z.ZodString], z.ZodUnknown>, z.ZodPromise<z.ZodAny>>;
2186
+ }, "strip", z.ZodTypeAny, {
2187
+ object: (args_0: string, ...args: unknown[]) => any;
2188
+ query: (args_0: string, ...args: unknown[]) => Promise<any>;
2189
+ }, {
2190
+ object: (args_0: string, ...args: unknown[]) => any;
2191
+ query: (args_0: string, ...args: unknown[]) => Promise<any>;
2192
+ }>;
2193
+ /**
2194
+ * ObjectOS system API.
2195
+ * Provides access to system-level functionality and configuration.
2196
+ *
2197
+ * @example
2198
+ * const user = await context.os.getCurrentUser();
2199
+ * const config = await context.os.getConfig('plugin.settings');
2200
+ */
2201
+ os: z.ZodObject<{
2202
+ getCurrentUser: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodPromise<z.ZodAny>>;
2203
+ getConfig: z.ZodFunction<z.ZodTuple<[z.ZodString], z.ZodUnknown>, z.ZodPromise<z.ZodAny>>;
2204
+ }, "strip", z.ZodTypeAny, {
2205
+ getCurrentUser: (...args: unknown[]) => Promise<any>;
2206
+ getConfig: (args_0: string, ...args: unknown[]) => Promise<any>;
2207
+ }, {
2208
+ getCurrentUser: (...args: unknown[]) => Promise<any>;
2209
+ getConfig: (args_0: string, ...args: unknown[]) => Promise<any>;
2210
+ }>;
2211
+ /**
2212
+ * Logging interface.
2213
+ * Provides structured logging capabilities with different levels.
2214
+ *
2215
+ * @example
2216
+ * context.logger.info('Operation completed');
2217
+ * context.logger.error('Operation failed', { error });
2218
+ */
2219
+ logger: z.ZodObject<{
2220
+ debug: z.ZodAny;
2221
+ info: z.ZodAny;
2222
+ warn: z.ZodAny;
2223
+ error: z.ZodAny;
2224
+ }, "strip", z.ZodTypeAny, {
2225
+ error?: any;
2226
+ info?: any;
2227
+ debug?: any;
2228
+ warn?: any;
2229
+ }, {
2230
+ error?: any;
2231
+ info?: any;
2232
+ debug?: any;
2233
+ warn?: any;
2234
+ }>;
2235
+ /**
2236
+ * Scoped Storage.
2237
+ * Key-Value store isolated for this plugin.
2238
+ *
2239
+ * @example
2240
+ * await context.storage.set('last_sync', Date.now());
2241
+ */
2242
+ storage: z.ZodObject<{
2243
+ get: z.ZodFunction<z.ZodTuple<[z.ZodString], z.ZodUnknown>, z.ZodPromise<z.ZodAny>>;
2244
+ set: z.ZodFunction<z.ZodTuple<[z.ZodString, z.ZodAny], z.ZodUnknown>, z.ZodPromise<z.ZodVoid>>;
2245
+ delete: z.ZodFunction<z.ZodTuple<[z.ZodString], z.ZodUnknown>, z.ZodPromise<z.ZodVoid>>;
2246
+ }, "strip", z.ZodTypeAny, {
2247
+ set: (args_0: string, args_1: any, ...args: unknown[]) => Promise<void>;
2248
+ get: (args_0: string, ...args: unknown[]) => Promise<any>;
2249
+ delete: (args_0: string, ...args: unknown[]) => Promise<void>;
2250
+ }, {
2251
+ set: (args_0: string, args_1: any, ...args: unknown[]) => Promise<void>;
2252
+ get: (args_0: string, ...args: unknown[]) => Promise<any>;
2253
+ delete: (args_0: string, ...args: unknown[]) => Promise<void>;
2254
+ }>;
2255
+ /**
2256
+ * I18n Helper.
2257
+ *
2258
+ * @example
2259
+ * const msg = context.i18n.t('error.invalid_input');
2260
+ */
2261
+ i18n: z.ZodObject<{
2262
+ t: z.ZodFunction<z.ZodTuple<[z.ZodString, z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>], z.ZodUnknown>, z.ZodString>;
2263
+ getLocale: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodString>;
2264
+ }, "strip", z.ZodTypeAny, {
2265
+ t: (args_0: string, args_1: Record<string, any> | undefined, ...args: unknown[]) => string;
2266
+ getLocale: (...args: unknown[]) => string;
2267
+ }, {
2268
+ t: (args_0: string, args_1: Record<string, any> | undefined, ...args: unknown[]) => string;
2269
+ getLocale: (...args: unknown[]) => string;
2270
+ }>;
2271
+ /**
2272
+ * Metadata registry.
2273
+ * Provides access to system metadata like object schemas, field definitions, etc.
2274
+ *
2275
+ * @example
2276
+ * const schema = await context.metadata.getObject('account');
2277
+ * const fields = await context.metadata.getFields('account');
2278
+ */
2279
+ metadata: z.ZodAny;
2280
+ /**
2281
+ * Event bus.
2282
+ * Provides pub/sub capabilities for system and custom events.
2283
+ *
2284
+ * @example
2285
+ * context.events.on('record.created', handler);
2286
+ * context.events.emit('custom.event', data);
2287
+ */
2288
+ events: z.ZodAny;
2289
+ /**
2290
+ * Application Runtime Capabilities.
2291
+ * Provides mechanisms to extend the running application (Routes, Jobs, etc).
2292
+ */
2293
+ app: z.ZodObject<{
2294
+ router: z.ZodObject<{
2295
+ get: z.ZodFunction<z.ZodTuple<[z.ZodString, z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>], z.ZodUnknown>, z.ZodUnknown>;
2296
+ post: z.ZodFunction<z.ZodTuple<[z.ZodString, z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>], z.ZodUnknown>, z.ZodUnknown>;
2297
+ use: z.ZodFunction<z.ZodTuple<[z.ZodOptional<z.ZodString>, z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>], z.ZodUnknown>, z.ZodUnknown>;
2298
+ }, "strip", z.ZodTypeAny, {
2299
+ get: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
2300
+ post: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
2301
+ use: (args_0: string | undefined, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
2302
+ }, {
2303
+ get: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
2304
+ post: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
2305
+ use: (args_0: string | undefined, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
2306
+ }>;
2307
+ scheduler: z.ZodOptional<z.ZodObject<{
2308
+ schedule: z.ZodFunction<z.ZodTuple<[z.ZodString, z.ZodString, z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>], z.ZodUnknown>, z.ZodUnknown>;
2309
+ }, "strip", z.ZodTypeAny, {
2310
+ schedule: (args_0: string, args_1: string, args_2: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
2311
+ }, {
2312
+ schedule: (args_0: string, args_1: string, args_2: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
2313
+ }>>;
2314
+ }, "strip", z.ZodTypeAny, {
2315
+ router: {
2316
+ get: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
2317
+ post: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
2318
+ use: (args_0: string | undefined, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
2319
+ };
2320
+ scheduler?: {
2321
+ schedule: (args_0: string, args_1: string, args_2: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
2322
+ } | undefined;
2323
+ }, {
2324
+ router: {
2325
+ get: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
2326
+ post: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
2327
+ use: (args_0: string | undefined, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
2328
+ };
2329
+ scheduler?: {
2330
+ schedule: (args_0: string, args_1: string, args_2: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
2331
+ } | undefined;
2332
+ }>;
2333
+ }, "strip", z.ZodTypeAny, {
2334
+ ql: {
2335
+ object: (args_0: string, ...args: unknown[]) => any;
2336
+ query: (args_0: string, ...args: unknown[]) => Promise<any>;
2337
+ };
2338
+ logger: {
2339
+ error?: any;
2340
+ info?: any;
2341
+ debug?: any;
2342
+ warn?: any;
2343
+ };
2344
+ app: {
2345
+ router: {
2346
+ get: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
2347
+ post: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
2348
+ use: (args_0: string | undefined, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
2349
+ };
2350
+ scheduler?: {
2351
+ schedule: (args_0: string, args_1: string, args_2: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
2352
+ } | undefined;
2353
+ };
2354
+ storage: {
2355
+ set: (args_0: string, args_1: any, ...args: unknown[]) => Promise<void>;
2356
+ get: (args_0: string, ...args: unknown[]) => Promise<any>;
2357
+ delete: (args_0: string, ...args: unknown[]) => Promise<void>;
2358
+ };
2359
+ os: {
2360
+ getCurrentUser: (...args: unknown[]) => Promise<any>;
2361
+ getConfig: (args_0: string, ...args: unknown[]) => Promise<any>;
2362
+ };
2363
+ i18n: {
2364
+ t: (args_0: string, args_1: Record<string, any> | undefined, ...args: unknown[]) => string;
2365
+ getLocale: (...args: unknown[]) => string;
2366
+ };
2367
+ events?: any;
2368
+ metadata?: any;
2369
+ }, {
2370
+ ql: {
2371
+ object: (args_0: string, ...args: unknown[]) => any;
2372
+ query: (args_0: string, ...args: unknown[]) => Promise<any>;
2373
+ };
2374
+ logger: {
2375
+ error?: any;
2376
+ info?: any;
2377
+ debug?: any;
2378
+ warn?: any;
2379
+ };
2380
+ app: {
2381
+ router: {
2382
+ get: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
2383
+ post: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
2384
+ use: (args_0: string | undefined, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
2385
+ };
2386
+ scheduler?: {
2387
+ schedule: (args_0: string, args_1: string, args_2: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
2388
+ } | undefined;
2389
+ };
2390
+ storage: {
2391
+ set: (args_0: string, args_1: any, ...args: unknown[]) => Promise<void>;
2392
+ get: (args_0: string, ...args: unknown[]) => Promise<any>;
2393
+ delete: (args_0: string, ...args: unknown[]) => Promise<void>;
2394
+ };
2395
+ os: {
2396
+ getCurrentUser: (...args: unknown[]) => Promise<any>;
2397
+ getConfig: (args_0: string, ...args: unknown[]) => Promise<any>;
2398
+ };
2399
+ i18n: {
2400
+ t: (args_0: string, args_1: Record<string, any> | undefined, ...args: unknown[]) => string;
2401
+ getLocale: (...args: unknown[]) => string;
2402
+ };
2403
+ events?: any;
2404
+ metadata?: any;
2405
+ }>], z.ZodUnknown>, z.ZodPromise<z.ZodVoid>>>;
2406
+ /**
2407
+ * Called when the plugin is disabled.
2408
+ * Use this to stop services, unregister handlers, or clean up runtime state.
2409
+ *
2410
+ * @param context - Plugin runtime context
2411
+ */
2412
+ onDisable: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodObject<{
2413
+ /**
2414
+ * ObjectQL data access API.
2415
+ * Provides methods to query and manipulate business objects.
2416
+ *
2417
+ * @example
2418
+ * await context.ql.object('account').find({ status: 'active' });
2419
+ * await context.ql.object('contact').create({ name: 'John Doe' });
2420
+ */
2421
+ ql: z.ZodObject<{
2422
+ object: z.ZodFunction<z.ZodTuple<[z.ZodString], z.ZodUnknown>, z.ZodAny>;
2423
+ query: z.ZodFunction<z.ZodTuple<[z.ZodString], z.ZodUnknown>, z.ZodPromise<z.ZodAny>>;
2424
+ }, "strip", z.ZodTypeAny, {
2425
+ object: (args_0: string, ...args: unknown[]) => any;
2426
+ query: (args_0: string, ...args: unknown[]) => Promise<any>;
2427
+ }, {
2428
+ object: (args_0: string, ...args: unknown[]) => any;
2429
+ query: (args_0: string, ...args: unknown[]) => Promise<any>;
2430
+ }>;
2431
+ /**
2432
+ * ObjectOS system API.
2433
+ * Provides access to system-level functionality and configuration.
2434
+ *
2435
+ * @example
2436
+ * const user = await context.os.getCurrentUser();
2437
+ * const config = await context.os.getConfig('plugin.settings');
2438
+ */
2439
+ os: z.ZodObject<{
2440
+ getCurrentUser: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodPromise<z.ZodAny>>;
2441
+ getConfig: z.ZodFunction<z.ZodTuple<[z.ZodString], z.ZodUnknown>, z.ZodPromise<z.ZodAny>>;
2442
+ }, "strip", z.ZodTypeAny, {
2443
+ getCurrentUser: (...args: unknown[]) => Promise<any>;
2444
+ getConfig: (args_0: string, ...args: unknown[]) => Promise<any>;
2445
+ }, {
2446
+ getCurrentUser: (...args: unknown[]) => Promise<any>;
2447
+ getConfig: (args_0: string, ...args: unknown[]) => Promise<any>;
2448
+ }>;
2449
+ /**
2450
+ * Logging interface.
2451
+ * Provides structured logging capabilities with different levels.
2452
+ *
2453
+ * @example
2454
+ * context.logger.info('Operation completed');
2455
+ * context.logger.error('Operation failed', { error });
2456
+ */
2457
+ logger: z.ZodObject<{
2458
+ debug: z.ZodAny;
2459
+ info: z.ZodAny;
2460
+ warn: z.ZodAny;
2461
+ error: z.ZodAny;
2462
+ }, "strip", z.ZodTypeAny, {
2463
+ error?: any;
2464
+ info?: any;
2465
+ debug?: any;
2466
+ warn?: any;
2467
+ }, {
2468
+ error?: any;
2469
+ info?: any;
2470
+ debug?: any;
2471
+ warn?: any;
2472
+ }>;
2473
+ /**
2474
+ * Scoped Storage.
2475
+ * Key-Value store isolated for this plugin.
2476
+ *
2477
+ * @example
2478
+ * await context.storage.set('last_sync', Date.now());
2479
+ */
2480
+ storage: z.ZodObject<{
2481
+ get: z.ZodFunction<z.ZodTuple<[z.ZodString], z.ZodUnknown>, z.ZodPromise<z.ZodAny>>;
2482
+ set: z.ZodFunction<z.ZodTuple<[z.ZodString, z.ZodAny], z.ZodUnknown>, z.ZodPromise<z.ZodVoid>>;
2483
+ delete: z.ZodFunction<z.ZodTuple<[z.ZodString], z.ZodUnknown>, z.ZodPromise<z.ZodVoid>>;
2484
+ }, "strip", z.ZodTypeAny, {
2485
+ set: (args_0: string, args_1: any, ...args: unknown[]) => Promise<void>;
2486
+ get: (args_0: string, ...args: unknown[]) => Promise<any>;
2487
+ delete: (args_0: string, ...args: unknown[]) => Promise<void>;
2488
+ }, {
2489
+ set: (args_0: string, args_1: any, ...args: unknown[]) => Promise<void>;
2490
+ get: (args_0: string, ...args: unknown[]) => Promise<any>;
2491
+ delete: (args_0: string, ...args: unknown[]) => Promise<void>;
2492
+ }>;
2493
+ /**
2494
+ * I18n Helper.
2495
+ *
2496
+ * @example
2497
+ * const msg = context.i18n.t('error.invalid_input');
2498
+ */
2499
+ i18n: z.ZodObject<{
2500
+ t: z.ZodFunction<z.ZodTuple<[z.ZodString, z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>], z.ZodUnknown>, z.ZodString>;
2501
+ getLocale: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodString>;
2502
+ }, "strip", z.ZodTypeAny, {
2503
+ t: (args_0: string, args_1: Record<string, any> | undefined, ...args: unknown[]) => string;
2504
+ getLocale: (...args: unknown[]) => string;
2505
+ }, {
2506
+ t: (args_0: string, args_1: Record<string, any> | undefined, ...args: unknown[]) => string;
2507
+ getLocale: (...args: unknown[]) => string;
2508
+ }>;
2509
+ /**
2510
+ * Metadata registry.
2511
+ * Provides access to system metadata like object schemas, field definitions, etc.
2512
+ *
2513
+ * @example
2514
+ * const schema = await context.metadata.getObject('account');
2515
+ * const fields = await context.metadata.getFields('account');
2516
+ */
2517
+ metadata: z.ZodAny;
2518
+ /**
2519
+ * Event bus.
2520
+ * Provides pub/sub capabilities for system and custom events.
2521
+ *
2522
+ * @example
2523
+ * context.events.on('record.created', handler);
2524
+ * context.events.emit('custom.event', data);
2525
+ */
2526
+ events: z.ZodAny;
2527
+ /**
2528
+ * Application Runtime Capabilities.
2529
+ * Provides mechanisms to extend the running application (Routes, Jobs, etc).
2530
+ */
2531
+ app: z.ZodObject<{
2532
+ router: z.ZodObject<{
2533
+ get: z.ZodFunction<z.ZodTuple<[z.ZodString, z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>], z.ZodUnknown>, z.ZodUnknown>;
2534
+ post: z.ZodFunction<z.ZodTuple<[z.ZodString, z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>], z.ZodUnknown>, z.ZodUnknown>;
2535
+ use: z.ZodFunction<z.ZodTuple<[z.ZodOptional<z.ZodString>, z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>], z.ZodUnknown>, z.ZodUnknown>;
2536
+ }, "strip", z.ZodTypeAny, {
2537
+ get: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
2538
+ post: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
2539
+ use: (args_0: string | undefined, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
2540
+ }, {
2541
+ get: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
2542
+ post: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
2543
+ use: (args_0: string | undefined, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
2544
+ }>;
2545
+ scheduler: z.ZodOptional<z.ZodObject<{
2546
+ schedule: z.ZodFunction<z.ZodTuple<[z.ZodString, z.ZodString, z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>], z.ZodUnknown>, z.ZodUnknown>;
2547
+ }, "strip", z.ZodTypeAny, {
2548
+ schedule: (args_0: string, args_1: string, args_2: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
2549
+ }, {
2550
+ schedule: (args_0: string, args_1: string, args_2: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
2551
+ }>>;
2552
+ }, "strip", z.ZodTypeAny, {
2553
+ router: {
2554
+ get: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
2555
+ post: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
2556
+ use: (args_0: string | undefined, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
2557
+ };
2558
+ scheduler?: {
2559
+ schedule: (args_0: string, args_1: string, args_2: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
2560
+ } | undefined;
2561
+ }, {
2562
+ router: {
2563
+ get: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
2564
+ post: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
2565
+ use: (args_0: string | undefined, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
2566
+ };
2567
+ scheduler?: {
2568
+ schedule: (args_0: string, args_1: string, args_2: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
2569
+ } | undefined;
2570
+ }>;
2571
+ }, "strip", z.ZodTypeAny, {
2572
+ ql: {
2573
+ object: (args_0: string, ...args: unknown[]) => any;
2574
+ query: (args_0: string, ...args: unknown[]) => Promise<any>;
2575
+ };
2576
+ logger: {
2577
+ error?: any;
2578
+ info?: any;
2579
+ debug?: any;
2580
+ warn?: any;
2581
+ };
2582
+ app: {
2583
+ router: {
2584
+ get: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
2585
+ post: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
2586
+ use: (args_0: string | undefined, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
2587
+ };
2588
+ scheduler?: {
2589
+ schedule: (args_0: string, args_1: string, args_2: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
2590
+ } | undefined;
2591
+ };
2592
+ storage: {
2593
+ set: (args_0: string, args_1: any, ...args: unknown[]) => Promise<void>;
2594
+ get: (args_0: string, ...args: unknown[]) => Promise<any>;
2595
+ delete: (args_0: string, ...args: unknown[]) => Promise<void>;
2596
+ };
2597
+ os: {
2598
+ getCurrentUser: (...args: unknown[]) => Promise<any>;
2599
+ getConfig: (args_0: string, ...args: unknown[]) => Promise<any>;
2600
+ };
2601
+ i18n: {
2602
+ t: (args_0: string, args_1: Record<string, any> | undefined, ...args: unknown[]) => string;
2603
+ getLocale: (...args: unknown[]) => string;
2604
+ };
2605
+ events?: any;
2606
+ metadata?: any;
2607
+ }, {
2608
+ ql: {
2609
+ object: (args_0: string, ...args: unknown[]) => any;
2610
+ query: (args_0: string, ...args: unknown[]) => Promise<any>;
2611
+ };
2612
+ logger: {
2613
+ error?: any;
2614
+ info?: any;
2615
+ debug?: any;
2616
+ warn?: any;
2617
+ };
2618
+ app: {
2619
+ router: {
2620
+ get: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
2621
+ post: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
2622
+ use: (args_0: string | undefined, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
2623
+ };
2624
+ scheduler?: {
2625
+ schedule: (args_0: string, args_1: string, args_2: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
2626
+ } | undefined;
2627
+ };
2628
+ storage: {
2629
+ set: (args_0: string, args_1: any, ...args: unknown[]) => Promise<void>;
2630
+ get: (args_0: string, ...args: unknown[]) => Promise<any>;
2631
+ delete: (args_0: string, ...args: unknown[]) => Promise<void>;
2632
+ };
2633
+ os: {
2634
+ getCurrentUser: (...args: unknown[]) => Promise<any>;
2635
+ getConfig: (args_0: string, ...args: unknown[]) => Promise<any>;
2636
+ };
2637
+ i18n: {
2638
+ t: (args_0: string, args_1: Record<string, any> | undefined, ...args: unknown[]) => string;
2639
+ getLocale: (...args: unknown[]) => string;
2640
+ };
2641
+ events?: any;
2642
+ metadata?: any;
2643
+ }>], z.ZodUnknown>, z.ZodPromise<z.ZodVoid>>>;
2644
+ /**
2645
+ * Called when the plugin is uninstalled.
2646
+ * Use this to clean up data, remove database tables, or unregister resources.
2647
+ *
2648
+ * @param context - Plugin runtime context
2649
+ */
2650
+ onUninstall: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodObject<{
2651
+ /**
2652
+ * ObjectQL data access API.
2653
+ * Provides methods to query and manipulate business objects.
2654
+ *
2655
+ * @example
2656
+ * await context.ql.object('account').find({ status: 'active' });
2657
+ * await context.ql.object('contact').create({ name: 'John Doe' });
2658
+ */
2659
+ ql: z.ZodObject<{
2660
+ object: z.ZodFunction<z.ZodTuple<[z.ZodString], z.ZodUnknown>, z.ZodAny>;
2661
+ query: z.ZodFunction<z.ZodTuple<[z.ZodString], z.ZodUnknown>, z.ZodPromise<z.ZodAny>>;
2662
+ }, "strip", z.ZodTypeAny, {
2663
+ object: (args_0: string, ...args: unknown[]) => any;
2664
+ query: (args_0: string, ...args: unknown[]) => Promise<any>;
2665
+ }, {
2666
+ object: (args_0: string, ...args: unknown[]) => any;
2667
+ query: (args_0: string, ...args: unknown[]) => Promise<any>;
2668
+ }>;
2669
+ /**
2670
+ * ObjectOS system API.
2671
+ * Provides access to system-level functionality and configuration.
2672
+ *
2673
+ * @example
2674
+ * const user = await context.os.getCurrentUser();
2675
+ * const config = await context.os.getConfig('plugin.settings');
2676
+ */
2677
+ os: z.ZodObject<{
2678
+ getCurrentUser: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodPromise<z.ZodAny>>;
2679
+ getConfig: z.ZodFunction<z.ZodTuple<[z.ZodString], z.ZodUnknown>, z.ZodPromise<z.ZodAny>>;
2680
+ }, "strip", z.ZodTypeAny, {
2681
+ getCurrentUser: (...args: unknown[]) => Promise<any>;
2682
+ getConfig: (args_0: string, ...args: unknown[]) => Promise<any>;
2683
+ }, {
2684
+ getCurrentUser: (...args: unknown[]) => Promise<any>;
2685
+ getConfig: (args_0: string, ...args: unknown[]) => Promise<any>;
2686
+ }>;
2687
+ /**
2688
+ * Logging interface.
2689
+ * Provides structured logging capabilities with different levels.
2690
+ *
2691
+ * @example
2692
+ * context.logger.info('Operation completed');
2693
+ * context.logger.error('Operation failed', { error });
2694
+ */
2695
+ logger: z.ZodObject<{
2696
+ debug: z.ZodAny;
2697
+ info: z.ZodAny;
2698
+ warn: z.ZodAny;
2699
+ error: z.ZodAny;
2700
+ }, "strip", z.ZodTypeAny, {
2701
+ error?: any;
2702
+ info?: any;
2703
+ debug?: any;
2704
+ warn?: any;
2705
+ }, {
2706
+ error?: any;
2707
+ info?: any;
2708
+ debug?: any;
2709
+ warn?: any;
2710
+ }>;
2711
+ /**
2712
+ * Scoped Storage.
2713
+ * Key-Value store isolated for this plugin.
2714
+ *
2715
+ * @example
2716
+ * await context.storage.set('last_sync', Date.now());
2717
+ */
2718
+ storage: z.ZodObject<{
2719
+ get: z.ZodFunction<z.ZodTuple<[z.ZodString], z.ZodUnknown>, z.ZodPromise<z.ZodAny>>;
2720
+ set: z.ZodFunction<z.ZodTuple<[z.ZodString, z.ZodAny], z.ZodUnknown>, z.ZodPromise<z.ZodVoid>>;
2721
+ delete: z.ZodFunction<z.ZodTuple<[z.ZodString], z.ZodUnknown>, z.ZodPromise<z.ZodVoid>>;
2722
+ }, "strip", z.ZodTypeAny, {
2723
+ set: (args_0: string, args_1: any, ...args: unknown[]) => Promise<void>;
2724
+ get: (args_0: string, ...args: unknown[]) => Promise<any>;
2725
+ delete: (args_0: string, ...args: unknown[]) => Promise<void>;
2726
+ }, {
2727
+ set: (args_0: string, args_1: any, ...args: unknown[]) => Promise<void>;
2728
+ get: (args_0: string, ...args: unknown[]) => Promise<any>;
2729
+ delete: (args_0: string, ...args: unknown[]) => Promise<void>;
2730
+ }>;
2731
+ /**
2732
+ * I18n Helper.
2733
+ *
2734
+ * @example
2735
+ * const msg = context.i18n.t('error.invalid_input');
2736
+ */
2737
+ i18n: z.ZodObject<{
2738
+ t: z.ZodFunction<z.ZodTuple<[z.ZodString, z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>], z.ZodUnknown>, z.ZodString>;
2739
+ getLocale: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodString>;
2740
+ }, "strip", z.ZodTypeAny, {
2741
+ t: (args_0: string, args_1: Record<string, any> | undefined, ...args: unknown[]) => string;
2742
+ getLocale: (...args: unknown[]) => string;
2743
+ }, {
2744
+ t: (args_0: string, args_1: Record<string, any> | undefined, ...args: unknown[]) => string;
2745
+ getLocale: (...args: unknown[]) => string;
2746
+ }>;
2747
+ /**
2748
+ * Metadata registry.
2749
+ * Provides access to system metadata like object schemas, field definitions, etc.
2750
+ *
2751
+ * @example
2752
+ * const schema = await context.metadata.getObject('account');
2753
+ * const fields = await context.metadata.getFields('account');
2754
+ */
2755
+ metadata: z.ZodAny;
2756
+ /**
2757
+ * Event bus.
2758
+ * Provides pub/sub capabilities for system and custom events.
2759
+ *
2760
+ * @example
2761
+ * context.events.on('record.created', handler);
2762
+ * context.events.emit('custom.event', data);
2763
+ */
2764
+ events: z.ZodAny;
2765
+ /**
2766
+ * Application Runtime Capabilities.
2767
+ * Provides mechanisms to extend the running application (Routes, Jobs, etc).
2768
+ */
2769
+ app: z.ZodObject<{
2770
+ router: z.ZodObject<{
2771
+ get: z.ZodFunction<z.ZodTuple<[z.ZodString, z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>], z.ZodUnknown>, z.ZodUnknown>;
2772
+ post: z.ZodFunction<z.ZodTuple<[z.ZodString, z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>], z.ZodUnknown>, z.ZodUnknown>;
2773
+ use: z.ZodFunction<z.ZodTuple<[z.ZodOptional<z.ZodString>, z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>], z.ZodUnknown>, z.ZodUnknown>;
2774
+ }, "strip", z.ZodTypeAny, {
2775
+ get: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
2776
+ post: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
2777
+ use: (args_0: string | undefined, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
2778
+ }, {
2779
+ get: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
2780
+ post: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
2781
+ use: (args_0: string | undefined, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
2782
+ }>;
2783
+ scheduler: z.ZodOptional<z.ZodObject<{
2784
+ schedule: z.ZodFunction<z.ZodTuple<[z.ZodString, z.ZodString, z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>], z.ZodUnknown>, z.ZodUnknown>;
2785
+ }, "strip", z.ZodTypeAny, {
2786
+ schedule: (args_0: string, args_1: string, args_2: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
2787
+ }, {
2788
+ schedule: (args_0: string, args_1: string, args_2: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
2789
+ }>>;
2790
+ }, "strip", z.ZodTypeAny, {
2791
+ router: {
2792
+ get: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
2793
+ post: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
2794
+ use: (args_0: string | undefined, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
2795
+ };
2796
+ scheduler?: {
2797
+ schedule: (args_0: string, args_1: string, args_2: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
2798
+ } | undefined;
2799
+ }, {
2800
+ router: {
2801
+ get: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
2802
+ post: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
2803
+ use: (args_0: string | undefined, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
2804
+ };
2805
+ scheduler?: {
2806
+ schedule: (args_0: string, args_1: string, args_2: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
2807
+ } | undefined;
2808
+ }>;
2809
+ }, "strip", z.ZodTypeAny, {
2810
+ ql: {
2811
+ object: (args_0: string, ...args: unknown[]) => any;
2812
+ query: (args_0: string, ...args: unknown[]) => Promise<any>;
2813
+ };
2814
+ logger: {
2815
+ error?: any;
2816
+ info?: any;
2817
+ debug?: any;
2818
+ warn?: any;
2819
+ };
2820
+ app: {
2821
+ router: {
2822
+ get: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
2823
+ post: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
2824
+ use: (args_0: string | undefined, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
2825
+ };
2826
+ scheduler?: {
2827
+ schedule: (args_0: string, args_1: string, args_2: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
2828
+ } | undefined;
2829
+ };
2830
+ storage: {
2831
+ set: (args_0: string, args_1: any, ...args: unknown[]) => Promise<void>;
2832
+ get: (args_0: string, ...args: unknown[]) => Promise<any>;
2833
+ delete: (args_0: string, ...args: unknown[]) => Promise<void>;
2834
+ };
2835
+ os: {
2836
+ getCurrentUser: (...args: unknown[]) => Promise<any>;
2837
+ getConfig: (args_0: string, ...args: unknown[]) => Promise<any>;
2838
+ };
2839
+ i18n: {
2840
+ t: (args_0: string, args_1: Record<string, any> | undefined, ...args: unknown[]) => string;
2841
+ getLocale: (...args: unknown[]) => string;
2842
+ };
2843
+ events?: any;
2844
+ metadata?: any;
2845
+ }, {
2846
+ ql: {
2847
+ object: (args_0: string, ...args: unknown[]) => any;
2848
+ query: (args_0: string, ...args: unknown[]) => Promise<any>;
2849
+ };
2850
+ logger: {
2851
+ error?: any;
2852
+ info?: any;
2853
+ debug?: any;
2854
+ warn?: any;
2855
+ };
2856
+ app: {
2857
+ router: {
2858
+ get: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
2859
+ post: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
2860
+ use: (args_0: string | undefined, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
2861
+ };
2862
+ scheduler?: {
2863
+ schedule: (args_0: string, args_1: string, args_2: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
2864
+ } | undefined;
2865
+ };
2866
+ storage: {
2867
+ set: (args_0: string, args_1: any, ...args: unknown[]) => Promise<void>;
2868
+ get: (args_0: string, ...args: unknown[]) => Promise<any>;
2869
+ delete: (args_0: string, ...args: unknown[]) => Promise<void>;
2870
+ };
2871
+ os: {
2872
+ getCurrentUser: (...args: unknown[]) => Promise<any>;
2873
+ getConfig: (args_0: string, ...args: unknown[]) => Promise<any>;
2874
+ };
2875
+ i18n: {
2876
+ t: (args_0: string, args_1: Record<string, any> | undefined, ...args: unknown[]) => string;
2877
+ getLocale: (...args: unknown[]) => string;
2878
+ };
2879
+ events?: any;
2880
+ metadata?: any;
2881
+ }>], z.ZodUnknown>, z.ZodPromise<z.ZodVoid>>>;
2882
+ /**
2883
+ * Called when the plugin is upgraded to a new version.
2884
+ * Use this to migrate data, update schemas, or handle breaking changes.
2885
+ *
2886
+ * @param context - Plugin runtime context
2887
+ * @param fromVersion - Previous version string
2888
+ * @param toVersion - New version string
2889
+ */
2890
+ onUpgrade: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodObject<{
2891
+ /**
2892
+ * ObjectQL data access API.
2893
+ * Provides methods to query and manipulate business objects.
2894
+ *
2895
+ * @example
2896
+ * await context.ql.object('account').find({ status: 'active' });
2897
+ * await context.ql.object('contact').create({ name: 'John Doe' });
2898
+ */
2899
+ ql: z.ZodObject<{
2900
+ object: z.ZodFunction<z.ZodTuple<[z.ZodString], z.ZodUnknown>, z.ZodAny>;
2901
+ query: z.ZodFunction<z.ZodTuple<[z.ZodString], z.ZodUnknown>, z.ZodPromise<z.ZodAny>>;
2902
+ }, "strip", z.ZodTypeAny, {
2903
+ object: (args_0: string, ...args: unknown[]) => any;
2904
+ query: (args_0: string, ...args: unknown[]) => Promise<any>;
2905
+ }, {
2906
+ object: (args_0: string, ...args: unknown[]) => any;
2907
+ query: (args_0: string, ...args: unknown[]) => Promise<any>;
2908
+ }>;
2909
+ /**
2910
+ * ObjectOS system API.
2911
+ * Provides access to system-level functionality and configuration.
2912
+ *
2913
+ * @example
2914
+ * const user = await context.os.getCurrentUser();
2915
+ * const config = await context.os.getConfig('plugin.settings');
2916
+ */
2917
+ os: z.ZodObject<{
2918
+ getCurrentUser: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodPromise<z.ZodAny>>;
2919
+ getConfig: z.ZodFunction<z.ZodTuple<[z.ZodString], z.ZodUnknown>, z.ZodPromise<z.ZodAny>>;
2920
+ }, "strip", z.ZodTypeAny, {
2921
+ getCurrentUser: (...args: unknown[]) => Promise<any>;
2922
+ getConfig: (args_0: string, ...args: unknown[]) => Promise<any>;
2923
+ }, {
2924
+ getCurrentUser: (...args: unknown[]) => Promise<any>;
2925
+ getConfig: (args_0: string, ...args: unknown[]) => Promise<any>;
2926
+ }>;
2927
+ /**
2928
+ * Logging interface.
2929
+ * Provides structured logging capabilities with different levels.
2930
+ *
2931
+ * @example
2932
+ * context.logger.info('Operation completed');
2933
+ * context.logger.error('Operation failed', { error });
2934
+ */
2935
+ logger: z.ZodObject<{
2936
+ debug: z.ZodAny;
2937
+ info: z.ZodAny;
2938
+ warn: z.ZodAny;
2939
+ error: z.ZodAny;
2940
+ }, "strip", z.ZodTypeAny, {
2941
+ error?: any;
2942
+ info?: any;
2943
+ debug?: any;
2944
+ warn?: any;
2945
+ }, {
2946
+ error?: any;
2947
+ info?: any;
2948
+ debug?: any;
2949
+ warn?: any;
2950
+ }>;
2951
+ /**
2952
+ * Scoped Storage.
2953
+ * Key-Value store isolated for this plugin.
2954
+ *
2955
+ * @example
2956
+ * await context.storage.set('last_sync', Date.now());
2957
+ */
2958
+ storage: z.ZodObject<{
2959
+ get: z.ZodFunction<z.ZodTuple<[z.ZodString], z.ZodUnknown>, z.ZodPromise<z.ZodAny>>;
2960
+ set: z.ZodFunction<z.ZodTuple<[z.ZodString, z.ZodAny], z.ZodUnknown>, z.ZodPromise<z.ZodVoid>>;
2961
+ delete: z.ZodFunction<z.ZodTuple<[z.ZodString], z.ZodUnknown>, z.ZodPromise<z.ZodVoid>>;
2962
+ }, "strip", z.ZodTypeAny, {
2963
+ set: (args_0: string, args_1: any, ...args: unknown[]) => Promise<void>;
2964
+ get: (args_0: string, ...args: unknown[]) => Promise<any>;
2965
+ delete: (args_0: string, ...args: unknown[]) => Promise<void>;
2966
+ }, {
2967
+ set: (args_0: string, args_1: any, ...args: unknown[]) => Promise<void>;
2968
+ get: (args_0: string, ...args: unknown[]) => Promise<any>;
2969
+ delete: (args_0: string, ...args: unknown[]) => Promise<void>;
2970
+ }>;
2971
+ /**
2972
+ * I18n Helper.
2973
+ *
2974
+ * @example
2975
+ * const msg = context.i18n.t('error.invalid_input');
2976
+ */
2977
+ i18n: z.ZodObject<{
2978
+ t: z.ZodFunction<z.ZodTuple<[z.ZodString, z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>], z.ZodUnknown>, z.ZodString>;
2979
+ getLocale: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodString>;
2980
+ }, "strip", z.ZodTypeAny, {
2981
+ t: (args_0: string, args_1: Record<string, any> | undefined, ...args: unknown[]) => string;
2982
+ getLocale: (...args: unknown[]) => string;
2983
+ }, {
2984
+ t: (args_0: string, args_1: Record<string, any> | undefined, ...args: unknown[]) => string;
2985
+ getLocale: (...args: unknown[]) => string;
2986
+ }>;
2987
+ /**
2988
+ * Metadata registry.
2989
+ * Provides access to system metadata like object schemas, field definitions, etc.
2990
+ *
2991
+ * @example
2992
+ * const schema = await context.metadata.getObject('account');
2993
+ * const fields = await context.metadata.getFields('account');
2994
+ */
2995
+ metadata: z.ZodAny;
2996
+ /**
2997
+ * Event bus.
2998
+ * Provides pub/sub capabilities for system and custom events.
2999
+ *
3000
+ * @example
3001
+ * context.events.on('record.created', handler);
3002
+ * context.events.emit('custom.event', data);
3003
+ */
3004
+ events: z.ZodAny;
3005
+ /**
3006
+ * Application Runtime Capabilities.
3007
+ * Provides mechanisms to extend the running application (Routes, Jobs, etc).
3008
+ */
3009
+ app: z.ZodObject<{
3010
+ router: z.ZodObject<{
3011
+ get: z.ZodFunction<z.ZodTuple<[z.ZodString, z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>], z.ZodUnknown>, z.ZodUnknown>;
3012
+ post: z.ZodFunction<z.ZodTuple<[z.ZodString, z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>], z.ZodUnknown>, z.ZodUnknown>;
3013
+ use: z.ZodFunction<z.ZodTuple<[z.ZodOptional<z.ZodString>, z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>], z.ZodUnknown>, z.ZodUnknown>;
3014
+ }, "strip", z.ZodTypeAny, {
3015
+ get: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
3016
+ post: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
3017
+ use: (args_0: string | undefined, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
3018
+ }, {
3019
+ get: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
3020
+ post: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
3021
+ use: (args_0: string | undefined, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
3022
+ }>;
3023
+ scheduler: z.ZodOptional<z.ZodObject<{
3024
+ schedule: z.ZodFunction<z.ZodTuple<[z.ZodString, z.ZodString, z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>], z.ZodUnknown>, z.ZodUnknown>;
3025
+ }, "strip", z.ZodTypeAny, {
3026
+ schedule: (args_0: string, args_1: string, args_2: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
3027
+ }, {
3028
+ schedule: (args_0: string, args_1: string, args_2: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
3029
+ }>>;
3030
+ }, "strip", z.ZodTypeAny, {
3031
+ router: {
3032
+ get: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
3033
+ post: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
3034
+ use: (args_0: string | undefined, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
3035
+ };
3036
+ scheduler?: {
3037
+ schedule: (args_0: string, args_1: string, args_2: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
3038
+ } | undefined;
3039
+ }, {
3040
+ router: {
3041
+ get: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
3042
+ post: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
3043
+ use: (args_0: string | undefined, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
3044
+ };
3045
+ scheduler?: {
3046
+ schedule: (args_0: string, args_1: string, args_2: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
3047
+ } | undefined;
3048
+ }>;
3049
+ }, "strip", z.ZodTypeAny, {
3050
+ ql: {
3051
+ object: (args_0: string, ...args: unknown[]) => any;
3052
+ query: (args_0: string, ...args: unknown[]) => Promise<any>;
3053
+ };
3054
+ logger: {
3055
+ error?: any;
3056
+ info?: any;
3057
+ debug?: any;
3058
+ warn?: any;
3059
+ };
3060
+ app: {
3061
+ router: {
3062
+ get: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
3063
+ post: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
3064
+ use: (args_0: string | undefined, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
3065
+ };
3066
+ scheduler?: {
3067
+ schedule: (args_0: string, args_1: string, args_2: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
3068
+ } | undefined;
3069
+ };
3070
+ storage: {
3071
+ set: (args_0: string, args_1: any, ...args: unknown[]) => Promise<void>;
3072
+ get: (args_0: string, ...args: unknown[]) => Promise<any>;
3073
+ delete: (args_0: string, ...args: unknown[]) => Promise<void>;
3074
+ };
3075
+ os: {
3076
+ getCurrentUser: (...args: unknown[]) => Promise<any>;
3077
+ getConfig: (args_0: string, ...args: unknown[]) => Promise<any>;
3078
+ };
3079
+ i18n: {
3080
+ t: (args_0: string, args_1: Record<string, any> | undefined, ...args: unknown[]) => string;
3081
+ getLocale: (...args: unknown[]) => string;
3082
+ };
3083
+ events?: any;
3084
+ metadata?: any;
3085
+ }, {
3086
+ ql: {
3087
+ object: (args_0: string, ...args: unknown[]) => any;
3088
+ query: (args_0: string, ...args: unknown[]) => Promise<any>;
3089
+ };
3090
+ logger: {
3091
+ error?: any;
3092
+ info?: any;
3093
+ debug?: any;
3094
+ warn?: any;
3095
+ };
3096
+ app: {
3097
+ router: {
3098
+ get: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
3099
+ post: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
3100
+ use: (args_0: string | undefined, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
3101
+ };
3102
+ scheduler?: {
3103
+ schedule: (args_0: string, args_1: string, args_2: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
3104
+ } | undefined;
3105
+ };
3106
+ storage: {
3107
+ set: (args_0: string, args_1: any, ...args: unknown[]) => Promise<void>;
3108
+ get: (args_0: string, ...args: unknown[]) => Promise<any>;
3109
+ delete: (args_0: string, ...args: unknown[]) => Promise<void>;
3110
+ };
3111
+ os: {
3112
+ getCurrentUser: (...args: unknown[]) => Promise<any>;
3113
+ getConfig: (args_0: string, ...args: unknown[]) => Promise<any>;
3114
+ };
3115
+ i18n: {
3116
+ t: (args_0: string, args_1: Record<string, any> | undefined, ...args: unknown[]) => string;
3117
+ getLocale: (...args: unknown[]) => string;
3118
+ };
3119
+ events?: any;
3120
+ metadata?: any;
3121
+ }>, z.ZodString, z.ZodString], z.ZodUnknown>, z.ZodPromise<z.ZodVoid>>>;
3122
+ } & {
3123
+ /**
3124
+ * Plugin metadata identifier.
3125
+ * Should match the id in the manifest.
3126
+ */
3127
+ id: z.ZodOptional<z.ZodString>;
3128
+ /**
3129
+ * Plugin version.
3130
+ * Should match the version in the manifest.
3131
+ */
3132
+ version: z.ZodOptional<z.ZodString>;
3133
+ }, "strip", z.ZodTypeAny, {
3134
+ id?: string | undefined;
3135
+ version?: string | undefined;
3136
+ onInstall?: ((args_0: {
3137
+ ql: {
3138
+ object: (args_0: string, ...args: unknown[]) => any;
3139
+ query: (args_0: string, ...args: unknown[]) => Promise<any>;
3140
+ };
3141
+ logger: {
3142
+ error?: any;
3143
+ info?: any;
3144
+ debug?: any;
3145
+ warn?: any;
3146
+ };
3147
+ app: {
3148
+ router: {
3149
+ get: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
3150
+ post: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
3151
+ use: (args_0: string | undefined, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
3152
+ };
3153
+ scheduler?: {
3154
+ schedule: (args_0: string, args_1: string, args_2: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
3155
+ } | undefined;
3156
+ };
3157
+ storage: {
3158
+ set: (args_0: string, args_1: any, ...args: unknown[]) => Promise<void>;
3159
+ get: (args_0: string, ...args: unknown[]) => Promise<any>;
3160
+ delete: (args_0: string, ...args: unknown[]) => Promise<void>;
3161
+ };
3162
+ os: {
3163
+ getCurrentUser: (...args: unknown[]) => Promise<any>;
3164
+ getConfig: (args_0: string, ...args: unknown[]) => Promise<any>;
3165
+ };
3166
+ i18n: {
3167
+ t: (args_0: string, args_1: Record<string, any> | undefined, ...args: unknown[]) => string;
3168
+ getLocale: (...args: unknown[]) => string;
3169
+ };
3170
+ events?: any;
3171
+ metadata?: any;
3172
+ }, ...args: unknown[]) => Promise<void>) | undefined;
3173
+ onEnable?: ((args_0: {
3174
+ ql: {
3175
+ object: (args_0: string, ...args: unknown[]) => any;
3176
+ query: (args_0: string, ...args: unknown[]) => Promise<any>;
3177
+ };
3178
+ logger: {
3179
+ error?: any;
3180
+ info?: any;
3181
+ debug?: any;
3182
+ warn?: any;
3183
+ };
3184
+ app: {
3185
+ router: {
3186
+ get: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
3187
+ post: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
3188
+ use: (args_0: string | undefined, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
3189
+ };
3190
+ scheduler?: {
3191
+ schedule: (args_0: string, args_1: string, args_2: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
3192
+ } | undefined;
3193
+ };
3194
+ storage: {
3195
+ set: (args_0: string, args_1: any, ...args: unknown[]) => Promise<void>;
3196
+ get: (args_0: string, ...args: unknown[]) => Promise<any>;
3197
+ delete: (args_0: string, ...args: unknown[]) => Promise<void>;
3198
+ };
3199
+ os: {
3200
+ getCurrentUser: (...args: unknown[]) => Promise<any>;
3201
+ getConfig: (args_0: string, ...args: unknown[]) => Promise<any>;
3202
+ };
3203
+ i18n: {
3204
+ t: (args_0: string, args_1: Record<string, any> | undefined, ...args: unknown[]) => string;
3205
+ getLocale: (...args: unknown[]) => string;
3206
+ };
3207
+ events?: any;
3208
+ metadata?: any;
3209
+ }, ...args: unknown[]) => Promise<void>) | undefined;
3210
+ onDisable?: ((args_0: {
3211
+ ql: {
3212
+ object: (args_0: string, ...args: unknown[]) => any;
3213
+ query: (args_0: string, ...args: unknown[]) => Promise<any>;
3214
+ };
3215
+ logger: {
3216
+ error?: any;
3217
+ info?: any;
3218
+ debug?: any;
3219
+ warn?: any;
3220
+ };
3221
+ app: {
3222
+ router: {
3223
+ get: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
3224
+ post: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
3225
+ use: (args_0: string | undefined, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
3226
+ };
3227
+ scheduler?: {
3228
+ schedule: (args_0: string, args_1: string, args_2: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
3229
+ } | undefined;
3230
+ };
3231
+ storage: {
3232
+ set: (args_0: string, args_1: any, ...args: unknown[]) => Promise<void>;
3233
+ get: (args_0: string, ...args: unknown[]) => Promise<any>;
3234
+ delete: (args_0: string, ...args: unknown[]) => Promise<void>;
3235
+ };
3236
+ os: {
3237
+ getCurrentUser: (...args: unknown[]) => Promise<any>;
3238
+ getConfig: (args_0: string, ...args: unknown[]) => Promise<any>;
3239
+ };
3240
+ i18n: {
3241
+ t: (args_0: string, args_1: Record<string, any> | undefined, ...args: unknown[]) => string;
3242
+ getLocale: (...args: unknown[]) => string;
3243
+ };
3244
+ events?: any;
3245
+ metadata?: any;
3246
+ }, ...args: unknown[]) => Promise<void>) | undefined;
3247
+ onUninstall?: ((args_0: {
3248
+ ql: {
3249
+ object: (args_0: string, ...args: unknown[]) => any;
3250
+ query: (args_0: string, ...args: unknown[]) => Promise<any>;
3251
+ };
3252
+ logger: {
3253
+ error?: any;
3254
+ info?: any;
3255
+ debug?: any;
3256
+ warn?: any;
3257
+ };
3258
+ app: {
3259
+ router: {
3260
+ get: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
3261
+ post: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
3262
+ use: (args_0: string | undefined, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
3263
+ };
3264
+ scheduler?: {
3265
+ schedule: (args_0: string, args_1: string, args_2: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
3266
+ } | undefined;
3267
+ };
3268
+ storage: {
3269
+ set: (args_0: string, args_1: any, ...args: unknown[]) => Promise<void>;
3270
+ get: (args_0: string, ...args: unknown[]) => Promise<any>;
3271
+ delete: (args_0: string, ...args: unknown[]) => Promise<void>;
3272
+ };
3273
+ os: {
3274
+ getCurrentUser: (...args: unknown[]) => Promise<any>;
3275
+ getConfig: (args_0: string, ...args: unknown[]) => Promise<any>;
3276
+ };
3277
+ i18n: {
3278
+ t: (args_0: string, args_1: Record<string, any> | undefined, ...args: unknown[]) => string;
3279
+ getLocale: (...args: unknown[]) => string;
3280
+ };
3281
+ events?: any;
3282
+ metadata?: any;
3283
+ }, ...args: unknown[]) => Promise<void>) | undefined;
3284
+ onUpgrade?: ((args_0: {
3285
+ ql: {
3286
+ object: (args_0: string, ...args: unknown[]) => any;
3287
+ query: (args_0: string, ...args: unknown[]) => Promise<any>;
3288
+ };
3289
+ logger: {
3290
+ error?: any;
3291
+ info?: any;
3292
+ debug?: any;
3293
+ warn?: any;
3294
+ };
3295
+ app: {
3296
+ router: {
3297
+ get: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
3298
+ post: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
3299
+ use: (args_0: string | undefined, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
3300
+ };
3301
+ scheduler?: {
3302
+ schedule: (args_0: string, args_1: string, args_2: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
3303
+ } | undefined;
3304
+ };
3305
+ storage: {
3306
+ set: (args_0: string, args_1: any, ...args: unknown[]) => Promise<void>;
3307
+ get: (args_0: string, ...args: unknown[]) => Promise<any>;
3308
+ delete: (args_0: string, ...args: unknown[]) => Promise<void>;
3309
+ };
3310
+ os: {
3311
+ getCurrentUser: (...args: unknown[]) => Promise<any>;
3312
+ getConfig: (args_0: string, ...args: unknown[]) => Promise<any>;
3313
+ };
3314
+ i18n: {
3315
+ t: (args_0: string, args_1: Record<string, any> | undefined, ...args: unknown[]) => string;
3316
+ getLocale: (...args: unknown[]) => string;
3317
+ };
3318
+ events?: any;
3319
+ metadata?: any;
3320
+ }, args_1: string, args_2: string, ...args: unknown[]) => Promise<void>) | undefined;
3321
+ }, {
3322
+ id?: string | undefined;
3323
+ version?: string | undefined;
3324
+ onInstall?: ((args_0: {
3325
+ ql: {
3326
+ object: (args_0: string, ...args: unknown[]) => any;
3327
+ query: (args_0: string, ...args: unknown[]) => Promise<any>;
3328
+ };
3329
+ logger: {
3330
+ error?: any;
3331
+ info?: any;
3332
+ debug?: any;
3333
+ warn?: any;
3334
+ };
3335
+ app: {
3336
+ router: {
3337
+ get: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
3338
+ post: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
3339
+ use: (args_0: string | undefined, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
3340
+ };
3341
+ scheduler?: {
3342
+ schedule: (args_0: string, args_1: string, args_2: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
3343
+ } | undefined;
3344
+ };
3345
+ storage: {
3346
+ set: (args_0: string, args_1: any, ...args: unknown[]) => Promise<void>;
3347
+ get: (args_0: string, ...args: unknown[]) => Promise<any>;
3348
+ delete: (args_0: string, ...args: unknown[]) => Promise<void>;
3349
+ };
3350
+ os: {
3351
+ getCurrentUser: (...args: unknown[]) => Promise<any>;
3352
+ getConfig: (args_0: string, ...args: unknown[]) => Promise<any>;
3353
+ };
3354
+ i18n: {
3355
+ t: (args_0: string, args_1: Record<string, any> | undefined, ...args: unknown[]) => string;
3356
+ getLocale: (...args: unknown[]) => string;
3357
+ };
3358
+ events?: any;
3359
+ metadata?: any;
3360
+ }, ...args: unknown[]) => Promise<void>) | undefined;
3361
+ onEnable?: ((args_0: {
3362
+ ql: {
3363
+ object: (args_0: string, ...args: unknown[]) => any;
3364
+ query: (args_0: string, ...args: unknown[]) => Promise<any>;
3365
+ };
3366
+ logger: {
3367
+ error?: any;
3368
+ info?: any;
3369
+ debug?: any;
3370
+ warn?: any;
3371
+ };
3372
+ app: {
3373
+ router: {
3374
+ get: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
3375
+ post: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
3376
+ use: (args_0: string | undefined, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
3377
+ };
3378
+ scheduler?: {
3379
+ schedule: (args_0: string, args_1: string, args_2: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
3380
+ } | undefined;
3381
+ };
3382
+ storage: {
3383
+ set: (args_0: string, args_1: any, ...args: unknown[]) => Promise<void>;
3384
+ get: (args_0: string, ...args: unknown[]) => Promise<any>;
3385
+ delete: (args_0: string, ...args: unknown[]) => Promise<void>;
3386
+ };
3387
+ os: {
3388
+ getCurrentUser: (...args: unknown[]) => Promise<any>;
3389
+ getConfig: (args_0: string, ...args: unknown[]) => Promise<any>;
3390
+ };
3391
+ i18n: {
3392
+ t: (args_0: string, args_1: Record<string, any> | undefined, ...args: unknown[]) => string;
3393
+ getLocale: (...args: unknown[]) => string;
3394
+ };
3395
+ events?: any;
3396
+ metadata?: any;
3397
+ }, ...args: unknown[]) => Promise<void>) | undefined;
3398
+ onDisable?: ((args_0: {
3399
+ ql: {
3400
+ object: (args_0: string, ...args: unknown[]) => any;
3401
+ query: (args_0: string, ...args: unknown[]) => Promise<any>;
3402
+ };
3403
+ logger: {
3404
+ error?: any;
3405
+ info?: any;
3406
+ debug?: any;
3407
+ warn?: any;
3408
+ };
3409
+ app: {
3410
+ router: {
3411
+ get: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
3412
+ post: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
3413
+ use: (args_0: string | undefined, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
3414
+ };
3415
+ scheduler?: {
3416
+ schedule: (args_0: string, args_1: string, args_2: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
3417
+ } | undefined;
3418
+ };
3419
+ storage: {
3420
+ set: (args_0: string, args_1: any, ...args: unknown[]) => Promise<void>;
3421
+ get: (args_0: string, ...args: unknown[]) => Promise<any>;
3422
+ delete: (args_0: string, ...args: unknown[]) => Promise<void>;
3423
+ };
3424
+ os: {
3425
+ getCurrentUser: (...args: unknown[]) => Promise<any>;
3426
+ getConfig: (args_0: string, ...args: unknown[]) => Promise<any>;
3427
+ };
3428
+ i18n: {
3429
+ t: (args_0: string, args_1: Record<string, any> | undefined, ...args: unknown[]) => string;
3430
+ getLocale: (...args: unknown[]) => string;
3431
+ };
3432
+ events?: any;
3433
+ metadata?: any;
3434
+ }, ...args: unknown[]) => Promise<void>) | undefined;
3435
+ onUninstall?: ((args_0: {
3436
+ ql: {
3437
+ object: (args_0: string, ...args: unknown[]) => any;
3438
+ query: (args_0: string, ...args: unknown[]) => Promise<any>;
3439
+ };
3440
+ logger: {
3441
+ error?: any;
3442
+ info?: any;
3443
+ debug?: any;
3444
+ warn?: any;
3445
+ };
3446
+ app: {
3447
+ router: {
3448
+ get: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
3449
+ post: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
3450
+ use: (args_0: string | undefined, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
3451
+ };
3452
+ scheduler?: {
3453
+ schedule: (args_0: string, args_1: string, args_2: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
3454
+ } | undefined;
3455
+ };
3456
+ storage: {
3457
+ set: (args_0: string, args_1: any, ...args: unknown[]) => Promise<void>;
3458
+ get: (args_0: string, ...args: unknown[]) => Promise<any>;
3459
+ delete: (args_0: string, ...args: unknown[]) => Promise<void>;
3460
+ };
3461
+ os: {
3462
+ getCurrentUser: (...args: unknown[]) => Promise<any>;
3463
+ getConfig: (args_0: string, ...args: unknown[]) => Promise<any>;
3464
+ };
3465
+ i18n: {
3466
+ t: (args_0: string, args_1: Record<string, any> | undefined, ...args: unknown[]) => string;
3467
+ getLocale: (...args: unknown[]) => string;
3468
+ };
3469
+ events?: any;
3470
+ metadata?: any;
3471
+ }, ...args: unknown[]) => Promise<void>) | undefined;
3472
+ onUpgrade?: ((args_0: {
3473
+ ql: {
3474
+ object: (args_0: string, ...args: unknown[]) => any;
3475
+ query: (args_0: string, ...args: unknown[]) => Promise<any>;
3476
+ };
3477
+ logger: {
3478
+ error?: any;
3479
+ info?: any;
3480
+ debug?: any;
3481
+ warn?: any;
3482
+ };
3483
+ app: {
3484
+ router: {
3485
+ get: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
3486
+ post: (args_0: string, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
3487
+ use: (args_0: string | undefined, args_1: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
3488
+ };
3489
+ scheduler?: {
3490
+ schedule: (args_0: string, args_1: string, args_2: (...args: unknown[]) => unknown, ...args: unknown[]) => unknown;
3491
+ } | undefined;
3492
+ };
3493
+ storage: {
3494
+ set: (args_0: string, args_1: any, ...args: unknown[]) => Promise<void>;
3495
+ get: (args_0: string, ...args: unknown[]) => Promise<any>;
3496
+ delete: (args_0: string, ...args: unknown[]) => Promise<void>;
3497
+ };
3498
+ os: {
3499
+ getCurrentUser: (...args: unknown[]) => Promise<any>;
3500
+ getConfig: (args_0: string, ...args: unknown[]) => Promise<any>;
3501
+ };
3502
+ i18n: {
3503
+ t: (args_0: string, args_1: Record<string, any> | undefined, ...args: unknown[]) => string;
3504
+ getLocale: (...args: unknown[]) => string;
3505
+ };
3506
+ events?: any;
3507
+ metadata?: any;
3508
+ }, args_1: string, args_2: string, ...args: unknown[]) => Promise<void>) | undefined;
3509
+ }>;
3510
+ /**
3511
+ * TypeScript types
3512
+ */
3513
+ export type PluginContextData = z.infer<typeof PluginContextSchema>;
3514
+ export type PluginLifecycleHooks = z.infer<typeof PluginLifecycleSchema>;
3515
+ export type PluginDefinition = z.infer<typeof PluginSchema>;
3516
+ //# sourceMappingURL=plugin.zod.d.ts.map