@rippling/rippling-sdk 0.2.0-alpha.79 → 0.2.0-alpha.81

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 (87) hide show
  1. package/client.d.mts +2 -2
  2. package/client.d.mts.map +1 -1
  3. package/client.d.ts +2 -2
  4. package/client.d.ts.map +1 -1
  5. package/client.js.map +1 -1
  6. package/client.mjs.map +1 -1
  7. package/examples/manifest/custom-skill/custom-skill.ts +45 -0
  8. package/lib/manifest/agent.d.mts +60 -0
  9. package/lib/manifest/agent.d.mts.map +1 -0
  10. package/lib/manifest/agent.d.ts +60 -0
  11. package/lib/manifest/agent.d.ts.map +1 -0
  12. package/lib/manifest/agent.js +94 -0
  13. package/lib/manifest/agent.js.map +1 -0
  14. package/lib/manifest/agent.mjs +90 -0
  15. package/lib/manifest/agent.mjs.map +1 -0
  16. package/lib/manifest/custom-field.d.mts +2 -2
  17. package/lib/manifest/custom-field.d.mts.map +1 -1
  18. package/lib/manifest/custom-field.d.ts +2 -2
  19. package/lib/manifest/custom-field.d.ts.map +1 -1
  20. package/lib/manifest/custom-field.js +6 -6
  21. package/lib/manifest/custom-field.js.map +1 -1
  22. package/lib/manifest/custom-field.mjs +6 -6
  23. package/lib/manifest/custom-field.mjs.map +1 -1
  24. package/lib/manifest/custom-skill.d.mts +115 -0
  25. package/lib/manifest/custom-skill.d.mts.map +1 -0
  26. package/lib/manifest/custom-skill.d.ts +115 -0
  27. package/lib/manifest/custom-skill.d.ts.map +1 -0
  28. package/lib/manifest/custom-skill.js +127 -0
  29. package/lib/manifest/custom-skill.js.map +1 -0
  30. package/lib/manifest/custom-skill.mjs +123 -0
  31. package/lib/manifest/custom-skill.mjs.map +1 -0
  32. package/lib/manifest/existing-manifest-context.d.mts +7 -0
  33. package/lib/manifest/existing-manifest-context.d.mts.map +1 -1
  34. package/lib/manifest/existing-manifest-context.d.ts +7 -0
  35. package/lib/manifest/existing-manifest-context.d.ts.map +1 -1
  36. package/lib/manifest/existing-manifest-context.js +34 -0
  37. package/lib/manifest/existing-manifest-context.js.map +1 -1
  38. package/lib/manifest/existing-manifest-context.mjs +34 -0
  39. package/lib/manifest/existing-manifest-context.mjs.map +1 -1
  40. package/lib/manifest/index.d.mts +2 -0
  41. package/lib/manifest/index.d.mts.map +1 -1
  42. package/lib/manifest/index.d.ts +2 -0
  43. package/lib/manifest/index.d.ts.map +1 -1
  44. package/lib/manifest/index.js +5 -1
  45. package/lib/manifest/index.js.map +1 -1
  46. package/lib/manifest/index.mjs +2 -0
  47. package/lib/manifest/index.mjs.map +1 -1
  48. package/lib/manifest/manifest-builder.d.mts +1 -1
  49. package/lib/manifest/manifest-builder.d.mts.map +1 -1
  50. package/lib/manifest/manifest-builder.d.ts +1 -1
  51. package/lib/manifest/manifest-builder.d.ts.map +1 -1
  52. package/lib/manifest/manifest-builder.js.map +1 -1
  53. package/lib/manifest/manifest-builder.mjs.map +1 -1
  54. package/package.json +1 -1
  55. package/resources/index.d.mts +1 -1
  56. package/resources/index.d.mts.map +1 -1
  57. package/resources/index.d.ts +1 -1
  58. package/resources/index.d.ts.map +1 -1
  59. package/resources/index.js.map +1 -1
  60. package/resources/index.mjs.map +1 -1
  61. package/resources/leave-program-evaluations.d.mts +32 -2
  62. package/resources/leave-program-evaluations.d.mts.map +1 -1
  63. package/resources/leave-program-evaluations.d.ts +32 -2
  64. package/resources/leave-program-evaluations.d.ts.map +1 -1
  65. package/resources/teams.d.mts +33 -1
  66. package/resources/teams.d.mts.map +1 -1
  67. package/resources/teams.d.ts +33 -1
  68. package/resources/teams.d.ts.map +1 -1
  69. package/resources/teams.js +22 -0
  70. package/resources/teams.js.map +1 -1
  71. package/resources/teams.mjs +22 -0
  72. package/resources/teams.mjs.map +1 -1
  73. package/src/client.ts +4 -0
  74. package/src/lib/manifest/agent.ts +141 -0
  75. package/src/lib/manifest/custom-field.ts +10 -13
  76. package/src/lib/manifest/custom-skill.ts +205 -0
  77. package/src/lib/manifest/existing-manifest-context.ts +61 -0
  78. package/src/lib/manifest/index.ts +9 -0
  79. package/src/lib/manifest/manifest-builder.ts +2 -0
  80. package/src/resources/index.ts +2 -0
  81. package/src/resources/leave-program-evaluations.ts +38 -2
  82. package/src/resources/teams.ts +55 -0
  83. package/src/version.ts +1 -1
  84. package/version.d.mts +1 -1
  85. package/version.d.ts +1 -1
  86. package/version.js +1 -1
  87. package/version.mjs +1 -1
