@guildeducationinc/benefits-admin-policy-sdk 1.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.
Files changed (50) hide show
  1. package/README.md +78 -0
  2. package/dist/adapters/index.d.ts +3 -0
  3. package/dist/adapters/index.d.ts.map +1 -0
  4. package/dist/adapters/index.js +6 -0
  5. package/dist/adapters/index.js.map +1 -0
  6. package/dist/adapters/s3-adapter.d.ts +41 -0
  7. package/dist/adapters/s3-adapter.d.ts.map +1 -0
  8. package/dist/adapters/s3-adapter.js +96 -0
  9. package/dist/adapters/s3-adapter.js.map +1 -0
  10. package/dist/clients/policy-client.d.ts +141 -0
  11. package/dist/clients/policy-client.d.ts.map +1 -0
  12. package/dist/clients/policy-client.js +427 -0
  13. package/dist/clients/policy-client.js.map +1 -0
  14. package/dist/constants.d.ts +18 -0
  15. package/dist/constants.d.ts.map +1 -0
  16. package/dist/constants.js +21 -0
  17. package/dist/constants.js.map +1 -0
  18. package/dist/errors/index.d.ts +38 -0
  19. package/dist/errors/index.d.ts.map +1 -0
  20. package/dist/errors/index.js +75 -0
  21. package/dist/errors/index.js.map +1 -0
  22. package/dist/guildeducationinc-benefits-admin-policy-sdk-1.1.0.tgz +0 -0
  23. package/dist/index.d.ts +7 -0
  24. package/dist/index.d.ts.map +1 -0
  25. package/dist/index.js +22 -0
  26. package/dist/index.js.map +1 -0
  27. package/dist/models/index.d.ts +8 -0
  28. package/dist/models/index.d.ts.map +1 -0
  29. package/dist/models/index.js +7 -0
  30. package/dist/models/index.js.map +1 -0
  31. package/dist/models/policy-override.d.ts +528 -0
  32. package/dist/models/policy-override.d.ts.map +1 -0
  33. package/dist/models/policy-override.js +7 -0
  34. package/dist/models/policy-override.js.map +1 -0
  35. package/dist/models/policy-version.d.ts +948 -0
  36. package/dist/models/policy-version.d.ts.map +1 -0
  37. package/dist/models/policy-version.js +7 -0
  38. package/dist/models/policy-version.js.map +1 -0
  39. package/dist/models/policy.d.ts +34 -0
  40. package/dist/models/policy.d.ts.map +1 -0
  41. package/dist/models/policy.js +7 -0
  42. package/dist/models/policy.js.map +1 -0
  43. package/dist/schemas/index.d.ts +23 -0
  44. package/dist/schemas/index.d.ts.map +1 -0
  45. package/dist/schemas/index.js +31 -0
  46. package/dist/schemas/index.js.map +1 -0
  47. package/dist/schemas/policy-override.schema.json +627 -0
  48. package/dist/schemas/policy-version.schema.json +1242 -0
  49. package/dist/schemas/policy.schema.json +31 -0
  50. package/package.json +64 -0
