@rippling/rippling-sdk 0.2.0-alpha.106 → 0.2.0-alpha.108

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 (110) hide show
  1. package/client.d.mts +7 -1
  2. package/client.d.mts.map +1 -1
  3. package/client.d.ts +7 -1
  4. package/client.d.ts.map +1 -1
  5. package/client.js +7 -1
  6. package/client.js.map +1 -1
  7. package/client.mjs +7 -1
  8. package/client.mjs.map +1 -1
  9. package/package.json +1 -1
  10. package/resources/card-transactions.d.mts +579 -0
  11. package/resources/card-transactions.d.mts.map +1 -0
  12. package/resources/card-transactions.d.ts +579 -0
  13. package/resources/card-transactions.d.ts.map +1 -0
  14. package/resources/card-transactions.js +116 -0
  15. package/resources/card-transactions.js.map +1 -0
  16. package/resources/card-transactions.mjs +112 -0
  17. package/resources/card-transactions.mjs.map +1 -0
  18. package/resources/custom-settings.d.mts +1 -1
  19. package/resources/custom-settings.d.ts +1 -1
  20. package/resources/custom-settings.js +1 -1
  21. package/resources/custom-settings.mjs +1 -1
  22. package/resources/earning-types.d.mts +50 -10
  23. package/resources/earning-types.d.mts.map +1 -1
  24. package/resources/earning-types.d.ts +50 -10
  25. package/resources/earning-types.d.ts.map +1 -1
  26. package/resources/earning-types.js +21 -2
  27. package/resources/earning-types.js.map +1 -1
  28. package/resources/earning-types.mjs +21 -2
  29. package/resources/earning-types.mjs.map +1 -1
  30. package/resources/hires.d.mts +0 -5
  31. package/resources/hires.d.mts.map +1 -1
  32. package/resources/hires.d.ts +0 -5
  33. package/resources/hires.d.ts.map +1 -1
  34. package/resources/hires.js +0 -1
  35. package/resources/hires.js.map +1 -1
  36. package/resources/hires.mjs +0 -1
  37. package/resources/hires.mjs.map +1 -1
  38. package/resources/index.d.mts +3 -1
  39. package/resources/index.d.mts.map +1 -1
  40. package/resources/index.d.ts +3 -1
  41. package/resources/index.d.ts.map +1 -1
  42. package/resources/index.js +8 -4
  43. package/resources/index.js.map +1 -1
  44. package/resources/index.mjs +3 -1
  45. package/resources/index.mjs.map +1 -1
  46. package/resources/payroll-payment-mode-changes.d.mts +66 -18
  47. package/resources/payroll-payment-mode-changes.d.mts.map +1 -1
  48. package/resources/payroll-payment-mode-changes.d.ts +66 -18
  49. package/resources/payroll-payment-mode-changes.d.ts.map +1 -1
  50. package/resources/payroll-payment-mode-changes.js +16 -4
  51. package/resources/payroll-payment-mode-changes.js.map +1 -1
  52. package/resources/payroll-payment-mode-changes.mjs +16 -4
  53. package/resources/payroll-payment-mode-changes.mjs.map +1 -1
  54. package/resources/reimbursements.d.mts +954 -0
  55. package/resources/reimbursements.d.mts.map +1 -0
  56. package/resources/reimbursements.d.ts +954 -0
  57. package/resources/reimbursements.d.ts.map +1 -0
  58. package/resources/reimbursements.js +140 -0
  59. package/resources/reimbursements.js.map +1 -0
  60. package/resources/reimbursements.mjs +136 -0
  61. package/resources/reimbursements.mjs.map +1 -0
  62. package/resources/workflows/executions.d.mts +153 -0
  63. package/resources/workflows/executions.d.mts.map +1 -0
  64. package/resources/workflows/executions.d.ts +153 -0
  65. package/resources/workflows/executions.d.ts.map +1 -0
  66. package/resources/workflows/executions.js +74 -0
  67. package/resources/workflows/executions.js.map +1 -0
  68. package/resources/workflows/executions.mjs +70 -0
  69. package/resources/workflows/executions.mjs.map +1 -0
  70. package/resources/workflows/index.d.mts +3 -0
  71. package/resources/workflows/index.d.mts.map +1 -0
  72. package/resources/workflows/index.d.ts +3 -0
  73. package/resources/workflows/index.d.ts.map +1 -0
  74. package/resources/workflows/index.js +9 -0
  75. package/resources/workflows/index.js.map +1 -0
  76. package/resources/workflows/index.mjs +4 -0
  77. package/resources/workflows/index.mjs.map +1 -0
  78. package/resources/workflows/workflows.d.mts +977 -0
  79. package/resources/workflows/workflows.d.mts.map +1 -0
  80. package/resources/workflows/workflows.d.ts +977 -0
  81. package/resources/workflows/workflows.d.ts.map +1 -0
  82. package/resources/workflows/workflows.js +246 -0
  83. package/resources/workflows/workflows.js.map +1 -0
  84. package/resources/workflows/workflows.mjs +241 -0
  85. package/resources/workflows/workflows.mjs.map +1 -0
  86. package/resources/workflows.d.mts +1 -957
  87. package/resources/workflows.d.mts.map +1 -1
  88. package/resources/workflows.d.ts +1 -957
  89. package/resources/workflows.d.ts.map +1 -1
  90. package/resources/workflows.js +2 -234
  91. package/resources/workflows.js.map +1 -1
  92. package/resources/workflows.mjs +1 -232
  93. package/resources/workflows.mjs.map +1 -1
  94. package/src/client.ts +46 -12
  95. package/src/resources/card-transactions.ts +718 -0
  96. package/src/resources/custom-settings.ts +1 -1
  97. package/src/resources/earning-types.ts +52 -10
  98. package/src/resources/hires.ts +0 -6
  99. package/src/resources/index.ts +15 -1
  100. package/src/resources/payroll-payment-mode-changes.ts +79 -18
  101. package/src/resources/reimbursements.ts +1157 -0
  102. package/src/resources/workflows/executions.ts +191 -0
  103. package/src/resources/workflows/index.ts +15 -0
  104. package/src/resources/workflows/workflows.ts +1661 -0
  105. package/src/resources/workflows.ts +1 -1622
  106. package/src/version.ts +1 -1
  107. package/version.d.mts +1 -1
  108. package/version.d.ts +1 -1
  109. package/version.js +1 -1
  110. package/version.mjs +1 -1