@@ -1,4 +1,5 @@
1
1
  import { App } from './app';
2
+ import { Agent } from './agent';
2
3
  import { Category } from './category';
3
4
  import { CustomField } from './custom-field';
4
5
  import { CustomFieldSection } from './custom-field-section';
@@ -6,6 +7,7 @@ import { CustomObject } from './custom-object';
6
7
  import { CustomObjectAction } from './custom-object-action';
7
8
  import { CustomObjectFieldSection } from './custom-object-field-section';
8
9
  import { CustomObjectPageLayout } from './custom-object-page-layout';
10
+ import { CustomSkill } from './custom-skill';
9
11
  import { Field } from './field';
10
12
  import { ListViewDef } from './list-view';
11
13
  import { ManifestBuilder, type ManifestComponent } from './manifest-builder';
@@ -85,6 +87,7 @@ function componentLabel(component: Record<string, any>): string {
85
87
  component['rule_id'] ??
86
88
  component['flow_id'] ??
87
89
  component['sdui_page_id'] ??
90
+ component['source_skill_id'] ??
88
91
  component['field_api_name'] ??
89
92
  component['section_id'] ??
90
93
  'unknown';
@@ -305,6 +308,15 @@ export class ExistingManifestContext {
305
308
  return this.loadFunctionComponent(component);
306
309
  }
307
310
 
311
+ loadCustomSkill(sourceSkillId: string): CustomSkill {
312
+ const component = this.findUnique(
313
+ 'CUSTOM_SKILL',
314
+ (candidate) => candidate['source_skill_id'] === sourceSkillId,
315
+ `CUSTOM_SKILL ${sourceSkillId}`,
316
+ );
317
+ return this.loadCustomSkillComponent(component);
318
+ }
319
+
308
320
  loadSduiPage(sduiPageId: string): SduiPage {
309
321
  const component = this.findUnique(
310
322
  'SDUI_PAGE',
@@ -323,8 +335,19 @@ export class ExistingManifestContext {
323
335
  return this.loadAppComponent(component);
324
336
  }
325
337
 
338
+ loadAgent(apiName: string): Agent {
339
+ const component = this.findUnique(
340
+ 'AGENT',
341
+ (candidate) => candidate['api_name'] === apiName,
342
+ `AGENT ${apiName}`,
343
+ );
344
+ return this.loadAgentComponent(component);
345
+ }
346
+
326
347
  private loadComponent(component: Record<string, any>): unknown {
327
348
  switch (component['type']) {
349
+ case 'AGENT':
350
+ return this.loadAgentComponent(component);
328
351
  case 'CUSTOM_CATEGORY':
329
352
  return this.loadCategoryComponent(component);
330
353
  case 'CUSTOM_OBJECT':
@@ -347,6 +370,8 @@ export class ExistingManifestContext {
347
370
  return this.loadValidationComponent(component);
348
371
  case 'CUSTOM_OBJECT_RECORD_TRIGGERED_FLOW':
349
372
  return this.loadRuleComponent(component);
373
+ case 'CUSTOM_SKILL':
374
+ return this.loadCustomSkillComponent(component);
350
375
  case 'FUNCTION':
351
376
  return this.loadFunctionComponent(component);
352
377
  case 'SDUI_PAGE':
@@ -538,6 +563,18 @@ export class ExistingManifestContext {
538
563
  );
539
564
  }
540
565
 
566
+ private loadCustomSkillComponent(component: Record<string, any>): CustomSkill {
567
+ const sourceSkillId = requireStringComponentField(
568
+ component,
569
+ 'source_skill_id',
570
+ CustomSkill.componentType,
571
+ );
572
+ const cacheKey = this.cacheKey('CUSTOM_SKILL', sourceSkillId);
573
+ return this.getOrLoad(cacheKey, () =>
574
+ CustomSkill._fromExistingComponent(this.getManifestBuilder(), component),
575
+ );
576
+ }
577
+
541
578
  private loadSduiPageComponent(component: Record<string, any>): SduiPage {
542
579
  const sduiPageId = requireStringComponentField(component, 'sdui_page_id', SduiPage.componentType);
543
580
  const cacheKey = this.cacheKey('SDUI_PAGE', sduiPageId);
@@ -557,6 +594,16 @@ export class ExistingManifestContext {
557
594
  });
558
595
  }
559
596
 
597
+ private loadAgentComponent(component: Record<string, any>): Agent {
598
+ const apiName = requireStringComponentField(component, 'api_name', Agent.componentType);
599
+ const cacheKey = this.cacheKey('AGENT', apiName);
600
+ return this.getOrLoad(cacheKey, () =>
601
+ Agent._fromExistingComponent(this.getManifestBuilder(), component, (sourceSkillId) =>
602
+ this.loadRequiredCustomSkillForAgent(sourceSkillId, apiName),
603
+ ),
604
+ );
605
+ }
606
+
560
607
  private loadRawComponent(component: Record<string, any>): ExistingRawComponent {
561
608
  const index = this.componentIndexes.get(component) ?? -1;
562
609
  const cacheKey = this.cacheKey('RAW', `${index}:${componentLabel(component)}`);
@@ -648,6 +695,20 @@ export class ExistingManifestContext {
648
695
  return this.loadFunctionComponent(functionComponent);
649
696
  }
650
697
 
698
+ private loadRequiredCustomSkillForAgent(sourceSkillId: string, agentApiName: string): CustomSkill {
699
+ const skillComponent = this.ofType('CUSTOM_SKILL').find(
700
+ (candidate) => candidate['source_skill_id'] === sourceSkillId,
701
+ );
702
+ if (skillComponent == null) {
703
+ throw new Error(
704
+ `AGENT ${agentApiName} references CUSTOM_SKILL ${sourceSkillId}, ` +
705
+ 'but that custom skill component is not present. Pass the full existing component extraction ' +
706
+ 'to ManifestBuilder.loadFromExistingJson(...).',
707
+ );
708
+ }
709
+ return this.loadCustomSkillComponent(skillComponent);
710
+ }
711
+
651
712
  private loadSyntheticFieldReference(customObjectApiName: string, fieldApiName: string): Field {
652
713
  const cacheKey = this.cacheKey('CUSTOM_OBJECT_FIELD_REF', `${customObjectApiName}.${fieldApiName}`);
653
714
  return this.getOrLoad(cacheKey, () => Field._syntheticReference(customObjectApiName, fieldApiName));
@@ -1,5 +1,7 @@
1
1
  /** Manifest builder public API (hand-written, not Stainless-generated). */
2
2
 
3
+ export { Agent, type AgentIdentityMode, type AgentProps, type AgentSourceFile } from './agent';
4
+
3
5
  export {
4
6
  generateId,
5
7
  type EdgeType,
@@ -58,6 +60,13 @@ export {
58
60
  type IconConfig,
59
61
  } from './custom-object';
60
62
 
63
+ export {
64
+ CustomSkill,
65
+ type CustomSkillProps,
66
+ type CustomSkillSourceType,
67
+ type CustomSkillStatus,
68
+ } from './custom-skill';
69
+
61
70
  export {
62
71
  CustomObjectFieldSection,
63
72
  type CustomObjectFieldSectionLoadFromExistingOptions,
@@ -14,6 +14,7 @@ export interface ManifestComponent {
14
14
  * Wire-level component types supported by the manifest builder.
15
15
  */
16
16
  export type ManifestComponentType =
17
+ | 'AGENT'
17
18
  | 'CUSTOM_APP'
18
19
  | 'CUSTOM_CATEGORY'
19
20
  | 'CUSTOM_FIELD_SECTION'
@@ -26,6 +27,7 @@ export type ManifestComponentType =
26
27
  | 'CUSTOM_OBJECT_PAGE_LAYOUT'
27
28
  | 'CUSTOM_OBJECT_RECORD_TRIGGERED_FLOW'
28
29
  | 'CUSTOM_OBJECT_VALIDATION_RULE'
30
+ | 'CUSTOM_SKILL'
29
31
  | 'FUNCTION'
30
32
  | 'SDUI_PAGE'
31
33
  | 'WORKFLOW_DEFINITION';
@@ -462,7 +462,9 @@ export {
462
462
  type Team,
463
463
  type TeamRetrieveResponse,
464
464
  type TeamListParams,
465
+ type TeamCreateParams,
465
466
  type TeamRetrieveParams,
467
+ type TeamUpdateParams,
466
468
  type TeamsPageCursorURL,
467
469
  } from './teams';
468
470
  export {
@@ -26,9 +26,9 @@ export interface LeaveProgramEvaluationCreateResponse {
26
26
  leave_plan: unknown;
27
27
 
28
28
  /**
29
- * Distinct evidence gaps reported by evaluated eligibility rules.
29
+ * Structured evidence gaps reported by evaluated eligibility rules.
30
30
  */
31
- missing_evidence: Array<string>;
31
+ missing_evidence: Array<LeaveProgramEvaluationCreateResponse.MissingEvidence>;
32
32
 
33
33
  /**
34
34
  * Per-program rule outputs in evaluation order.
@@ -36,6 +36,30 @@ export interface LeaveProgramEvaluationCreateResponse {
36
36
  program_results: Array<unknown>;
37
37
  }
38
38
 
39
+ export namespace LeaveProgramEvaluationCreateResponse {
40
+ export interface MissingEvidence {
41
+ /**
42
+ * Expected answer type for this evidence key.
43
+ */
44
+ answer_type: string;
45
+
46
+ /**
47
+ * Stable evidence key that can be supplied in supplemental_evidence.
48
+ */
49
+ key: string;
50
+
51
+ /**
52
+ * Human-readable label for the missing evidence.
53
+ */
54
+ label: string;
55
+
56
+ /**
57
+ * Leave program codes that reported this missing evidence.
58
+ */
59
+ program_codes: Array<string>;
60
+ }
61
+ }
62
+
39
63
  export interface LeaveProgramEvaluationCreateParams {
40
64
  /**
41
65
  * Requested leave start date.
@@ -63,6 +87,12 @@ export interface LeaveProgramEvaluationCreateParams {
63
87
  */
64
88
  child_entered_family_date?: string;
65
89
 
90
+ /**
91
+ * Demo/test-company only evidence overrides for exercising eligibility scenarios
92
+ * when the role's real data would not qualify.
93
+ */
94
+ evidence_override?: unknown;
95
+
66
96
  /**
67
97
  * Optional parental leave relationship type for parental leave programs.
68
98
  */
@@ -78,6 +108,12 @@ export interface LeaveProgramEvaluationCreateParams {
78
108
  * program runs in dependency order.
79
109
  */
80
110
  program_codes?: Array<string>;
111
+
112
+ /**
113
+ * Answers for evidence keys returned in missing_evidence. These answers only fill
114
+ * facts that the evaluation reported as missing.
115
+ */
116
+ supplemental_evidence?: unknown;
81
117
  }
82
118
 
83
119
  export declare namespace LeaveProgramEvaluations {
@@ -4,6 +4,7 @@ import { APIResource } from '../core/resource';
4
4
  import * as BusinessPartnersAPI from './business-partners';
5
5
  import { APIPromise } from '../core/api-promise';
6
6
  import { PageCursorURL, PagePromise } from '../core/pagination';
7
+ import { buildHeaders } from '../internal/headers';
7
8
  import { RequestOptions } from '../internal/request-options';
8
9
  import { path } from '../internal/utils/path';
9
10
 
@@ -25,6 +26,13 @@ export class Teams extends APIResource {
25
26
  return this._client.getAPIList('/teams/', PageCursorURL<Team>, { query, ...options });
26
27
  }
27
28
 
29
+ /**
30
+ * Create a new team
31
+ */
32
+ create(body: TeamCreateParams, options?: RequestOptions): APIPromise<Team> {
33
+ return this._client.post('/teams/', { body, ...options });
34
+ }
35
+
28
36
  /**
29
37
  * Retrieve a specific team
30
38
  */
@@ -35,6 +43,27 @@ export class Teams extends APIResource {
35
43
  ): APIPromise<TeamRetrieveResponse> {
36
44
  return this._client.get(path`/teams/${id}/`, { query, ...options });
37
45
  }
46
+
47
+ /**
48
+ * Update a specific team.
49
+ */
50
+ update(
51
+ id: string,
52
+ body: TeamUpdateParams | null | undefined = {},
53
+ options?: RequestOptions,
54
+ ): APIPromise<Team> {
55
+ return this._client.patch(path`/teams/${id}/`, { body, ...options });
56
+ }
57
+
58
+ /**
59
+ * Delete a team
60
+ */
61
+ delete(id: string, options?: RequestOptions): APIPromise<void> {
62
+ return this._client.delete(path`/teams/${id}/`, {
63
+ ...options,
64
+ headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
65
+ });
66
+ }
38
67
  }
39
68
 
40
69
  export type TeamsPageCursorURL = PageCursorURL<Team>;
@@ -86,16 +115,42 @@ export interface TeamListParams {
86
115
  order_by?: string;
87
116
  }
88
117
 
118
+ export interface TeamCreateParams {
119
+ /**
120
+ * The name of the team.
121
+ */
122
+ name: string;
123
+
124
+ /**
125
+ * The parent team
126
+ */
127
+ parent_id?: string;
128
+ }
129
+
89
130
  export interface TeamRetrieveParams {
90
131
  expand?: string;
91
132
  }
92
133
 
134
+ export interface TeamUpdateParams {
135
+ /**
136
+ * The name of the team.
137
+ */
138
+ name?: string;
139
+
140
+ /**
141
+ * The parent team
142
+ */
143
+ parent_id?: string;
144
+ }
145
+
93
146
  export declare namespace Teams {
94
147
  export {
95
148
  type Team as Team,
96
149
  type TeamRetrieveResponse as TeamRetrieveResponse,
97
150
  type TeamsPageCursorURL as TeamsPageCursorURL,
98
151
  type TeamListParams as TeamListParams,
152
+ type TeamCreateParams as TeamCreateParams,
99
153
  type TeamRetrieveParams as TeamRetrieveParams,
154
+ type TeamUpdateParams as TeamUpdateParams,
100
155
  };
101
156
  }
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.2.0-alpha.79'; // x-release-please-version
1
+ export const VERSION = '0.2.0-alpha.81'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.2.0-alpha.79";
1
+ export declare const VERSION = "0.2.0-alpha.81";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.2.0-alpha.79";
1
+ export declare const VERSION = "0.2.0-alpha.81";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '0.2.0-alpha.79'; // x-release-please-version
4
+ exports.VERSION = '0.2.0-alpha.81'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.2.0-alpha.79'; // x-release-please-version
1
+ export const VERSION = '0.2.0-alpha.81'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map