keinaufwand 0.3.0 → 0.3.1
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.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/lib/keinaufwand/api/client/error.rb +4 -0
- data/lib/keinaufwand/api/client.rb +1 -0
- data/lib/keinaufwand/api/version.rb +1 -1
- data/schemas/2026-07-02.json +368 -14
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a1e4d46773bcdf8844caeb78fc3e274fe03ffcea07a9998f83a0b17dbfb6dfe9
|
|
4
|
+
data.tar.gz: 61bc78903d08f704ed957d9a7c8c2c50b45f997a171a84ca9ed6c6f99df68bc6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e4d73ca1222892ba427e96f5df70ff34ac8fc5f0f39a449981687eb55b417548da08a7da03294944f8f1a859ebecaca779d88015490b25cc405ac0953624e94a
|
|
7
|
+
data.tar.gz: 5c958ec4027b1775035ebe6e4eab279241f782ba58d21b1134dfcb04bfa877bf85494060639a3914bb574d77c53733157a7d8d92f18b9f5d7afcd2a52aa31896
|
data/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Ruby client for the [Keinaufwand API](https://keinaufwand.com). Includes the API schema and typed nested records.
|
|
4
4
|
|
|
5
5
|
```ruby
|
|
6
|
-
gem "keinaufwand", "~> 0.3.
|
|
6
|
+
gem "keinaufwand", "~> 0.3.1"
|
|
7
7
|
```
|
|
8
8
|
|
|
9
9
|
```ruby
|
|
@@ -23,6 +23,6 @@ end
|
|
|
23
23
|
post = client.retrieve_post(123)
|
|
24
24
|
```
|
|
25
25
|
|
|
26
|
-
Requests require an account API key. Collection methods return an enumerable page with pagination metadata; show methods return one record. HTTP failures raise `Keinaufwand::Api::Client::Error`.
|
|
26
|
+
Requests require an account API key. Collection methods return an enumerable page with pagination metadata; show methods return one record. HTTP failures raise `Keinaufwand::Api::Client::Error`. Listings return every record, archived, unpublished and cancelled ones included with their flags. With `updated_since`, they return the records changed since and `_deleted` tombstones of the records deleted since. The API keeps deletions for 90 days: an older `updated_since` answers `410 FULL_SYNC_REQUIRED`, raised as `Keinaufwand::Api::Client::FullSyncRequired`, after which a consumer lists everything again and treats records it no longer gets as deleted.
|
|
27
27
|
|
|
28
28
|
For Rails persistence, local media, delta polling, and signed webhooks, install `keinaufwand-sync` as well.
|
|
@@ -22,6 +22,10 @@ module Keinaufwand
|
|
|
22
22
|
nil
|
|
23
23
|
end
|
|
24
24
|
end
|
|
25
|
+
|
|
26
|
+
# A 410, the API's FULL_SYNC_REQUIRED: it no longer keeps the deletions since the given updated_since. List without
|
|
27
|
+
# updated_since and treat every record not listed as deleted.
|
|
28
|
+
class FullSyncRequired < Error; end
|
|
25
29
|
end
|
|
26
30
|
end
|
|
27
31
|
end
|
|
@@ -91,6 +91,7 @@ module Keinaufwand
|
|
|
91
91
|
request.body = JSON.generate(params) if verb != 'GET' && params.present?
|
|
92
92
|
|
|
93
93
|
response = Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == 'https') { |http| http.request(request) }
|
|
94
|
+
raise FullSyncRequired, response if response.is_a?(Net::HTTPGone)
|
|
94
95
|
raise Error, response unless response.is_a?(Net::HTTPSuccess)
|
|
95
96
|
|
|
96
97
|
JSON.parse(response.body)
|
data/schemas/2026-07-02.json
CHANGED
|
@@ -195,6 +195,7 @@
|
|
|
195
195
|
"interval_count": "virtual",
|
|
196
196
|
"default": "virtual",
|
|
197
197
|
"trial": "virtual",
|
|
198
|
+
"archived": "virtual",
|
|
198
199
|
"created_at": "datetime",
|
|
199
200
|
"updated_at": "datetime"
|
|
200
201
|
}
|
|
@@ -238,6 +239,7 @@
|
|
|
238
239
|
"max_age": "virtual",
|
|
239
240
|
"grade": "virtual",
|
|
240
241
|
"program": "virtual",
|
|
242
|
+
"archived": "virtual",
|
|
241
243
|
"created_at": "datetime",
|
|
242
244
|
"updated_at": "datetime"
|
|
243
245
|
}
|
|
@@ -248,6 +250,7 @@
|
|
|
248
250
|
"id": "integer",
|
|
249
251
|
"first_name": "virtual",
|
|
250
252
|
"last_name": "virtual",
|
|
253
|
+
"archived": "virtual",
|
|
251
254
|
"created_at": "datetime",
|
|
252
255
|
"updated_at": "datetime"
|
|
253
256
|
}
|
|
@@ -331,84 +334,435 @@
|
|
|
331
334
|
{
|
|
332
335
|
"action": "index",
|
|
333
336
|
"verb": "GET",
|
|
334
|
-
"path": "/2026-07-02/locations"
|
|
337
|
+
"path": "/2026-07-02/locations",
|
|
338
|
+
"scope": "offers:read"
|
|
339
|
+
},
|
|
340
|
+
{
|
|
341
|
+
"action": "create",
|
|
342
|
+
"verb": "POST",
|
|
343
|
+
"path": "/2026-07-02/locations",
|
|
344
|
+
"scope": "offers:write",
|
|
345
|
+
"params": [
|
|
346
|
+
"archived",
|
|
347
|
+
{
|
|
348
|
+
"address_attributes": [
|
|
349
|
+
"street",
|
|
350
|
+
"zip",
|
|
351
|
+
"city",
|
|
352
|
+
"country_code",
|
|
353
|
+
"care_of"
|
|
354
|
+
]
|
|
355
|
+
},
|
|
356
|
+
{
|
|
357
|
+
"contact_attributes": [
|
|
358
|
+
"first_name",
|
|
359
|
+
"last_name",
|
|
360
|
+
"email",
|
|
361
|
+
"phone",
|
|
362
|
+
"url"
|
|
363
|
+
]
|
|
364
|
+
}
|
|
365
|
+
]
|
|
335
366
|
},
|
|
336
367
|
{
|
|
337
368
|
"action": "show",
|
|
338
369
|
"verb": "GET",
|
|
339
|
-
"path": "/2026-07-02/locations/:id"
|
|
370
|
+
"path": "/2026-07-02/locations/:id",
|
|
371
|
+
"scope": "offers:read"
|
|
372
|
+
},
|
|
373
|
+
{
|
|
374
|
+
"action": "update",
|
|
375
|
+
"verb": "PATCH",
|
|
376
|
+
"path": "/2026-07-02/locations/:id",
|
|
377
|
+
"scope": "offers:write",
|
|
378
|
+
"params": [
|
|
379
|
+
"archived",
|
|
380
|
+
{
|
|
381
|
+
"address_attributes": [
|
|
382
|
+
"street",
|
|
383
|
+
"zip",
|
|
384
|
+
"city",
|
|
385
|
+
"country_code",
|
|
386
|
+
"care_of"
|
|
387
|
+
]
|
|
388
|
+
},
|
|
389
|
+
{
|
|
390
|
+
"contact_attributes": [
|
|
391
|
+
"first_name",
|
|
392
|
+
"last_name",
|
|
393
|
+
"email",
|
|
394
|
+
"phone",
|
|
395
|
+
"url"
|
|
396
|
+
]
|
|
397
|
+
}
|
|
398
|
+
]
|
|
340
399
|
}
|
|
341
400
|
],
|
|
342
401
|
"products": [
|
|
343
402
|
{
|
|
344
403
|
"action": "index",
|
|
345
404
|
"verb": "GET",
|
|
346
|
-
"path": "/2026-07-02/products"
|
|
405
|
+
"path": "/2026-07-02/products",
|
|
406
|
+
"scope": "offers:read"
|
|
407
|
+
},
|
|
408
|
+
{
|
|
409
|
+
"action": "create",
|
|
410
|
+
"verb": "POST",
|
|
411
|
+
"path": "/2026-07-02/products",
|
|
412
|
+
"scope": "offers:write",
|
|
413
|
+
"params": [
|
|
414
|
+
"position",
|
|
415
|
+
"product_type",
|
|
416
|
+
"session_type",
|
|
417
|
+
"regular_duration",
|
|
418
|
+
"step_duration",
|
|
419
|
+
"trial_duration",
|
|
420
|
+
"regular_prep_duration",
|
|
421
|
+
"regular_post_duration",
|
|
422
|
+
"trial_prep_duration",
|
|
423
|
+
"trial_post_duration",
|
|
424
|
+
"trial_requires_resource",
|
|
425
|
+
"accepts_trials",
|
|
426
|
+
"product_group_id",
|
|
427
|
+
"name",
|
|
428
|
+
"description",
|
|
429
|
+
"gender",
|
|
430
|
+
"min_age",
|
|
431
|
+
"max_age",
|
|
432
|
+
"archived"
|
|
433
|
+
]
|
|
347
434
|
},
|
|
348
435
|
{
|
|
349
436
|
"action": "show",
|
|
350
437
|
"verb": "GET",
|
|
351
|
-
"path": "/2026-07-02/products/:id"
|
|
438
|
+
"path": "/2026-07-02/products/:id",
|
|
439
|
+
"scope": "offers:read"
|
|
440
|
+
},
|
|
441
|
+
{
|
|
442
|
+
"action": "update",
|
|
443
|
+
"verb": "PATCH",
|
|
444
|
+
"path": "/2026-07-02/products/:id",
|
|
445
|
+
"scope": "offers:write",
|
|
446
|
+
"params": [
|
|
447
|
+
"position",
|
|
448
|
+
"product_type",
|
|
449
|
+
"session_type",
|
|
450
|
+
"regular_duration",
|
|
451
|
+
"step_duration",
|
|
452
|
+
"trial_duration",
|
|
453
|
+
"regular_prep_duration",
|
|
454
|
+
"regular_post_duration",
|
|
455
|
+
"trial_prep_duration",
|
|
456
|
+
"trial_post_duration",
|
|
457
|
+
"trial_requires_resource",
|
|
458
|
+
"accepts_trials",
|
|
459
|
+
"product_group_id",
|
|
460
|
+
"name",
|
|
461
|
+
"description",
|
|
462
|
+
"gender",
|
|
463
|
+
"min_age",
|
|
464
|
+
"max_age",
|
|
465
|
+
"archived"
|
|
466
|
+
]
|
|
352
467
|
}
|
|
353
468
|
],
|
|
354
469
|
"sessions": [
|
|
355
470
|
{
|
|
356
471
|
"action": "index",
|
|
357
472
|
"verb": "GET",
|
|
358
|
-
"path": "/2026-07-02/sessions"
|
|
473
|
+
"path": "/2026-07-02/sessions",
|
|
474
|
+
"scope": "schedule:read"
|
|
475
|
+
},
|
|
476
|
+
{
|
|
477
|
+
"action": "create",
|
|
478
|
+
"verb": "POST",
|
|
479
|
+
"path": "/2026-07-02/sessions",
|
|
480
|
+
"scope": "schedule:write",
|
|
481
|
+
"params": [
|
|
482
|
+
"location_id",
|
|
483
|
+
"type",
|
|
484
|
+
"start_time",
|
|
485
|
+
"end_time",
|
|
486
|
+
"product_id",
|
|
487
|
+
"trial",
|
|
488
|
+
"max_seats",
|
|
489
|
+
"max_trials",
|
|
490
|
+
"program",
|
|
491
|
+
"grade",
|
|
492
|
+
"min_age",
|
|
493
|
+
"max_age",
|
|
494
|
+
"start_date",
|
|
495
|
+
"end_date",
|
|
496
|
+
"interval",
|
|
497
|
+
"day_id",
|
|
498
|
+
{
|
|
499
|
+
"holiday_ids": []
|
|
500
|
+
}
|
|
501
|
+
]
|
|
359
502
|
},
|
|
360
503
|
{
|
|
361
504
|
"action": "show",
|
|
362
505
|
"verb": "GET",
|
|
363
|
-
"path": "/2026-07-02/sessions/:id"
|
|
506
|
+
"path": "/2026-07-02/sessions/:id",
|
|
507
|
+
"scope": "schedule:read"
|
|
508
|
+
},
|
|
509
|
+
{
|
|
510
|
+
"action": "update",
|
|
511
|
+
"verb": "PATCH",
|
|
512
|
+
"path": "/2026-07-02/sessions/:id",
|
|
513
|
+
"scope": "schedule:write",
|
|
514
|
+
"params": [
|
|
515
|
+
"start_time",
|
|
516
|
+
"end_time",
|
|
517
|
+
"product_id",
|
|
518
|
+
"trial",
|
|
519
|
+
"max_seats",
|
|
520
|
+
"max_trials",
|
|
521
|
+
"program",
|
|
522
|
+
"grade",
|
|
523
|
+
"min_age",
|
|
524
|
+
"max_age",
|
|
525
|
+
"start_date",
|
|
526
|
+
"end_date",
|
|
527
|
+
"interval",
|
|
528
|
+
"day_id",
|
|
529
|
+
{
|
|
530
|
+
"holiday_ids": []
|
|
531
|
+
}
|
|
532
|
+
]
|
|
533
|
+
},
|
|
534
|
+
{
|
|
535
|
+
"action": "destroy",
|
|
536
|
+
"verb": "DELETE",
|
|
537
|
+
"path": "/2026-07-02/sessions/:id",
|
|
538
|
+
"scope": "schedule:write"
|
|
364
539
|
}
|
|
365
540
|
],
|
|
366
541
|
"events": [
|
|
367
542
|
{
|
|
368
543
|
"action": "index",
|
|
369
544
|
"verb": "GET",
|
|
370
|
-
"path": "/2026-07-02/events"
|
|
545
|
+
"path": "/2026-07-02/events",
|
|
546
|
+
"scope": "schedule:read"
|
|
547
|
+
},
|
|
548
|
+
{
|
|
549
|
+
"action": "create",
|
|
550
|
+
"verb": "POST",
|
|
551
|
+
"path": "/2026-07-02/events",
|
|
552
|
+
"scope": "schedule:write",
|
|
553
|
+
"params": [
|
|
554
|
+
"event_detail_id",
|
|
555
|
+
"title",
|
|
556
|
+
"canceled",
|
|
557
|
+
"open_for_enrollment",
|
|
558
|
+
"enrollment_deadline_at",
|
|
559
|
+
{
|
|
560
|
+
"address_attributes": [
|
|
561
|
+
"street",
|
|
562
|
+
"zip",
|
|
563
|
+
"city",
|
|
564
|
+
"country_code"
|
|
565
|
+
]
|
|
566
|
+
},
|
|
567
|
+
{
|
|
568
|
+
"event_parts_attributes": [
|
|
569
|
+
"id",
|
|
570
|
+
"_destroy",
|
|
571
|
+
"title",
|
|
572
|
+
"starts_at",
|
|
573
|
+
"ends_at"
|
|
574
|
+
]
|
|
575
|
+
}
|
|
576
|
+
]
|
|
371
577
|
},
|
|
372
578
|
{
|
|
373
579
|
"action": "show",
|
|
374
580
|
"verb": "GET",
|
|
375
|
-
"path": "/2026-07-02/events/:id"
|
|
581
|
+
"path": "/2026-07-02/events/:id",
|
|
582
|
+
"scope": "schedule:read"
|
|
583
|
+
},
|
|
584
|
+
{
|
|
585
|
+
"action": "update",
|
|
586
|
+
"verb": "PATCH",
|
|
587
|
+
"path": "/2026-07-02/events/:id",
|
|
588
|
+
"scope": "schedule:write",
|
|
589
|
+
"params": [
|
|
590
|
+
"title",
|
|
591
|
+
"canceled",
|
|
592
|
+
"open_for_enrollment",
|
|
593
|
+
"enrollment_deadline_at",
|
|
594
|
+
{
|
|
595
|
+
"address_attributes": [
|
|
596
|
+
"street",
|
|
597
|
+
"zip",
|
|
598
|
+
"city",
|
|
599
|
+
"country_code"
|
|
600
|
+
]
|
|
601
|
+
},
|
|
602
|
+
{
|
|
603
|
+
"event_parts_attributes": [
|
|
604
|
+
"id",
|
|
605
|
+
"_destroy",
|
|
606
|
+
"title",
|
|
607
|
+
"starts_at",
|
|
608
|
+
"ends_at"
|
|
609
|
+
]
|
|
610
|
+
}
|
|
611
|
+
]
|
|
612
|
+
},
|
|
613
|
+
{
|
|
614
|
+
"action": "destroy",
|
|
615
|
+
"verb": "DELETE",
|
|
616
|
+
"path": "/2026-07-02/events/:id",
|
|
617
|
+
"scope": "schedule:write"
|
|
376
618
|
}
|
|
377
619
|
],
|
|
378
620
|
"event_details": [
|
|
379
621
|
{
|
|
380
622
|
"action": "index",
|
|
381
623
|
"verb": "GET",
|
|
382
|
-
"path": "/2026-07-02/event_details"
|
|
624
|
+
"path": "/2026-07-02/event_details",
|
|
625
|
+
"scope": "offers:read"
|
|
626
|
+
},
|
|
627
|
+
{
|
|
628
|
+
"action": "create",
|
|
629
|
+
"verb": "POST",
|
|
630
|
+
"path": "/2026-07-02/event_details",
|
|
631
|
+
"scope": "offers:write",
|
|
632
|
+
"params": [
|
|
633
|
+
"position",
|
|
634
|
+
"title",
|
|
635
|
+
"event_category_id",
|
|
636
|
+
"slug",
|
|
637
|
+
"body",
|
|
638
|
+
{
|
|
639
|
+
"product_ids": []
|
|
640
|
+
}
|
|
641
|
+
]
|
|
383
642
|
},
|
|
384
643
|
{
|
|
385
644
|
"action": "show",
|
|
386
645
|
"verb": "GET",
|
|
387
|
-
"path": "/2026-07-02/event_details/:id"
|
|
646
|
+
"path": "/2026-07-02/event_details/:id",
|
|
647
|
+
"scope": "offers:read"
|
|
648
|
+
},
|
|
649
|
+
{
|
|
650
|
+
"action": "update",
|
|
651
|
+
"verb": "PATCH",
|
|
652
|
+
"path": "/2026-07-02/event_details/:id",
|
|
653
|
+
"scope": "offers:write",
|
|
654
|
+
"params": [
|
|
655
|
+
"position",
|
|
656
|
+
"title",
|
|
657
|
+
"event_category_id",
|
|
658
|
+
"slug",
|
|
659
|
+
"body",
|
|
660
|
+
{
|
|
661
|
+
"product_ids": []
|
|
662
|
+
}
|
|
663
|
+
]
|
|
388
664
|
}
|
|
389
665
|
],
|
|
390
666
|
"posts": [
|
|
391
667
|
{
|
|
392
668
|
"action": "index",
|
|
393
669
|
"verb": "GET",
|
|
394
|
-
"path": "/2026-07-02/posts"
|
|
670
|
+
"path": "/2026-07-02/posts",
|
|
671
|
+
"scope": "website:read"
|
|
672
|
+
},
|
|
673
|
+
{
|
|
674
|
+
"action": "create",
|
|
675
|
+
"verb": "POST",
|
|
676
|
+
"path": "/2026-07-02/posts",
|
|
677
|
+
"scope": "website:write",
|
|
678
|
+
"params": [
|
|
679
|
+
"title",
|
|
680
|
+
"body",
|
|
681
|
+
"slug",
|
|
682
|
+
"published",
|
|
683
|
+
"rel_canonical",
|
|
684
|
+
{
|
|
685
|
+
"location_ids": []
|
|
686
|
+
},
|
|
687
|
+
{
|
|
688
|
+
"product_ids": []
|
|
689
|
+
},
|
|
690
|
+
"published_at"
|
|
691
|
+
]
|
|
395
692
|
},
|
|
396
693
|
{
|
|
397
694
|
"action": "show",
|
|
398
695
|
"verb": "GET",
|
|
399
|
-
"path": "/2026-07-02/posts/:id"
|
|
696
|
+
"path": "/2026-07-02/posts/:id",
|
|
697
|
+
"scope": "website:read"
|
|
698
|
+
},
|
|
699
|
+
{
|
|
700
|
+
"action": "update",
|
|
701
|
+
"verb": "PATCH",
|
|
702
|
+
"path": "/2026-07-02/posts/:id",
|
|
703
|
+
"scope": "website:write",
|
|
704
|
+
"params": [
|
|
705
|
+
"title",
|
|
706
|
+
"body",
|
|
707
|
+
"slug",
|
|
708
|
+
"published",
|
|
709
|
+
"rel_canonical",
|
|
710
|
+
{
|
|
711
|
+
"location_ids": []
|
|
712
|
+
},
|
|
713
|
+
{
|
|
714
|
+
"product_ids": []
|
|
715
|
+
},
|
|
716
|
+
"published_at"
|
|
717
|
+
]
|
|
718
|
+
},
|
|
719
|
+
{
|
|
720
|
+
"action": "destroy",
|
|
721
|
+
"verb": "DELETE",
|
|
722
|
+
"path": "/2026-07-02/posts/:id",
|
|
723
|
+
"scope": "website:write"
|
|
400
724
|
}
|
|
401
725
|
],
|
|
402
726
|
"staff_teams": [
|
|
403
727
|
{
|
|
404
728
|
"action": "index",
|
|
405
729
|
"verb": "GET",
|
|
406
|
-
"path": "/2026-07-02/staff_teams"
|
|
730
|
+
"path": "/2026-07-02/staff_teams",
|
|
731
|
+
"scope": "website:read"
|
|
732
|
+
},
|
|
733
|
+
{
|
|
734
|
+
"action": "create",
|
|
735
|
+
"verb": "POST",
|
|
736
|
+
"path": "/2026-07-02/staff_teams",
|
|
737
|
+
"scope": "website:write",
|
|
738
|
+
"params": [
|
|
739
|
+
"name",
|
|
740
|
+
"location_id",
|
|
741
|
+
"position"
|
|
742
|
+
]
|
|
407
743
|
},
|
|
408
744
|
{
|
|
409
745
|
"action": "show",
|
|
410
746
|
"verb": "GET",
|
|
411
|
-
"path": "/2026-07-02/staff_teams/:id"
|
|
747
|
+
"path": "/2026-07-02/staff_teams/:id",
|
|
748
|
+
"scope": "website:read"
|
|
749
|
+
},
|
|
750
|
+
{
|
|
751
|
+
"action": "update",
|
|
752
|
+
"verb": "PATCH",
|
|
753
|
+
"path": "/2026-07-02/staff_teams/:id",
|
|
754
|
+
"scope": "website:write",
|
|
755
|
+
"params": [
|
|
756
|
+
"name",
|
|
757
|
+
"location_id",
|
|
758
|
+
"position"
|
|
759
|
+
]
|
|
760
|
+
},
|
|
761
|
+
{
|
|
762
|
+
"action": "destroy",
|
|
763
|
+
"verb": "DELETE",
|
|
764
|
+
"path": "/2026-07-02/staff_teams/:id",
|
|
765
|
+
"scope": "website:write"
|
|
412
766
|
}
|
|
413
767
|
]
|
|
414
768
|
}
|