@@ -9,14 +9,33 @@ import { RequestOptions } from '../internal/request-options';
9
9
  */
10
10
  export class EarningTypes extends APIResource {
11
11
  /**
12
- * A list of earning-types.
12
+ * Lists Global Payroll earning types for selecting payroll earnings inputs. Use
13
+ * the returned `earning_code` in `POST /earnings-inputs/`; the worker's payroll
14
+ * catalog determines whether that code is available. `company_entity_id` and
15
+ * `country_code` restrict results together. Conflicting filters return HTTP 200
16
+ * with empty `results`. Without either filter, returns the company's combined
17
+ * earning catalog.
18
+ *
19
+ * A legal entity can have multiple payroll entities, including sub entities. With
20
+ * `company_entity_id`, their catalogs are combined and equivalent entries with the
21
+ * same country, code, display name, configuration, and behavior are merged.
22
+ * Calculation and tax settings, effective dates, and employment restrictions
23
+ * participate in comparison. Different configurations remain separate, even when
24
+ * returned codes and names match. Each merged entry uses the lexicographically
25
+ * smallest existing earning type ID; it can change when its source entry is
26
+ * removed. Catalog membership does not guarantee availability to every worker.
27
+ * Without `company_entity_id`, entries are deduplicated by earning type ID.
28
+ *
29
+ * Entity-filtered results are ordered by display name, country, code, and ID.
30
+ * Pagination does not provide a snapshot during catalog changes. To continue, pass
31
+ * the returned `next_link` token as `cursor` with the same filters.
13
32
  *
14
33
  * - Requires: `Global Payroll`
15
34
  *
16
35
  * @example HTTP
17
36
  * Representative request and response shapes.
18
37
  * ```
19
- * GET /earning-types/?limit=50&cursor=cursor HTTP/1.1
38
+ * GET /earning-types/?company_entity_id=company_entity_id&country_code=country_code&limit=50&cursor=cursor HTTP/1.1
20
39
  * Host: rest.ripplingapis.com
21
40
  * Accept: application/json
22
41
  * Rippling-Api-Version: 2024-08-01
@@ -59,34 +78,57 @@ export class EarningTypes extends APIResource {
59
78
  export type EarningTypeListResponsesPageCursorURL = PageCursorURL<EarningTypeListResponse>;
60
79
 
61
80
  /**
62
- * V2 DTO representing a company earning type.
63
- *
64
- * Used by:
65
- * - GET /earning-types/ (list)
81
+ * An earning category available in Global Payroll, such as salary, commission, or
82
+ * bonus.
66
83
  */
67
84
  export interface EarningTypeListResponse {
68
85
  /**
69
- * Unique identifier for the earning type.
86
+ * Identifier of a source earning type. With `company_entity_id`, equivalent
87
+ * entries use one existing ID, which can change when its source entry is removed.
88
+ * Use `earning_code` when submitting payroll earnings inputs.
70
89
  */
71
90
  id?: string;
72
91
 
73
92
  /**
74
- * ISO country code where the earning type applies.
93
+ * Uppercase ISO 3166-1 alpha-2 country code of the payroll catalog, such as `CA`
94
+ * or `US`.
75
95
  */
76
96
  country_code?: string;
77
97
 
78
98
  /**
79
- * Human-readable name of the earning type.
99
+ * Configured display name of the earning type. Entries with different
100
+ * configurations can have the same name and `earning_code`.
80
101
  */
81
102
  display_name?: string;
82
103
 
83
104
  /**
84
- * Code identifying the earning type (e.g. regular_salary, commission).
105
+ * Code used to select this earning type in `POST /earnings-inputs/`, such as
106
+ * `regular_salary` or `commission`. Availability is validated against the worker's
107
+ * payroll catalog.
85
108
  */
86
109
  earning_code?: string;
87
110
  }
88
111
 
89
112
  export interface EarningTypeListParams {
113
+ /**
114
+ * Filters earnings to a company legal entity. Use the `id` returned by
115
+ * `GET /company-legal-entities/`, not a payroll entity ID. Includes the combined
116
+ * catalogs of linked, non-archived payroll entities, excluding internal shadow
117
+ * entities. Omit this parameter to use the company-wide catalog. An unknown ID or
118
+ * an ID outside the authenticated company returns HTTP 200 with empty `results`.
119
+ * An empty value or a value that is not a 24-character hexadecimal ID returns HTTP
120
+ * 400 (`VALIDATION_ERROR`).
121
+ */
122
+ company_entity_id?: string;
123
+
124
+ /**
125
+ * Filters earnings by the payroll entity's country. Use an uppercase ISO 3166-1
126
+ * alpha-2 country code, such as `CA` or `US`; matching is case-sensitive. If
127
+ * omitted or empty, country does not restrict results. When supplied with
128
+ * `company_entity_id`, only earnings matching both filters are returned.
129
+ */
130
+ country_code?: string;
131
+
90
132
  cursor?: string;
91
133
 
92
134
  /**
@@ -51,7 +51,6 @@ export class Hires extends APIResource {
51
51
  * Content-Type: application/json
52
52
  *
53
53
  * {
54
- * "ack": false,
55
54
  * "results": [
56
55
  * {
57
56
  * "client_request_id": "string",
@@ -86,11 +85,6 @@ export class Hires extends APIResource {
86
85
  }
87
86
 
88
87
  export interface HireCreateResponse {
89
- /**
90
- * True when the envelope was accepted for processing.
91
- */
92
- ack: boolean;
93
-
94
88
  /**
95
89
  * One result per request hire, in request order. HTTP 200 means the envelope was
96
90
  * accepted; each item's status is the outcome.
@@ -95,6 +95,13 @@ export {
95
95
  type CandidateListParams,
96
96
  type CandidateListResponsesPageCursorURL,
97
97
  } from './candidates';
98
+ export {
99
+ CardTransactions,
100
+ type CardTransactionListResponse,
101
+ type CardTransactionRetrieveResponse,
102
+ type CardTransactionListParams,
103
+ type CardTransactionListResponsesPageCursorURL,
104
+ } from './card-transactions';
98
105
  export { Companies, type Company, type CompanyListParams, type CompaniesPageCursorURL } from './companies';
99
106
  export {
100
107
  CompanyLegalEntities,
@@ -543,6 +550,13 @@ export {
543
550
  type PlatformCapabilityListResponse,
544
551
  type PlatformCapabilityListResponsesPageCursorURL,
545
552
  } from './platform-capabilities';
553
+ export {
554
+ Reimbursements,
555
+ type ReimbursementListResponse,
556
+ type ReimbursementRetrieveResponse,
557
+ type ReimbursementListParams,
558
+ type ReimbursementListResponsesPageCursorURL,
559
+ } from './reimbursements';
546
560
  export {
547
561
  ReportRuns,
548
562
  type ReportRunCreateResponse,
@@ -817,4 +831,4 @@ export {
817
831
  type WorkflowRetrieveParams,
818
832
  type WorkflowUpdateParams,
819
833
  type WorkflowListResponsesPageCursorURL,
820
- } from './workflows';
834
+ } from './workflows/workflows';
@@ -12,7 +12,13 @@ export class PayrollPaymentModeChanges extends APIResource {
12
12
  * Update payment modes for workers in one or more draft Global Payroll runs. The
13
13
  * endpoint returns an item-level result for each requested change. When a request
14
14
  * contains the same run and worker more than once, only the first change is
15
- * evaluated; later entries are rejected as duplicates.
15
+ * evaluated; later entries are rejected as duplicates. Repeating the same run,
16
+ * worker, and payment mode is a safe no-op, so callers can retry it without an
17
+ * idempotency key. Request validation returns every detected error in an errors
18
+ * array before any payment mode is written. The errors array is the deliberate
19
+ * batch-validation contract for this pre-GA endpoint so callers can correct
20
+ * multiple issues at once; permission-denied responses use the same envelope for
21
+ * consistency.
16
22
  *
17
23
  * @example HTTP
18
24
  * Representative request and response shapes.
@@ -37,13 +43,19 @@ export class PayrollPaymentModeChanges extends APIResource {
37
43
  * Content-Type: application/json
38
44
  *
39
45
  * {
40
- * "changes": [
46
+ * "results": [
41
47
  * {
42
48
  * "run_id": "string",
43
49
  * "worker_id": "string",
44
- * "payment_mode": "DEFAULT"
50
+ * "payment_mode": "DEFAULT",
51
+ * "status": "UPDATED",
52
+ * "error": {
53
+ * "code": "DUPLICATE_NO_OP",
54
+ * "message": "string"
55
+ * }
45
56
  * }
46
- * ]
57
+ * ],
58
+ * "write_status": "COMPLETED"
47
59
  * }
48
60
  * ```
49
61
  */
@@ -57,30 +69,79 @@ export class PayrollPaymentModeChanges extends APIResource {
57
69
 
58
70
  export interface PayrollPaymentModeChangeCreateResponse {
59
71
  /**
60
- * Payment mode changes to process. The maximum batch size is 100.
72
+ * Item-level results for the requested payment mode changes. Each item is either
73
+ * updated or rejected so callers can retry failed items independently.
74
+ */
75
+ results?: Array<PayrollPaymentModeChangeCreateResponse.Result>;
76
+
77
+ /**
78
+ * Completion status for this synchronous request. This is currently always
79
+ * COMPLETED; the field is reserved for future status values if processing becomes
80
+ * asynchronous. It describes the overall request, while each result status
81
+ * describes an individual item.
61
82
  */
62
- changes: Array<PayrollPaymentModeChangeCreateResponse.Change>;
83
+ write_status?: 'COMPLETED';
63
84
  }
64
85
 
65
86
  export namespace PayrollPaymentModeChangeCreateResponse {
66
- export interface Change {
87
+ export interface Result {
67
88
  /**
68
- * Canonical Global Payroll payment mode code to apply to the worker in the run.
69
- * Known labels are DEFAULT (Default), BANK_FILE (Bank file), MANUAL (Manual),
70
- * SAME_DAY_ACH (Same-day ACH), and CHECK_PRINTING (Check printing). CHECK_MAILING
71
- * is supported when eligible; its customer-facing label is pending confirmation.
89
+ * Structured error when the item was rejected. This field is omitted for UPDATED
90
+ * items and is present for REJECTED items.
72
91
  */
73
- payment_mode: 'DEFAULT' | 'BANK_FILE' | 'MANUAL' | 'SAME_DAY_ACH' | 'CHECK_PRINTING' | 'CHECK_MAILING';
92
+ error?: Result.Error;
74
93
 
75
94
  /**
76
- * ID of the draft Global Payroll run to update.
95
+ * Requested Global Payroll payment mode code.
77
96
  */
78
- run_id: string;
97
+ payment_mode?: 'DEFAULT' | 'BANK_FILE' | 'MANUAL' | 'SAME_DAY_ACH' | 'CHECK_PRINTING' | 'CHECK_MAILING';
79
98
 
80
99
  /**
81
- * ID of the worker whose payment mode will be updated.
100
+ * ID of the requested payroll run.
82
101
  */
83
- worker_id: string;
102
+ run_id?: string;
103
+
104
+ /**
105
+ * Item result: UPDATED or REJECTED.
106
+ */
107
+ status?: 'UPDATED' | 'REJECTED';
108
+
109
+ /**
110
+ * ID of the requested worker.
111
+ */
112
+ worker_id?: string;
113
+ }
114
+
115
+ export namespace Result {
116
+ /**
117
+ * Structured error when the item was rejected. This field is omitted for UPDATED
118
+ * items and is present for REJECTED items.
119
+ */
120
+ export interface Error {
121
+ /**
122
+ * Machine-readable error code for a rejected item. DUPLICATE_NO_OP means the
123
+ * requested change was already requested and no retry is needed;
124
+ * DUPLICATE_TARGET_CONFLICT, OUT_OF_SCOPE, RUN_NOT_FOUND, WORKER_NOT_IN_RUN, and
125
+ * PAYMENT_MODE_NOT_SUPPORTED are terminal request errors that require changing the
126
+ * request or authorization; RUN_NOT_WRITABLE may be retried when the run becomes
127
+ * writable; PAYMENT_MODE_UPDATE_FAILED is retryable after the underlying update
128
+ * failure is resolved.
129
+ */
130
+ code?:
131
+ | 'DUPLICATE_NO_OP'
132
+ | 'DUPLICATE_TARGET_CONFLICT'
133
+ | 'OUT_OF_SCOPE'
134
+ | 'RUN_NOT_FOUND'
135
+ | 'RUN_NOT_WRITABLE'
136
+ | 'WORKER_NOT_IN_RUN'
137
+ | 'PAYMENT_MODE_NOT_SUPPORTED'
138
+ | 'PAYMENT_MODE_UPDATE_FAILED';
139
+
140
+ /**
141
+ * Human-readable error message.
142
+ */
143
+ message?: string;
144
+ }
84
145
  }
85
146
  }
86
147
 
@@ -96,8 +157,8 @@ export namespace PayrollPaymentModeChangeCreateParams {
96
157
  /**
97
158
  * Canonical Global Payroll payment mode code to apply to the worker in the run.
98
159
  * Known labels are DEFAULT (Default), BANK_FILE (Bank file), MANUAL (Manual),
99
- * SAME_DAY_ACH (Same-day ACH), and CHECK_PRINTING (Check printing). CHECK_MAILING
100
- * is supported when eligible; its customer-facing label is pending confirmation.
160
+ * SAME_DAY_ACH (Same-day ACH), CHECK_PRINTING (Check printing), and CHECK_MAILING
161
+ * (Check mailing).
101
162
  */
102
163
  payment_mode: 'DEFAULT' | 'BANK_FILE' | 'MANUAL' | 'SAME_DAY_ACH' | 'CHECK_PRINTING' | 'CHECK_MAILING';
103
164