@squidcloud/backend 1.0.148 → 1.0.150

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.
@@ -1,273 +1,236 @@
1
- import { AiChatbotActionType, AiFunctionParam, ApiEndpointId, ApplicationBundleData, CollectionName, DatabaseActionType, IntegrationId, QueryName, SchedulerId, ServiceFunctionName, TriggerId, WebhookId } from '@squidcloud/common';
2
- declare class Meta {
3
- data: ApplicationBundleData;
4
- /**
5
- * @secureDatabase("read", "ExampleIntegration")
6
- *
7
- * Applying the decorator above to the myMethod method on the MyService
8
- * class will generate the following metadata:
9
- *
10
- * data: {
11
- * databases: {
12
- * ExampleIntegration: {
13
- * security: {
14
- * read: ['MyService:myMethod']
15
- * }
16
- * }
17
- * }
18
- * }
19
- */
20
- secureDatabase(type: DatabaseActionType, serviceFunction: ServiceFunctionName, integrationId?: IntegrationId): void;
21
- /**
22
- * @secureCollection("ExampleCollection", "read", "ExampleIntegration")
23
- *
24
- * Applying the decorator above to the myMethod method on the MyService
25
- * class will generate the following metadata:
26
- *
27
- * data: {
28
- * databases: {
29
- * ExampleIntegration: {
30
- * collections: {
31
- * ExampleCollection: {
32
- * security: {
33
- * read: ['MyService:myMethod']
34
- * }
35
- * }
36
- * }
37
- * }
38
- * }
39
- * }
40
- */
41
- secureCollection(collectionName: CollectionName, type: DatabaseActionType, serviceFunction: ServiceFunctionName, integrationId?: IntegrationId): void;
42
- /**
43
- * @secureApi("ExampleIntegration", "myEndpoint")
44
- *
45
- * Applying the decorator above to the myMethod method on the MyService
46
- * class will generate the following metadata:
47
- *
48
- * data: {
49
- * apis: {
50
- * ExampleIntegration: {
51
- * myEndpoint: {
52
- * security: ['MyService:myMethod']
53
- * }
54
- * }
55
- * }
56
- * }
57
- */
58
- secureApi(integrationId: IntegrationId, endpointId: ApiEndpointId | undefined, serviceFunction: ServiceFunctionName): void;
59
- /**
60
- * @secureGraphQL("ExampleIntegration")
61
- *
62
- * Applying the decorator above to the myMethod method on the MyService
63
- * class will generate the following metadata:
64
- *
65
- * data: {
66
- * graphql: {
67
- * ExampleIntegration: {
68
- * security: ['MyService:myMethod']
69
- * }
70
- * }
71
- * }
72
- */
73
- secureGraphQL(integrationId: IntegrationId, serviceFunction: ServiceFunctionName): void;
74
- /**
75
- * @transformDatabase(""read", "ExampleIntegration")
76
- *
77
- * Applying the decorator above to the myMethod method on the MyService
78
- * class will generate the following metadata:
79
- *
80
- * data: {
81
- * databases: {
82
- * ExampleIntegration: {
83
- * transform: {
84
- * read: {
85
- * type: "read"
86
- * functionName: "MyService:myMethod"
87
- * }
88
- * }
89
- * }
90
- * }
91
- * }
92
- */
93
- transformDatabase(type: DatabaseActionType, serviceFunction: ServiceFunctionName, integrationId?: IntegrationId): void;
94
- /**
95
- * @transformCollection("ExampleCollection", "read", "ExampleIntegration")
96
- *
97
- * Applying the decorator above to the myMethod method on the MyService
98
- * class will generate the following metadata:
99
- *
100
- * data: {
101
- * databases: {
102
- * ExampleIntegration: {
103
- * collections: {
104
- * ExampleCollection: {
105
- * transform: {
106
- * read: {
107
- * type: "read"
108
- * functionName: "MyService:myMethod"
109
- * }
110
- * }
111
- * }
112
- * }
113
- * }
114
- * }
115
- * }
116
- */
117
- transformCollection(collectionName: CollectionName, type: DatabaseActionType, serviceFunction: ServiceFunctionName, integrationId?: IntegrationId): void;
118
- /**
119
- * @executable()
120
- *
121
- * Applying the decorator above to the myMethod method on the MyService
122
- * class will generate the following metadata:
123
- *
124
- * data: {
125
- * executables: {
126
- * myExecutable: {
127
- * serviceName: "MyService:myMethod",
128
- * }
129
- * }
130
- * }
131
- */
132
- executable(serviceFunction: ServiceFunctionName): void;
133
- /**
134
- * @aiFunction()
135
- * TODO: update docs
136
- * TODO: update all other functions to use Pick<> like we do here
137
- * Applying the decorator above to the myMethod method on the MyService
138
- * class will generate the following metadata:
139
- *
140
- * data: {
141
- * aiFunctions: {
142
- * myAiFunction: {
143
- * serviceName: "MyService:myMethod",
144
- * }
145
- * }
146
- * }
147
- */
148
- aiFunction(serviceFunction: ServiceFunctionName, description: string, params: Array<AiFunctionParam>): void;
149
- /**
150
- * @trigger("my-trigger", "ExampleCollection", "ExampleIntegration")
151
- *
152
- * Applying the decorator above to the myMethod method on the MyService
153
- * class will generate the following metadata:
154
- *
155
- * data: {
156
- * triggers: {
157
- * "my-trigger": {
158
- * integrationId: "ExampleIntegration"
159
- * collectionName: "ExampleCollection"
160
- * functionName: "MyService:myMethod",
161
- * }
162
- * }
163
- * }
164
- */
165
- trigger(id: TriggerId, collectionName: CollectionName, serviceFunction: ServiceFunctionName, integrationId?: IntegrationId): void;
166
- /**
167
- * @scheduler("my-scheduler", "CronExpression", true)
168
- *
169
- * Applying the decorator above to the myMethod method on the MyService
170
- * class will generate the following metadata:
171
- *
172
- * data: {
173
- * schedulers: {
174
- * "my-scheduler", {
175
- * cronExpression: "CronExpression"
176
- * functionName: "MyService:myMethod",
177
- * }
178
- * }
179
- * }
180
- */
181
- scheduler(id: SchedulerId, cronExpression: string, serviceFunction: ServiceFunctionName, exclusive: boolean): void;
182
- /**
183
- * @webhook("my-webhook")
184
- *
185
- * Applying the decorator above to the myMethod method on the MyService
186
- * class will generate the following metadata:
187
- *
188
- * data: {
189
- * webhooks: {
190
- * "my-webhook", {
191
- * functionName: "MyService:myMethod",
192
- * }
193
- * }
194
- * }
195
- */
196
- webhook(id: WebhookId, serviceFunction: ServiceFunctionName): void;
197
- /**
198
- * @namedQuery('exampleIntegration', 'my-query')
199
- * static myQuery = "select * from my-table where id = ${id}";
200
- *
201
- * Applying the decorator above to the myQuery static string in MyService
202
- * class will generate the following metadata:
203
- *
204
- *
205
- *
206
- * data: {
207
- * namedQueries: {
208
- * "exampleIntegration", {
209
- * my-query: {
210
- * queryString: "select * from my-table where id = $id"
211
- * }
212
- * }
213
- * }
214
- * }
215
- */
216
- namedQuery(integrationId: IntegrationId, name: QueryName, queryString: string): void;
217
- /**
218
- * @secureNamedQuery("exampleIntegration", "queryName")
219
- *
220
- * Applying the decorator above to the myMethod method on the MyService
221
- * class will generate the following metadata:
222
- *
223
- * data: {
224
- * namedQueries: {
225
- * exampleIntegration: {
226
- * queryName: {
227
- * security: MyService:myMethod
228
- * }
229
- * }
230
- * }
231
- * }
232
- */
233
- secureNamedQuery(integrationId: IntegrationId, name: QueryName, serviceFunction: ServiceFunctionName): void;
234
- secureNativeQuery(integrationId: IntegrationId, serviceFunction: ServiceFunctionName): void;
235
- /**
236
- * @secureDistributedLock("mutex", true)
237
- *
238
- * Applying the decorator above to the myMethod method on the MyService
239
- * class will generate the following metadata:
240
- *
241
- * data: {
242
- * distributedLocks: {
243
- * security: [MyService:myMethod]
244
- * }
245
- * }
246
- */
247
- secureDistributedLock(mutex: string | undefined, serviceFunction: ServiceFunctionName): void;
248
- /**
249
- * @secureAiChatbot(ExampleIntegration, "chat", myProfile)
250
- *
251
- * Applying the decorator above to the myMethod method on the MyService
252
- * class will generate the following metadata:
253
- *
254
- * data: {
255
- * aiChatbots: {
256
- * ExampleIntegration: {
257
- * myProfile: {
258
- * security: {
259
- * chat: ['MyService:myMethod']
260
- * }
261
- * }
262
- * }
263
- * }
264
- * }
265
- */
266
- secureAiChatbot(type: AiChatbotActionType, integrationId: IntegrationId, profileId: string | undefined, serviceFunction: ServiceFunctionName): void;
267
- clientConnectionChangeHandler(serviceFunction: ServiceFunctionName): void;
268
- }
269
- /**
270
- * @internal
271
- */
272
- export declare const metadata: Meta;
273
- export {};
1
+ import { AiChatbotActionType, AiFunctionParam, ApiEndpointId, ApplicationBundleData, CollectionName, DatabaseActionType, IntegrationId, SchedulerId, ServiceFunctionName, TriggerId, WebhookId } from '@squidcloud/common';
2
+ declare class Meta {
3
+ data: ApplicationBundleData;
4
+ /**
5
+ * @secureDatabase("read", "ExampleIntegration")
6
+ *
7
+ * Applying the decorator above to the myMethod method on the MyService
8
+ * class will generate the following metadata:
9
+ *
10
+ * data: {
11
+ * databases: {
12
+ * ExampleIntegration: {
13
+ * security: {
14
+ * read: ['MyService:myMethod']
15
+ * }
16
+ * }
17
+ * }
18
+ * }
19
+ */
20
+ secureDatabase(type: DatabaseActionType, serviceFunction: ServiceFunctionName, integrationId?: IntegrationId): void;
21
+ /**
22
+ * @secureCollection("ExampleCollection", "read", "ExampleIntegration")
23
+ *
24
+ * Applying the decorator above to the myMethod method on the MyService
25
+ * class will generate the following metadata:
26
+ *
27
+ * data: {
28
+ * databases: {
29
+ * ExampleIntegration: {
30
+ * collections: {
31
+ * ExampleCollection: {
32
+ * security: {
33
+ * read: ['MyService:myMethod']
34
+ * }
35
+ * }
36
+ * }
37
+ * }
38
+ * }
39
+ * }
40
+ */
41
+ secureCollection(collectionName: CollectionName, type: DatabaseActionType, serviceFunction: ServiceFunctionName, integrationId?: IntegrationId): void;
42
+ /**
43
+ * @secureApi("ExampleIntegration", "myEndpoint")
44
+ *
45
+ * Applying the decorator above to the myMethod method on the MyService
46
+ * class will generate the following metadata:
47
+ *
48
+ * data: {
49
+ * apis: {
50
+ * ExampleIntegration: {
51
+ * myEndpoint: {
52
+ * security: ['MyService:myMethod']
53
+ * }
54
+ * }
55
+ * }
56
+ * }
57
+ */
58
+ secureApi(integrationId: IntegrationId, endpointId: ApiEndpointId | undefined, serviceFunction: ServiceFunctionName): void;
59
+ /**
60
+ * @secureGraphQL("ExampleIntegration")
61
+ *
62
+ * Applying the decorator above to the myMethod method on the MyService
63
+ * class will generate the following metadata:
64
+ *
65
+ * data: {
66
+ * graphql: {
67
+ * ExampleIntegration: {
68
+ * security: ['MyService:myMethod']
69
+ * }
70
+ * }
71
+ * }
72
+ */
73
+ secureGraphQL(integrationId: IntegrationId, serviceFunction: ServiceFunctionName): void;
74
+ /**
75
+ * @transformDatabase(""read", "ExampleIntegration")
76
+ *
77
+ * Applying the decorator above to the myMethod method on the MyService
78
+ * class will generate the following metadata:
79
+ *
80
+ * data: {
81
+ * databases: {
82
+ * ExampleIntegration: {
83
+ * transform: {
84
+ * read: {
85
+ * type: "read"
86
+ * functionName: "MyService:myMethod"
87
+ * }
88
+ * }
89
+ * }
90
+ * }
91
+ * }
92
+ */
93
+ transformDatabase(type: DatabaseActionType, serviceFunction: ServiceFunctionName, integrationId?: IntegrationId): void;
94
+ /**
95
+ * @transformCollection("ExampleCollection", "read", "ExampleIntegration")
96
+ *
97
+ * Applying the decorator above to the myMethod method on the MyService
98
+ * class will generate the following metadata:
99
+ *
100
+ * data: {
101
+ * databases: {
102
+ * ExampleIntegration: {
103
+ * collections: {
104
+ * ExampleCollection: {
105
+ * transform: {
106
+ * read: {
107
+ * type: "read"
108
+ * functionName: "MyService:myMethod"
109
+ * }
110
+ * }
111
+ * }
112
+ * }
113
+ * }
114
+ * }
115
+ * }
116
+ */
117
+ transformCollection(collectionName: CollectionName, type: DatabaseActionType, serviceFunction: ServiceFunctionName, integrationId?: IntegrationId): void;
118
+ /**
119
+ * @executable()
120
+ *
121
+ * Applying the decorator above to the myMethod method on the MyService
122
+ * class will generate the following metadata:
123
+ *
124
+ * data: {
125
+ * executables: {
126
+ * myExecutable: {
127
+ * serviceName: "MyService:myMethod",
128
+ * }
129
+ * }
130
+ * }
131
+ */
132
+ executable(serviceFunction: ServiceFunctionName): void;
133
+ /**
134
+ * @aiFunction()
135
+ * TODO: update docs
136
+ * TODO: update all other functions to use Pick<> like we do here
137
+ * Applying the decorator above to the myMethod method on the MyService
138
+ * class will generate the following metadata:
139
+ *
140
+ * data: {
141
+ * aiFunctions: {
142
+ * myAiFunction: {
143
+ * serviceName: "MyService:myMethod",
144
+ * }
145
+ * }
146
+ * }
147
+ */
148
+ aiFunction(serviceFunction: ServiceFunctionName, description: string, params: Array<AiFunctionParam>): void;
149
+ /**
150
+ * @trigger("my-trigger", "ExampleCollection", "ExampleIntegration")
151
+ *
152
+ * Applying the decorator above to the myMethod method on the MyService
153
+ * class will generate the following metadata:
154
+ *
155
+ * data: {
156
+ * triggers: {
157
+ * "my-trigger": {
158
+ * integrationId: "ExampleIntegration"
159
+ * collectionName: "ExampleCollection"
160
+ * functionName: "MyService:myMethod",
161
+ * }
162
+ * }
163
+ * }
164
+ */
165
+ trigger(id: TriggerId, collectionName: CollectionName, serviceFunction: ServiceFunctionName, integrationId?: IntegrationId): void;
166
+ /**
167
+ * @scheduler("my-scheduler", "CronExpression", true)
168
+ *
169
+ * Applying the decorator above to the myMethod method on the MyService
170
+ * class will generate the following metadata:
171
+ *
172
+ * data: {
173
+ * schedulers: {
174
+ * "my-scheduler", {
175
+ * cronExpression: "CronExpression"
176
+ * functionName: "MyService:myMethod",
177
+ * }
178
+ * }
179
+ * }
180
+ */
181
+ scheduler(id: SchedulerId, cronExpression: string, serviceFunction: ServiceFunctionName, exclusive: boolean): void;
182
+ /**
183
+ * @webhook("my-webhook")
184
+ *
185
+ * Applying the decorator above to the myMethod method on the MyService
186
+ * class will generate the following metadata:
187
+ *
188
+ * data: {
189
+ * webhooks: {
190
+ * "my-webhook", {
191
+ * functionName: "MyService:myMethod",
192
+ * }
193
+ * }
194
+ * }
195
+ */
196
+ webhook(id: WebhookId, serviceFunction: ServiceFunctionName): void;
197
+ secureNativeQuery(integrationId: IntegrationId, serviceFunction: ServiceFunctionName): void;
198
+ /**
199
+ * @secureDistributedLock("mutex", true)
200
+ *
201
+ * Applying the decorator above to the myMethod method on the MyService
202
+ * class will generate the following metadata:
203
+ *
204
+ * data: {
205
+ * distributedLocks: {
206
+ * security: [MyService:myMethod]
207
+ * }
208
+ * }
209
+ */
210
+ secureDistributedLock(mutex: string | undefined, serviceFunction: ServiceFunctionName): void;
211
+ /**
212
+ * @secureAiChatbot(ExampleIntegration, "chat", myProfile)
213
+ *
214
+ * Applying the decorator above to the myMethod method on the MyService
215
+ * class will generate the following metadata:
216
+ *
217
+ * data: {
218
+ * aiChatbots: {
219
+ * ExampleIntegration: {
220
+ * myProfile: {
221
+ * security: {
222
+ * chat: ['MyService:myMethod']
223
+ * }
224
+ * }
225
+ * }
226
+ * }
227
+ * }
228
+ */
229
+ secureAiChatbot(type: AiChatbotActionType, integrationId: IntegrationId, profileId: string | undefined, serviceFunction: ServiceFunctionName): void;
230
+ clientConnectionChangeHandler(serviceFunction: ServiceFunctionName): void;
231
+ }
232
+ /**
233
+ * @internal
234
+ */
235
+ export declare const metadata: Meta;
236
+ export {};
@@ -1,7 +1,7 @@
1
- /**
2
- * The SquidProject class is the entry point for the Squid backend project.
3
- */
4
- export declare class SquidProject {
5
- private metadata;
6
- private cleanup;
7
- }
1
+ /**
2
+ * The SquidProject class is the entry point for the Squid backend project.
3
+ */
4
+ export declare class SquidProject {
5
+ private metadata;
6
+ private cleanup;
7
+ }