@@ -0,0 +1,627 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://guild.com/schemas/policy/policy-override.schema.json",
4
+ "title": "PolicyOverride",
5
+ "description": "Defines overrides that can be applied to a Policy to modify behavior for specific employees or populations. Overrides allow temporary or permanent changes to eligibility, funding limits, restrictions, and benefits without modifying the underlying Policy Version.",
6
+ "oneOf": [
7
+ { "$ref": "#/$defs/EligibilityOverride" },
8
+ { "$ref": "#/$defs/TuitionFundingLimitOverride" },
9
+ { "$ref": "#/$defs/AchievementRestrictionOverride" },
10
+ { "$ref": "#/$defs/ProgramAssociatedExpensesOverride" },
11
+ { "$ref": "#/$defs/PopulationOutcomeOverride" },
12
+ { "$ref": "#/$defs/ProfExpBenefitOverride" },
13
+ { "$ref": "#/$defs/TRBenefitOverride" }
14
+ ],
15
+ "$defs": {
16
+ "EntirePopulationScope": {
17
+ "type": "object",
18
+ "description": "Scope for entire population at an employer.",
19
+ "properties": {
20
+ "type": {
21
+ "type": "string",
22
+ "const": "entire_population"
23
+ },
24
+ "population_id": {
25
+ "type": "string",
26
+ "description": "Affected population ID"
27
+ }
28
+ },
29
+ "required": ["type", "population_id"]
30
+ },
31
+ "SpecificEmployeesScope": {
32
+ "type": "object",
33
+ "description": "Scope for a specific, hard-coded list of employee IDs.",
34
+ "properties": {
35
+ "type": {
36
+ "type": "string",
37
+ "const": "specific_employees"
38
+ },
39
+ "employee_ids": {
40
+ "type": "array",
41
+ "description": "List of all affected employee IDs",
42
+ "items": {
43
+ "type": "string"
44
+ }
45
+ }
46
+ },
47
+ "required": ["type", "employee_ids"]
48
+ },
49
+ "EmployeeScope": {
50
+ "description": "The scope of employees affected by this override.",
51
+ "oneOf": [
52
+ { "$ref": "#/$defs/EntirePopulationScope" },
53
+ { "$ref": "#/$defs/SpecificEmployeesScope" }
54
+ ]
55
+ },
56
+ "OverrideBenefitTarget": {
57
+ "type": "object",
58
+ "description": "The specific benefit affected by this override.",
59
+ "properties": {
60
+ "benefit_id": {
61
+ "type": "string",
62
+ "description": "Benefit ID override will apply to"
63
+ }
64
+ },
65
+ "required": ["benefit_id"]
66
+ },
67
+ "OverridePopulationTarget": {
68
+ "type": "object",
69
+ "description": "The specific population affected by this override.",
70
+ "properties": {
71
+ "population_id": {
72
+ "type": "string",
73
+ "description": "Population ID override will apply to"
74
+ }
75
+ },
76
+ "required": ["population_id"]
77
+ },
78
+ "AchievementRestrictionPattern": {
79
+ "type": "string",
80
+ "pattern": "^(?:\\*|[a-z-]+(\\.[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}|\\*))$",
81
+ "description": "Dot notation pattern for achievement restrictions. Format: 'achievementType.fieldOfStudyId', 'achievementType.*', or '*' for all."
82
+ },
83
+ "AchievementRestrictionOperation": {
84
+ "type": "object",
85
+ "description": "Add or remove operations for achievement restriction patterns.",
86
+ "properties": {
87
+ "add": {
88
+ "type": "array",
89
+ "items": {
90
+ "$ref": "#/$defs/AchievementRestrictionPattern"
91
+ },
92
+ "description": "Dot notation patterns to add to the list."
93
+ },
94
+ "remove": {
95
+ "type": "array",
96
+ "items": {
97
+ "$ref": "#/$defs/AchievementRestrictionPattern"
98
+ },
99
+ "description": "Dot notation patterns to remove from the list."
100
+ }
101
+ }
102
+ },
103
+ "AchievementRestrictionChanges": {
104
+ "type": "object",
105
+ "description": "Changes to achievement restrictions with add/remove operations.",
106
+ "properties": {
107
+ "allow": {
108
+ "$ref": "#/$defs/AchievementRestrictionOperation"
109
+ },
110
+ "deny": {
111
+ "$ref": "#/$defs/AchievementRestrictionOperation"
112
+ }
113
+ },
114
+ "required": ["allow", "deny"]
115
+ },
116
+ "FundingLimit": {
117
+ "type": "object",
118
+ "description": "Defines the funding limit for a benefit or expense type.",
119
+ "properties": {
120
+ "id": {
121
+ "type": "string",
122
+ "description": "The ID of the Funding Limit"
123
+ },
124
+ "funding_type": {
125
+ "type": "string",
126
+ "enum": ["unlimited", "capped", "notFunded", "untrackedByPolicy"]
127
+ },
128
+ "value": {
129
+ "type": ["number", "null"]
130
+ }
131
+ },
132
+ "required": ["id", "funding_type", "value"]
133
+ },
134
+ "EligibilityOverride": {
135
+ "type": "object",
136
+ "description": "Override ALL covered benefits to available for a user (no target).",
137
+ "properties": {
138
+ "id": {
139
+ "type": "string",
140
+ "description": "Unique ID to identify an individual override (generated by API)"
141
+ },
142
+ "type": {
143
+ "type": "string",
144
+ "const": "eligibility_outcome"
145
+ },
146
+ "effective_start_date": {
147
+ "type": "string",
148
+ "description": "The day on which the override begins (YYYY-MM-DD)"
149
+ },
150
+ "effective_end_date": {
151
+ "type": "string",
152
+ "description": "The day on which the override ends (YYYY-MM-DD)"
153
+ },
154
+ "reason": {
155
+ "type": "string",
156
+ "description": "Cause for override to be applied"
157
+ },
158
+ "exception_reference_id": {
159
+ "type": "string",
160
+ "description": "Reference to a related exception if applicable"
161
+ },
162
+ "created_by": {
163
+ "type": "string",
164
+ "description": "The name or entity creating the Policy Override"
165
+ },
166
+ "created_at": {
167
+ "type": "string",
168
+ "format": "date-time",
169
+ "description": "The date and time when the override was created (generated by API)"
170
+ },
171
+ "action": {
172
+ "type": "object",
173
+ "properties": {
174
+ "type": {
175
+ "type": "string",
176
+ "const": "set_eligibility_outcome"
177
+ },
178
+ "eligibility_outcome": {
179
+ "type": "boolean",
180
+ "description": "Declared eligibility state"
181
+ }
182
+ },
183
+ "required": ["type", "eligibility_outcome"]
184
+ },
185
+ "employee_scope": {
186
+ "$ref": "#/$defs/SpecificEmployeesScope"
187
+ }
188
+ },
189
+ "required": ["type", "effective_start_date", "effective_end_date", "reason", "created_by", "action", "employee_scope"]
190
+ },
191
+ "TuitionFundingLimitOverride": {
192
+ "type": "object",
193
+ "description": "Override for tuition funding limits.",
194
+ "properties": {
195
+ "id": {
196
+ "type": "string",
197
+ "description": "Unique ID to identify an individual override (generated by API)"
198
+ },
199
+ "type": {
200
+ "type": "string",
201
+ "const": "tuition_funding_limit"
202
+ },
203
+ "effective_start_date": {
204
+ "type": "string",
205
+ "description": "The day on which the override begins (YYYY-MM-DD)"
206
+ },
207
+ "effective_end_date": {
208
+ "type": "string",
209
+ "description": "The day on which the override ends (YYYY-MM-DD)"
210
+ },
211
+ "reason": {
212
+ "type": "string",
213
+ "description": "Cause for override to be applied"
214
+ },
215
+ "exception_reference_id": {
216
+ "type": "string",
217
+ "description": "Reference to a related exception if applicable"
218
+ },
219
+ "created_by": {
220
+ "type": "string",
221
+ "description": "The name or entity creating the Policy Override"
222
+ },
223
+ "created_at": {
224
+ "type": "string",
225
+ "format": "date-time",
226
+ "description": "The date and time when the override was created (generated by API)"
227
+ },
228
+ "action": {
229
+ "type": "object",
230
+ "properties": {
231
+ "type": {
232
+ "type": "string",
233
+ "const": "set_tuition_funding_limit"
234
+ },
235
+ "tuition": {
236
+ "description": "Declared tuition type and amount",
237
+ "$ref": "#/$defs/FundingLimit"
238
+ }
239
+ },
240
+ "required": ["type", "tuition"]
241
+ },
242
+ "target": {
243
+ "$ref": "#/$defs/OverrideBenefitTarget"
244
+ },
245
+ "employee_scope": {
246
+ "$ref": "#/$defs/EmployeeScope"
247
+ }
248
+ },
249
+ "required": ["type", "effective_start_date", "effective_end_date", "reason", "created_by", "action", "target", "employee_scope"]
250
+ },
251
+ "AchievementRestrictionOverride": {
252
+ "type": "object",
253
+ "description": "Override for achievement restrictions.",
254
+ "properties": {
255
+ "id": {
256
+ "type": "string",
257
+ "description": "Unique ID to identify an individual override (generated by API)"
258
+ },
259
+ "type": {
260
+ "type": "string",
261
+ "const": "achievement_restriction"
262
+ },
263
+ "effective_start_date": {
264
+ "type": "string",
265
+ "description": "The day on which the override begins (YYYY-MM-DD)"
266
+ },
267
+ "effective_end_date": {
268
+ "type": "string",
269
+ "description": "The day on which the override ends (YYYY-MM-DD)"
270
+ },
271
+ "reason": {
272
+ "type": "string",
273
+ "description": "Cause for override to be applied"
274
+ },
275
+ "exception_reference_id": {
276
+ "type": "string",
277
+ "description": "Reference to a related exception if applicable"
278
+ },
279
+ "created_by": {
280
+ "type": "string",
281
+ "description": "The name or entity creating the Policy Override"
282
+ },
283
+ "created_at": {
284
+ "type": "string",
285
+ "format": "date-time",
286
+ "description": "The date and time when the override was created (generated by API)"
287
+ },
288
+ "action": {
289
+ "type": "object",
290
+ "properties": {
291
+ "type": {
292
+ "type": "string",
293
+ "const": "change_achievement_restriction"
294
+ },
295
+ "changes": {
296
+ "description": "Changes to achievement restrictions with add/remove operations",
297
+ "$ref": "#/$defs/AchievementRestrictionChanges"
298
+ }
299
+ },
300
+ "required": ["type", "changes"]
301
+ },
302
+ "target": {
303
+ "$ref": "#/$defs/OverrideBenefitTarget"
304
+ },
305
+ "employee_scope": {
306
+ "$ref": "#/$defs/EmployeeScope"
307
+ }
308
+ },
309
+ "required": ["type", "effective_start_date", "effective_end_date", "reason", "created_by", "action", "target", "employee_scope"]
310
+ },
311
+ "ProgramAssociatedExpenseType": {
312
+ "type": "object",
313
+ "description": "A program associated expense type with funding limit for books and fees.",
314
+ "properties": {
315
+ "expense_type_id": {
316
+ "type": "string",
317
+ "description": "Must be the books and fees expense type ID",
318
+ "enum": ["ea2c9567-4c57-4a1b-be28-16935f23ecfb"]
319
+ },
320
+ "funding_limit": {
321
+ "$ref": "#/$defs/FundingLimit"
322
+ }
323
+ },
324
+ "required": ["expense_type_id", "funding_limit"]
325
+ },
326
+ "Funding": {
327
+ "type": "object",
328
+ "description": "All funding related information, collected and formatted for Payments consumers.",
329
+ "properties": {
330
+ "expense_type": {
331
+ "type": "object",
332
+ "properties": {
333
+ "id": {
334
+ "type": "string",
335
+ "description": "The ID of the Expense Type"
336
+ },
337
+ "type": {
338
+ "type": "string",
339
+ "description": "The slug of the Expense Type",
340
+ "enum": [
341
+ "tuition_and_fees",
342
+ "student_loan_repayment",
343
+ "professional_expenses",
344
+ "program_associated_expenses"
345
+ ]
346
+ }
347
+ },
348
+ "required": ["id", "type"]
349
+ },
350
+ "funding_limit": {
351
+ "$ref": "#/$defs/FundingLimit"
352
+ },
353
+ "tax_gross_up": {
354
+ "type": "boolean",
355
+ "description": "Indicates whether the Benefit is subject to tax gross-up."
356
+ },
357
+ "tax_section": {
358
+ "type": "string",
359
+ "enum": ["117", "127", "132", "not-applicable"]
360
+ },
361
+ "is_additional_funding": {
362
+ "type": "boolean",
363
+ "description": "Whether or not the funding should contribute to the Tuition funding limit, or is separate from it."
364
+ }
365
+ },
366
+ "required": ["expense_type", "funding_limit", "tax_gross_up", "tax_section", "is_additional_funding"]
367
+ },
368
+ "ProgramAssociatedExpensesOverride": {
369
+ "type": "object",
370
+ "description": "Override for program associated expenses (books and fees).",
371
+ "properties": {
372
+ "id": {
373
+ "type": "string",
374
+ "description": "Unique ID to identify an individual override (generated by API)"
375
+ },
376
+ "type": {
377
+ "type": "string",
378
+ "const": "program_associated_expenses"
379
+ },
380
+ "effective_start_date": {
381
+ "type": "string",
382
+ "description": "The day on which the override begins (YYYY-MM-DD)"
383
+ },
384
+ "effective_end_date": {
385
+ "type": "string",
386
+ "description": "The day on which the override ends (YYYY-MM-DD)"
387
+ },
388
+ "reason": {
389
+ "type": "string",
390
+ "description": "Cause for override to be applied"
391
+ },
392
+ "exception_reference_id": {
393
+ "type": "string",
394
+ "description": "Reference to a related exception if applicable"
395
+ },
396
+ "created_by": {
397
+ "type": "string",
398
+ "description": "The name or entity creating the Policy Override"
399
+ },
400
+ "created_at": {
401
+ "type": "string",
402
+ "format": "date-time",
403
+ "description": "The date and time when the override was created (generated by API)"
404
+ },
405
+ "action": {
406
+ "type": "object",
407
+ "properties": {
408
+ "type": {
409
+ "type": "string",
410
+ "const": "edit_program_associated_expenses"
411
+ },
412
+ "program_associated_expenses": {
413
+ "type": "object",
414
+ "description": "Declared program associated expenses with add operations",
415
+ "properties": {
416
+ "add": {
417
+ "type": "array",
418
+ "description": "Array of program associated expense types to add",
419
+ "items": {
420
+ "$ref": "#/$defs/ProgramAssociatedExpenseType"
421
+ }
422
+ }
423
+ },
424
+ "required": ["add"]
425
+ },
426
+ "funding": {
427
+ "type": "object",
428
+ "description": "Declared program associated expenses funding with add operation",
429
+ "properties": {
430
+ "add": {
431
+ "type": "array",
432
+ "description": "Array of program associated expense type funding entries to add",
433
+ "items": {
434
+ "$ref": "#/$defs/Funding"
435
+ }
436
+ }
437
+ },
438
+ "required": ["add"]
439
+ }
440
+ },
441
+ "required": ["type", "program_associated_expenses"]
442
+ },
443
+ "target": {
444
+ "$ref": "#/$defs/OverrideBenefitTarget"
445
+ },
446
+ "employee_scope": {
447
+ "$ref": "#/$defs/EmployeeScope"
448
+ }
449
+ },
450
+ "required": ["type", "effective_start_date", "effective_end_date", "reason", "created_by", "action", "target", "employee_scope"]
451
+ },
452
+ "PopulationOutcomeOverride": {
453
+ "type": "object",
454
+ "description": "Override to place specific user(s) into a given population.",
455
+ "properties": {
456
+ "id": {
457
+ "type": "string",
458
+ "description": "Unique ID to identify an individual override (generated by API)"
459
+ },
460
+ "type": {
461
+ "type": "string",
462
+ "const": "population_outcome"
463
+ },
464
+ "effective_start_date": {
465
+ "type": "string",
466
+ "description": "The day on which the override begins (YYYY-MM-DD)"
467
+ },
468
+ "effective_end_date": {
469
+ "type": "string",
470
+ "description": "The day on which the override ends (YYYY-MM-DD)"
471
+ },
472
+ "reason": {
473
+ "type": "string",
474
+ "description": "Cause for override to be applied"
475
+ },
476
+ "exception_reference_id": {
477
+ "type": "string",
478
+ "description": "Reference to a related exception if applicable"
479
+ },
480
+ "created_by": {
481
+ "type": "string",
482
+ "description": "The name or entity creating the Policy Override"
483
+ },
484
+ "created_at": {
485
+ "type": "string",
486
+ "format": "date-time",
487
+ "description": "The date and time when the override was created (generated by API)"
488
+ },
489
+ "action": {
490
+ "type": "object",
491
+ "properties": {
492
+ "type": {
493
+ "type": "string",
494
+ "const": "set_population_outcome"
495
+ },
496
+ "population_outcome": {
497
+ "type": "boolean",
498
+ "description": "Declared population inclusion"
499
+ }
500
+ },
501
+ "required": ["type", "population_outcome"]
502
+ },
503
+ "target": {
504
+ "$ref": "#/$defs/OverridePopulationTarget"
505
+ },
506
+ "employee_scope": {
507
+ "$ref": "#/$defs/SpecificEmployeesScope"
508
+ }
509
+ },
510
+ "required": ["type", "effective_start_date", "effective_end_date", "reason", "created_by", "action", "target", "employee_scope"]
511
+ },
512
+ "ProfExpBenefitOverride": {
513
+ "type": "object",
514
+ "description": "Create net new, Policy-shaped Professional Expenses Benefit.",
515
+ "properties": {
516
+ "id": {
517
+ "type": "string",
518
+ "description": "Unique ID to identify an individual override (generated by API)"
519
+ },
520
+ "type": {
521
+ "type": "string",
522
+ "const": "prof_exp_benefit"
523
+ },
524
+ "effective_start_date": {
525
+ "type": "string",
526
+ "description": "The day on which the override begins (YYYY-MM-DD)"
527
+ },
528
+ "effective_end_date": {
529
+ "type": "string",
530
+ "description": "The day on which the override ends (YYYY-MM-DD)"
531
+ },
532
+ "reason": {
533
+ "type": "string",
534
+ "description": "Cause for override to be applied"
535
+ },
536
+ "exception_reference_id": {
537
+ "type": "string",
538
+ "description": "Reference to a related exception if applicable"
539
+ },
540
+ "created_by": {
541
+ "type": "string",
542
+ "description": "The name or entity creating the Policy Override"
543
+ },
544
+ "created_at": {
545
+ "type": "string",
546
+ "format": "date-time",
547
+ "description": "The date and time when the override was created (generated by API)"
548
+ },
549
+ "action": {
550
+ "type": "object",
551
+ "properties": {
552
+ "type": {
553
+ "type": "string",
554
+ "const": "create_prof_exp_benefit"
555
+ },
556
+ "benefit": {
557
+ "description": "Declared, Policy-shaped Professional Expenses Benefit",
558
+ "type": "object"
559
+ }
560
+ },
561
+ "required": ["type", "benefit"]
562
+ },
563
+ "employee_scope": {
564
+ "$ref": "#/$defs/EmployeeScope"
565
+ }
566
+ },
567
+ "required": ["type", "effective_start_date", "effective_end_date", "reason", "created_by", "action", "employee_scope"]
568
+ },
569
+ "TRBenefitOverride": {
570
+ "type": "object",
571
+ "description": "Create net new, Policy-shaped Tuition Reimbursement Benefit.",
572
+ "properties": {
573
+ "id": {
574
+ "type": "string",
575
+ "description": "Unique ID to identify an individual override (generated by API)"
576
+ },
577
+ "type": {
578
+ "type": "string",
579
+ "const": "tr_benefit"
580
+ },
581
+ "effective_start_date": {
582
+ "type": "string",
583
+ "description": "The day on which the override begins (YYYY-MM-DD)"
584
+ },
585
+ "effective_end_date": {
586
+ "type": "string",
587
+ "description": "The day on which the override ends (YYYY-MM-DD)"
588
+ },
589
+ "reason": {
590
+ "type": "string",
591
+ "description": "Cause for override to be applied"
592
+ },
593
+ "exception_reference_id": {
594
+ "type": "string",
595
+ "description": "Reference to a related exception if applicable"
596
+ },
597
+ "created_by": {
598
+ "type": "string",
599
+ "description": "The name or entity creating the Policy Override"
600
+ },
601
+ "created_at": {
602
+ "type": "string",
603
+ "format": "date-time",
604
+ "description": "The date and time when the override was created (generated by API)"
605
+ },
606
+ "action": {
607
+ "type": "object",
608
+ "properties": {
609
+ "type": {
610
+ "type": "string",
611
+ "const": "create_tr_benefit"
612
+ },
613
+ "benefit": {
614
+ "description": "Declared, Policy-shaped Tuition Reimbursement Benefit with payment_modality = tuition_reimbursement",
615
+ "type": "object"
616
+ }
617
+ },
618
+ "required": ["type", "benefit"]
619
+ },
620
+ "employee_scope": {
621
+ "$ref": "#/$defs/EmployeeScope"
622
+ }
623
+ },
624
+ "required": ["type", "effective_start_date", "effective_end_date", "reason", "created_by", "action", "employee_scope"]
625
+ }
626
+ }
627
+ }