go-mokapi 0.58.0 → 0.59.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "go-mokapi",
3
- "version": "0.58.0",
3
+ "version": "0.59.0",
4
4
  "description": "Easy and flexible API mocking",
5
5
  "homepage": "https://mokapi.io",
6
6
  "repository": {
@@ -12,12 +12,12 @@
12
12
  },
13
13
  "preferUnplugged": true,
14
14
  "optionalDependencies": {
15
- "@go-mokapi/darwin-arm64": "0.58.0",
16
- "@go-mokapi/darwin-x64": "0.58.0",
17
- "@go-mokapi/linux-arm64": "0.58.0",
18
- "@go-mokapi/linux-x64": "0.58.0",
19
- "@go-mokapi/win32-arm64": "0.58.0",
20
- "@go-mokapi/win32-x64": "0.58.0"
15
+ "@go-mokapi/darwin-arm64": "0.59.0",
16
+ "@go-mokapi/darwin-x64": "0.59.0",
17
+ "@go-mokapi/linux-arm64": "0.59.0",
18
+ "@go-mokapi/linux-x64": "0.59.0",
19
+ "@go-mokapi/win32-arm64": "0.59.0",
20
+ "@go-mokapi/win32-x64": "0.59.0"
21
21
  },
22
22
  "keywords": [
23
23
  "mock api",
package/types/index.d.ts CHANGED
@@ -1226,7 +1226,7 @@ export interface SmtpEventArgs extends EventArgs {
1226
1226
  * export default function() {
1227
1227
  * every('1m', function() {
1228
1228
  * console.log('foo')
1229
- * }, {times: 1, runFirstTimeImmediately: false})
1229
+ * }, {times: 1, skipImmediateFirstRun: true})
1230
1230
  * }
1231
1231
  */
1232
1232
  export type ScheduledEventHandler = () => void | Promise<void>;
@@ -1247,9 +1247,11 @@ export interface ScheduledEventArgs {
1247
1247
  times?: number;
1248
1248
 
1249
1249
  /**
1250
- * Toggles behavior of first execution. Default is true
1250
+ * If true, the job does not run immediately but waits for the first
1251
+ * interval or the first match of the cron expression.
1252
+ * Default is `false` for `every` and `true` for `cron`.
1251
1253
  */
1252
- runFirstTimeImmediately?: boolean;
1254
+ skipImmediateFirstRun?: boolean;
1253
1255
  }
1254
1256
 
1255
1257
  /**
@@ -2586,7 +2588,7 @@ export interface KafkaProduceArgs {
2586
2588
  * @example
2587
2589
  * app.kafka().produce('order-placed', { data: { id: 1 } }, {
2588
2590
  * result: (r) => {
2589
- * console.log(r.cluster) // e.g. 'Order Events'
2591
+ * console.log(r.api) // e.g. 'Order Events'
2590
2592
  * console.log(r.topic) // e.g. 'order-placed'
2591
2593
  * console.log(r.messages[0].offset) // e.g. 42
2592
2594
  * }
package/types/kafka.d.ts CHANGED
@@ -182,44 +182,16 @@ export interface Message {
182
182
  * }
183
183
  */
184
184
  export interface ProduceResult {
185
- /** Name of the Kafka cluster where the messages were written. */
186
- readonly cluster: string;
185
+ /**
186
+ * Name of the Kafka cluster (AsyncAPI `info.title`) where the messages were written.
187
+ */
188
+ readonly api: string;
187
189
 
188
190
  /** Name of the Kafka topic where the messages were written. */
189
191
  readonly topic: string;
190
192
 
191
193
  /** The written messages, in the same order as in {@link ProduceArgs.messages}. */
192
194
  readonly messages: readonly MessageResult[];
193
-
194
- /**
195
- * Partition of the first written message.
196
- * @deprecated Use `messages[i].partition` instead.
197
- */
198
- readonly partition: number;
199
-
200
- /**
201
- * Offset of the first written message.
202
- * @deprecated Use `messages[i].offset` instead.
203
- */
204
- readonly offset: number;
205
-
206
- /**
207
- * Key of the first written message.
208
- * @deprecated Use `messages[i].key` instead.
209
- */
210
- readonly key: string;
211
-
212
- /**
213
- * Value of the first written message.
214
- * @deprecated Use `messages[i].value` instead.
215
- */
216
- readonly value: string;
217
-
218
- /**
219
- * Headers of the first written message.
220
- * @deprecated Use `messages[i].headers` instead.
221
- */
222
- readonly headers: { [name: string]: string };
223
195
  }
224
196
 
225
197
  /**
package/types/mqtt.d.ts CHANGED
@@ -67,22 +67,21 @@ export interface PublishArgs {
67
67
  }
68
68
 
69
69
  /**
70
- * Contains information of the written Kafka message.
71
- * https://mokapi.io/docs/javascript-api/mokapi-kafka/produceresult
70
+ * Contains information of the published MQTT message.
72
71
  * @example
73
72
  * export default function() {
74
- * const res = produce({ topic: 'foo' })
75
- * console.log(`new kafka message written with offset: ${res.offset}`)
73
+ * const res = publish({ topic: 'foo' })
74
+ * console.log(`message published to topic ${res.topic} of ${res.api}`)
76
75
  * }
77
76
  */
78
77
  export interface PublishResult {
79
- /** Name of the Kafka cluster where the message was written. */
80
- readonly cluster: string;
78
+ /** Name of the MQTT broker (AsyncAPI `info.title`) where the message was published. */
79
+ readonly api: string;
81
80
 
82
- /** Kafka topic name where the message was written. */
81
+ /** MQTT topic name where the message was published. */
83
82
  readonly topic: string;
84
83
 
85
- /** The value of the written message. */
84
+ /** The value of the published message. */
86
85
  readonly value: string;
87
86
  }
88
87