@@ -86,6 +86,42 @@ function getDefaultHosts(region: Region): Host[] {
86
86
return [ { url, accept : 'readWrite' , protocol : 'https' } ] ;
87
87
}
88
88
89
+ /**
90
+ * Guard: Return strongly typed specific OnDemandTrigger for a given Trigger.
91
+ *
92
+ * @summary Guard method that returns a strongly typed specific OnDemandTrigger for a given Trigger.
93
+ * @param trigger - The given Task Trigger.
94
+ */
95
+ export function isOnDemandTrigger (
96
+ trigger : Trigger
97
+ ) : trigger is OnDemandTrigger {
98
+ return trigger . type === 'on_demand' ;
99
+ }
100
+
101
+ /**
102
+ * Guard: Return strongly typed specific ScheduleTrigger for a given Trigger.
103
+ *
104
+ * @summary Guard method that returns a strongly typed specific ScheduleTrigger for a given Trigger.
105
+ * @param trigger - The given Task Trigger.
106
+ */
107
+ export function isScheduleTrigger (
108
+ trigger : Trigger
109
+ ) : trigger is ScheduleTrigger {
110
+ return trigger . type === 'schedule' ;
111
+ }
112
+
113
+ /**
114
+ * Guard: Return strongly typed specific SubscriptionTrigger for a given Trigger.
115
+ *
116
+ * @summary Guard method that returns a strongly typed specific SubscriptionTrigger for a given Trigger.
117
+ * @param trigger - The given Task Trigger.
118
+ */
119
+ export function isSubscriptionTrigger (
120
+ trigger : Trigger
121
+ ) : trigger is SubscriptionTrigger {
122
+ return trigger . type === 'subscription' ;
123
+ }
124
+
89
125
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
90
126
export function createIngestionClient ( {
91
127
appId : appIdOption ,
@@ -153,36 +189,6 @@ export function createIngestionClient({
153
189
transporter . algoliaAgent . add ( { segment, version } ) ;
154
190
} ,
155
191
156
- /**
157
- * Guard: Return strongly typed specific OnDemandTrigger for a given Trigger.
158
- *
159
- * @summary Guard method that returns a strongly typed specific OnDemandTrigger for a given Trigger.
160
- * @param trigger - The given Task Trigger.
161
- */
162
- isOnDemandTrigger ( trigger : Trigger ) : trigger is OnDemandTrigger {
163
- return trigger . type === 'on_demand' ;
164
- } ,
165
-
166
- /**
167
- * Guard: Return strongly typed specific ScheduleTrigger for a given Trigger.
168
- *
169
- * @summary Guard method that returns a strongly typed specific ScheduleTrigger for a given Trigger.
170
- * @param trigger - The given Task Trigger.
171
- */
172
- isScheduleTrigger ( trigger : Trigger ) : trigger is ScheduleTrigger {
173
- return trigger . type === 'schedule' ;
174
- } ,
175
-
176
- /**
177
- * Guard: Return strongly typed specific SubscriptionTrigger for a given Trigger.
178
- *
179
- * @summary Guard method that returns a strongly typed specific SubscriptionTrigger for a given Trigger.
180
- * @param trigger - The given Task Trigger.
181
- */
182
- isSubscriptionTrigger ( trigger : Trigger ) : trigger is SubscriptionTrigger {
183
- return trigger . type === 'subscription' ;
184
- } ,
185
-
186
192
/**
187
193
* Create a authentication.
188
194
*
0 commit comments