@openfn/language-wigal-sms 0.1.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/ast.json ADDED
@@ -0,0 +1,641 @@
1
+ {
2
+ "operations": [
3
+ {
4
+ "name": "execute",
5
+ "params": [
6
+ "operations"
7
+ ],
8
+ "docs": {
9
+ "description": "SMS Request Object",
10
+ "tags": [
11
+ {
12
+ "title": "typedef",
13
+ "description": null,
14
+ "type": {
15
+ "type": "NameExpression",
16
+ "name": "Object"
17
+ },
18
+ "name": "SMSRequestObject"
19
+ },
20
+ {
21
+ "title": "public",
22
+ "description": null,
23
+ "type": null
24
+ },
25
+ {
26
+ "title": "property",
27
+ "description": "The senderID used for sending message. Approved SenderIDs only",
28
+ "type": {
29
+ "type": "NameExpression",
30
+ "name": "string"
31
+ },
32
+ "name": "senderid"
33
+ },
34
+ {
35
+ "title": "property",
36
+ "description": "An array of objects containing the destination phone number and message to be sent",
37
+ "type": {
38
+ "type": "NameExpression",
39
+ "name": "array"
40
+ },
41
+ "name": "destinations"
42
+ },
43
+ {
44
+ "title": "property",
45
+ "description": "The message to be sent to the destinations",
46
+ "type": {
47
+ "type": "NameExpression",
48
+ "name": "string"
49
+ },
50
+ "name": "message"
51
+ },
52
+ {
53
+ "title": "property",
54
+ "description": "The type of message to be sent. Default is 'text'",
55
+ "type": {
56
+ "type": "NameExpression",
57
+ "name": "string"
58
+ },
59
+ "name": "smstype"
60
+ }
61
+ ]
62
+ },
63
+ "valid": false
64
+ }
65
+ ],
66
+ "exports": [],
67
+ "common": [
68
+ {
69
+ "name": "fn",
70
+ "params": [
71
+ "func"
72
+ ],
73
+ "docs": {
74
+ "description": "Creates a custom step (or operation) for more flexible job writing.",
75
+ "tags": [
76
+ {
77
+ "title": "public",
78
+ "description": null,
79
+ "type": null
80
+ },
81
+ {
82
+ "title": "function",
83
+ "description": null,
84
+ "name": null
85
+ },
86
+ {
87
+ "title": "example",
88
+ "description": "fn(state => {\n // do some things to state\n return state;\n});"
89
+ },
90
+ {
91
+ "title": "param",
92
+ "description": "is the function",
93
+ "type": {
94
+ "type": "NameExpression",
95
+ "name": "Function"
96
+ },
97
+ "name": "func"
98
+ },
99
+ {
100
+ "title": "returns",
101
+ "description": null,
102
+ "type": {
103
+ "type": "NameExpression",
104
+ "name": "Operation"
105
+ }
106
+ }
107
+ ]
108
+ },
109
+ "valid": true
110
+ },
111
+ {
112
+ "name": "fnIf",
113
+ "params": [
114
+ "condition",
115
+ "operation"
116
+ ],
117
+ "docs": {
118
+ "description": "A custom operation that will only execute the function if the condition returns true",
119
+ "tags": [
120
+ {
121
+ "title": "public",
122
+ "description": null,
123
+ "type": null
124
+ },
125
+ {
126
+ "title": "function",
127
+ "description": null,
128
+ "name": null
129
+ },
130
+ {
131
+ "title": "example",
132
+ "description": "fnIf((state) => state?.data?.name, get(\"https://example.com\"));"
133
+ },
134
+ {
135
+ "title": "param",
136
+ "description": "The condition that returns true",
137
+ "type": {
138
+ "type": "NameExpression",
139
+ "name": "Boolean"
140
+ },
141
+ "name": "condition"
142
+ },
143
+ {
144
+ "title": "param",
145
+ "description": "The operation needed to be executed.",
146
+ "type": {
147
+ "type": "NameExpression",
148
+ "name": "Operation"
149
+ },
150
+ "name": "operation"
151
+ },
152
+ {
153
+ "title": "returns",
154
+ "description": null,
155
+ "type": {
156
+ "type": "NameExpression",
157
+ "name": "Operation"
158
+ }
159
+ }
160
+ ]
161
+ },
162
+ "valid": true
163
+ },
164
+ {
165
+ "name": "sourceValue",
166
+ "params": [
167
+ "path"
168
+ ],
169
+ "docs": {
170
+ "description": "Picks out a single value from source data.\nIf a JSONPath returns more than one value for the reference, the first\nitem will be returned.",
171
+ "tags": [
172
+ {
173
+ "title": "public",
174
+ "description": null,
175
+ "type": null
176
+ },
177
+ {
178
+ "title": "function",
179
+ "description": null,
180
+ "name": null
181
+ },
182
+ {
183
+ "title": "example",
184
+ "description": "sourceValue('$.key')"
185
+ },
186
+ {
187
+ "title": "param",
188
+ "description": "JSONPath referencing a point in `state`.",
189
+ "type": {
190
+ "type": "NameExpression",
191
+ "name": "String"
192
+ },
193
+ "name": "path"
194
+ },
195
+ {
196
+ "title": "returns",
197
+ "description": null,
198
+ "type": {
199
+ "type": "NameExpression",
200
+ "name": "Operation"
201
+ }
202
+ }
203
+ ]
204
+ },
205
+ "valid": true
206
+ },
207
+ {
208
+ "name": "dataPath",
209
+ "params": [
210
+ "path"
211
+ ],
212
+ "docs": {
213
+ "description": "Ensures a path points at the data.",
214
+ "tags": [
215
+ {
216
+ "title": "public",
217
+ "description": null,
218
+ "type": null
219
+ },
220
+ {
221
+ "title": "function",
222
+ "description": null,
223
+ "name": null
224
+ },
225
+ {
226
+ "title": "example",
227
+ "description": "dataPath('key')"
228
+ },
229
+ {
230
+ "title": "param",
231
+ "description": "JSONPath referencing a point in `data`.",
232
+ "type": {
233
+ "type": "NameExpression",
234
+ "name": "string"
235
+ },
236
+ "name": "path"
237
+ },
238
+ {
239
+ "title": "returns",
240
+ "description": null,
241
+ "type": {
242
+ "type": "NameExpression",
243
+ "name": "string"
244
+ }
245
+ }
246
+ ]
247
+ },
248
+ "valid": true
249
+ },
250
+ {
251
+ "name": "dataValue",
252
+ "params": [
253
+ "path"
254
+ ],
255
+ "docs": {
256
+ "description": "Picks out a single value from the source data object—usually `state.data`.\nIf a JSONPath returns more than one value for the reference, the first\nitem will be returned.",
257
+ "tags": [
258
+ {
259
+ "title": "public",
260
+ "description": null,
261
+ "type": null
262
+ },
263
+ {
264
+ "title": "function",
265
+ "description": null,
266
+ "name": null
267
+ },
268
+ {
269
+ "title": "example",
270
+ "description": "dataValue('key')"
271
+ },
272
+ {
273
+ "title": "param",
274
+ "description": "JSONPath referencing a point in `data`.",
275
+ "type": {
276
+ "type": "NameExpression",
277
+ "name": "String"
278
+ },
279
+ "name": "path"
280
+ },
281
+ {
282
+ "title": "returns",
283
+ "description": null,
284
+ "type": {
285
+ "type": "NameExpression",
286
+ "name": "Operation"
287
+ }
288
+ }
289
+ ]
290
+ },
291
+ "valid": true
292
+ },
293
+ {
294
+ "name": "lastReferenceValue",
295
+ "params": [
296
+ "path"
297
+ ],
298
+ "docs": {
299
+ "description": "Picks out the last reference value from source data.",
300
+ "tags": [
301
+ {
302
+ "title": "public",
303
+ "description": null,
304
+ "type": null
305
+ },
306
+ {
307
+ "title": "function",
308
+ "description": null,
309
+ "name": null
310
+ },
311
+ {
312
+ "title": "example",
313
+ "description": "lastReferenceValue('key')"
314
+ },
315
+ {
316
+ "title": "param",
317
+ "description": "JSONPath referencing a point in `references`.",
318
+ "type": {
319
+ "type": "NameExpression",
320
+ "name": "String"
321
+ },
322
+ "name": "path"
323
+ },
324
+ {
325
+ "title": "returns",
326
+ "description": null,
327
+ "type": {
328
+ "type": "NameExpression",
329
+ "name": "Operation"
330
+ }
331
+ }
332
+ ]
333
+ },
334
+ "valid": true
335
+ },
336
+ {
337
+ "name": "each",
338
+ "params": [
339
+ "dataSource",
340
+ "operation"
341
+ ],
342
+ "docs": {
343
+ "description": "Iterates over an array of items and invokes an operation upon each one, where the state\nobject is _scoped_ so that state.data is the item under iteration.\nThe rest of the state object is untouched and can be referenced as usual.\nYou can pass an array directly, or use lazy state or a JSONPath string to\nreference a slice of state.",
344
+ "tags": [
345
+ {
346
+ "title": "public",
347
+ "description": null,
348
+ "type": null
349
+ },
350
+ {
351
+ "title": "function",
352
+ "description": null,
353
+ "name": null
354
+ },
355
+ {
356
+ "title": "example",
357
+ "description": "each(\n $.data,\n // Inside the callback operation, `$.data` is scoped to the item under iteration\n insert(\"patient\", {\n patient_name: $.data.properties.case_name,\n patient_id: $.data.case_id,\n })\n);",
358
+ "caption": "Using lazy state ($) to iterate over items in state.data and pass each into an \"insert\" operation"
359
+ },
360
+ {
361
+ "title": "example",
362
+ "description": "each(\n $.data,\n insert(\"patient\", (state) => ({\n patient_id: state.data.case_id,\n ...state.data\n }))\n);",
363
+ "caption": "Iterate over items in state.data and pass each one into an \"insert\" operation"
364
+ },
365
+ {
366
+ "title": "example",
367
+ "description": "each(\n \"$.data[*]\",\n insert(\"patient\", (state) => ({\n patient_name: state.data.properties.case_name,\n patient_id: state.data.case_id,\n }))\n);",
368
+ "caption": "Using JSON path to iterate over items in state.data and pass each one into an \"insert\" operation"
369
+ },
370
+ {
371
+ "title": "param",
372
+ "description": "JSONPath referencing a point in `state`.",
373
+ "type": {
374
+ "type": "NameExpression",
375
+ "name": "DataSource"
376
+ },
377
+ "name": "dataSource"
378
+ },
379
+ {
380
+ "title": "param",
381
+ "description": "The operation needed to be repeated.",
382
+ "type": {
383
+ "type": "NameExpression",
384
+ "name": "Operation"
385
+ },
386
+ "name": "operation"
387
+ },
388
+ {
389
+ "title": "returns",
390
+ "description": null,
391
+ "type": {
392
+ "type": "NameExpression",
393
+ "name": "Operation"
394
+ }
395
+ }
396
+ ]
397
+ },
398
+ "valid": true
399
+ },
400
+ {
401
+ "name": "field",
402
+ "params": [
403
+ "key",
404
+ "value"
405
+ ],
406
+ "docs": {
407
+ "description": "Returns a key, value pair in an array.",
408
+ "tags": [
409
+ {
410
+ "title": "public",
411
+ "description": null,
412
+ "type": null
413
+ },
414
+ {
415
+ "title": "function",
416
+ "description": null,
417
+ "name": null
418
+ },
419
+ {
420
+ "title": "example",
421
+ "description": "field('destination_field_name__c', 'value')"
422
+ },
423
+ {
424
+ "title": "param",
425
+ "description": "Name of the field",
426
+ "type": {
427
+ "type": "NameExpression",
428
+ "name": "string"
429
+ },
430
+ "name": "key"
431
+ },
432
+ {
433
+ "title": "param",
434
+ "description": "The value itself or a sourceable operation.",
435
+ "type": {
436
+ "type": "NameExpression",
437
+ "name": "Value"
438
+ },
439
+ "name": "value"
440
+ },
441
+ {
442
+ "title": "returns",
443
+ "description": null,
444
+ "type": {
445
+ "type": "NameExpression",
446
+ "name": "Field"
447
+ }
448
+ }
449
+ ]
450
+ },
451
+ "valid": true
452
+ },
453
+ {
454
+ "name": "fields",
455
+ "params": [
456
+ "fields"
457
+ ],
458
+ "docs": {
459
+ "description": "Zips key value pairs into an object.",
460
+ "tags": [
461
+ {
462
+ "title": "public",
463
+ "description": null,
464
+ "type": null
465
+ },
466
+ {
467
+ "title": "function",
468
+ "description": null,
469
+ "name": null
470
+ },
471
+ {
472
+ "title": "example",
473
+ "description": "fields(list_of_fields)"
474
+ },
475
+ {
476
+ "title": "param",
477
+ "description": "a list of fields",
478
+ "type": {
479
+ "type": "NameExpression",
480
+ "name": "Fields"
481
+ },
482
+ "name": "fields"
483
+ },
484
+ {
485
+ "title": "returns",
486
+ "description": null,
487
+ "type": {
488
+ "type": "NameExpression",
489
+ "name": "Object"
490
+ }
491
+ }
492
+ ]
493
+ },
494
+ "valid": true
495
+ },
496
+ {
497
+ "name": "merge",
498
+ "params": [
499
+ "dataSource",
500
+ "fields"
501
+ ],
502
+ "docs": {
503
+ "description": "Merges fields into each item in an array.",
504
+ "tags": [
505
+ {
506
+ "title": "public",
507
+ "description": null,
508
+ "type": null
509
+ },
510
+ {
511
+ "title": "example",
512
+ "description": "merge(\n \"$.books[*]\",\n fields(\n field( \"publisher\", sourceValue(\"$.publisher\") )\n )\n)"
513
+ },
514
+ {
515
+ "title": "function",
516
+ "description": null,
517
+ "name": null
518
+ },
519
+ {
520
+ "title": "public",
521
+ "description": null,
522
+ "type": null
523
+ },
524
+ {
525
+ "title": "param",
526
+ "description": null,
527
+ "type": {
528
+ "type": "NameExpression",
529
+ "name": "DataSource"
530
+ },
531
+ "name": "dataSource"
532
+ },
533
+ {
534
+ "title": "param",
535
+ "description": "Group of fields to merge in.",
536
+ "type": {
537
+ "type": "NameExpression",
538
+ "name": "Object"
539
+ },
540
+ "name": "fields"
541
+ },
542
+ {
543
+ "title": "returns",
544
+ "description": null,
545
+ "type": {
546
+ "type": "NameExpression",
547
+ "name": "DataSource"
548
+ }
549
+ }
550
+ ]
551
+ },
552
+ "valid": true
553
+ },
554
+ {
555
+ "name": "cursor",
556
+ "params": [
557
+ "value",
558
+ "options"
559
+ ],
560
+ "docs": {
561
+ "description": "Sets a cursor property on state.\nSupports natural language dates like `now`, `today`, `yesterday`, `n hours ago`, `n days ago`, and `start`,\nwhich will be converted relative to the environment (ie, the Lightning or CLI locale). Custom timezones\nare not yet supported.\nYou can provide a formatter to customise the final cursor value, which is useful for normalising\ndifferent inputs. The custom formatter runs after natural language date conversion.\nSee the usage guide at {@link https://docs.openfn.org/documentation/jobs/job-writing-guide#using-cursors}",
562
+ "tags": [
563
+ {
564
+ "title": "public",
565
+ "description": null,
566
+ "type": null
567
+ },
568
+ {
569
+ "title": "function",
570
+ "description": null,
571
+ "name": null
572
+ },
573
+ {
574
+ "title": "example",
575
+ "description": "cursor($.cursor, { defaultValue: 'today' })",
576
+ "caption": "Use a cursor from state if present, or else use the default value"
577
+ },
578
+ {
579
+ "title": "example",
580
+ "description": "cursor(22)",
581
+ "caption": "Use a pagination cursor"
582
+ },
583
+ {
584
+ "title": "param",
585
+ "description": "the cursor value. Usually an ISO date, natural language date, or page number",
586
+ "type": {
587
+ "type": "NameExpression",
588
+ "name": "any"
589
+ },
590
+ "name": "value"
591
+ },
592
+ {
593
+ "title": "param",
594
+ "description": "options to control the cursor.",
595
+ "type": {
596
+ "type": "NameExpression",
597
+ "name": "object"
598
+ },
599
+ "name": "options"
600
+ },
601
+ {
602
+ "title": "param",
603
+ "description": "set the cursor key. Will persist through the whole run.",
604
+ "type": {
605
+ "type": "NameExpression",
606
+ "name": "string"
607
+ },
608
+ "name": "options.key"
609
+ },
610
+ {
611
+ "title": "param",
612
+ "description": "the value to use if value is falsy",
613
+ "type": {
614
+ "type": "NameExpression",
615
+ "name": "any"
616
+ },
617
+ "name": "options.defaultValue"
618
+ },
619
+ {
620
+ "title": "param",
621
+ "description": "custom formatter for the final cursor value",
622
+ "type": {
623
+ "type": "NameExpression",
624
+ "name": "Function"
625
+ },
626
+ "name": "options.format"
627
+ },
628
+ {
629
+ "title": "returns",
630
+ "description": null,
631
+ "type": {
632
+ "type": "NameExpression",
633
+ "name": "Operation"
634
+ }
635
+ }
636
+ ]
637
+ },
638
+ "valid": false
639
+ }
640
+ ]
641
+ }
@@ -0,0 +1,45 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "properties": {
4
+ "baseUrl": {
5
+ "title": "Base URL",
6
+ "anyOf": [
7
+ {
8
+ "type": "string"
9
+ },
10
+ {
11
+ "type": "null"
12
+ }
13
+ ],
14
+ "description": "The base URL (https://frogapi.wigal.com.gh)",
15
+ "format": "uri",
16
+ "minLength": 1,
17
+ "examples": [
18
+ "https://frogapi.wigal.com.gh"
19
+ ]
20
+ },
21
+ "username": {
22
+ "title": "Username",
23
+ "type": "string",
24
+ "description": "Username",
25
+ "examples": [
26
+ "test@openfn.org"
27
+ ]
28
+ },
29
+ "apiKey": {
30
+ "title": "API-KEY",
31
+ "type": "string",
32
+ "description": "API-KEY",
33
+ "writeOnly": true,
34
+ "examples": [
35
+ "@some(!)apikey"
36
+ ]
37
+ }
38
+ },
39
+ "type": "object",
40
+ "additionalProperties": true,
41
+ "required": [
42
+ "apiKey",
43
+ "username"
44
+ ]
45
+ }