@rippling/rippling-sdk 0.2.0-alpha.61 → 0.2.0-alpha.63

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 (85) hide show
  1. package/client.d.mts +18 -0
  2. package/client.d.mts.map +1 -1
  3. package/client.d.ts +18 -0
  4. package/client.d.ts.map +1 -1
  5. package/client.js +18 -0
  6. package/client.js.map +1 -1
  7. package/client.mjs +18 -0
  8. package/client.mjs.map +1 -1
  9. package/examples/manifest/field-service-dispatch/field-service-dispatch.ts +530 -0
  10. package/examples/manifest/grant-program-management/grant-program-management.ts +594 -0
  11. package/examples/manifest/procurement-approval-hub/procurement-approval-hub.ts +554 -0
  12. package/lib/manifest/custom-object-page-layout.d.mts +0 -6
  13. package/lib/manifest/custom-object-page-layout.d.mts.map +1 -1
  14. package/lib/manifest/custom-object-page-layout.d.ts +0 -6
  15. package/lib/manifest/custom-object-page-layout.d.ts.map +1 -1
  16. package/lib/manifest/custom-object-page-layout.js +16 -5
  17. package/lib/manifest/custom-object-page-layout.js.map +1 -1
  18. package/lib/manifest/custom-object-page-layout.mjs +16 -5
  19. package/lib/manifest/custom-object-page-layout.mjs.map +1 -1
  20. package/lib/manifest/index.d.mts +1 -1
  21. package/lib/manifest/index.d.mts.map +1 -1
  22. package/lib/manifest/index.d.ts +1 -1
  23. package/lib/manifest/index.d.ts.map +1 -1
  24. package/lib/manifest/index.js.map +1 -1
  25. package/lib/manifest/index.mjs.map +1 -1
  26. package/package.json +1 -1
  27. package/resources/app-users.d.mts +186 -0
  28. package/resources/app-users.d.mts.map +1 -0
  29. package/resources/app-users.d.ts +186 -0
  30. package/resources/app-users.d.ts.map +1 -0
  31. package/resources/app-users.js +32 -0
  32. package/resources/app-users.js.map +1 -0
  33. package/resources/app-users.mjs +28 -0
  34. package/resources/app-users.mjs.map +1 -0
  35. package/resources/device-orders.d.mts +147 -0
  36. package/resources/device-orders.d.mts.map +1 -0
  37. package/resources/device-orders.d.ts +147 -0
  38. package/resources/device-orders.d.ts.map +1 -0
  39. package/resources/device-orders.js +34 -0
  40. package/resources/device-orders.js.map +1 -0
  41. package/resources/device-orders.mjs +30 -0
  42. package/resources/device-orders.mjs.map +1 -0
  43. package/resources/devices.d.mts +272 -0
  44. package/resources/devices.d.mts.map +1 -0
  45. package/resources/devices.d.ts +272 -0
  46. package/resources/devices.d.ts.map +1 -0
  47. package/resources/devices.js +32 -0
  48. package/resources/devices.js.map +1 -0
  49. package/resources/devices.mjs +28 -0
  50. package/resources/devices.mjs.map +1 -0
  51. package/resources/functions/deployments.d.mts +8 -0
  52. package/resources/functions/deployments.d.mts.map +1 -1
  53. package/resources/functions/deployments.d.ts +8 -0
  54. package/resources/functions/deployments.d.ts.map +1 -1
  55. package/resources/index.d.mts +3 -0
  56. package/resources/index.d.mts.map +1 -1
  57. package/resources/index.d.ts +3 -0
  58. package/resources/index.d.ts.map +1 -1
  59. package/resources/index.js +8 -2
  60. package/resources/index.js.map +1 -1
  61. package/resources/index.mjs +3 -0
  62. package/resources/index.mjs.map +1 -1
  63. package/resources/job-assignments.d.mts +12 -12
  64. package/resources/job-assignments.d.mts.map +1 -1
  65. package/resources/job-assignments.d.ts +12 -12
  66. package/resources/job-assignments.d.ts.map +1 -1
  67. package/resources/workers.d.mts +13 -0
  68. package/resources/workers.d.mts.map +1 -1
  69. package/resources/workers.d.ts +13 -0
  70. package/resources/workers.d.ts.map +1 -1
  71. package/src/client.ts +66 -0
  72. package/src/lib/manifest/custom-object-page-layout.ts +14 -9
  73. package/src/lib/manifest/index.ts +0 -2
  74. package/src/resources/app-users.ts +270 -0
  75. package/src/resources/device-orders.ts +200 -0
  76. package/src/resources/devices.ts +496 -0
  77. package/src/resources/functions/deployments.ts +10 -0
  78. package/src/resources/index.ts +24 -0
  79. package/src/resources/job-assignments.ts +12 -12
  80. package/src/resources/workers.ts +15 -0
  81. package/src/version.ts +1 -1
  82. package/version.d.mts +1 -1
  83. package/version.d.ts +1 -1
  84. package/version.js +1 -1
  85. package/version.mjs +1 -1
package/src/client.ts CHANGED
@@ -19,6 +19,14 @@ import { AbstractPage, PageCursorURLResponse } from './core/pagination';
19
19
  import * as Uploads from './core/uploads';
20
20
  import * as API from './resources/index';
21
21
  import { APIPromise } from './core/api-promise';
22
+ import {
23
+ AppUserListParams,
24
+ AppUserListResponse,
25
+ AppUserListResponsesPageCursorURL,
26
+ AppUserRetrieveParams,
27
+ AppUserRetrieveResponse,
28
+ AppUsers,
29
+ } from './resources/app-users';
22
30
  import {
23
31
  BreakPolicies,
24
32
  BreakPolicyListParams,
@@ -151,6 +159,22 @@ import {
151
159
  Departments,
152
160
  DepartmentsPageCursorURL,
153
161
  } from './resources/departments';
162
+ import {
163
+ DeviceOrderListParams,
164
+ DeviceOrderListResponse,
165
+ DeviceOrderListResponsesPageCursorURL,
166
+ DeviceOrderRetrieveParams,
167
+ DeviceOrderRetrieveResponse,
168
+ DeviceOrders,
169
+ } from './resources/device-orders';
170
+ import {
171
+ DeviceListParams,
172
+ DeviceListResponse,
173
+ DeviceListResponsesPageCursorURL,
174
+ DeviceRetrieveParams,
175
+ DeviceRetrieveResponse,
176
+ Devices,
177
+ } from './resources/devices';
154
178
  import { DraftHireCreateParams, DraftHireCreateResponse, DraftHires } from './resources/draft-hires';
155
179
  import {
156
180
  EarningTypeListResponse,
@@ -1426,6 +1450,10 @@ export class RipplingSDK {
1426
1450
  * Job related information for the company
1427
1451
  */
1428
1452
  jobPayRateExceptions: API.JobPayRateExceptions = new API.JobPayRateExceptions(this);
1453
+ /**
1454
+ * Mappings between Rippling workers and their user accounts in third-party apps
1455
+ */
1456
+ appUsers: API.AppUsers = new API.AppUsers(this);
1429
1457
  /**
1430
1458
  * Break types configured by the company for time tracking
1431
1459
  */
@@ -1465,6 +1493,14 @@ export class RipplingSDK {
1465
1493
  customFields: API.CustomFields = new API.CustomFields(this);
1466
1494
  customPages: API.CustomPages = new API.CustomPages(this);
1467
1495
  customSettings: API.CustomSettings = new API.CustomSettings(this);
1496
+ /**
1497
+ * Devices (laptops, desktops, phones, tablets) managed by Rippling
1498
+ */
1499
+ devices: API.Devices = new API.Devices(this);
1500
+ /**
1501
+ * Device orders (new device shipments, retrievals, etc.) for company workers
1502
+ */
1503
+ deviceOrders: API.DeviceOrders = new API.DeviceOrders(this);
1468
1504
  /**
1469
1505
  * Candidates who have not yet started work at the company
1470
1506
  */
@@ -1609,6 +1645,7 @@ RipplingSDK.BusinessPartnerGroups = BusinessPartnerGroups;
1609
1645
  RipplingSDK.Functions = Functions;
1610
1646
  RipplingSDK.JobAssignments = JobAssignments;
1611
1647
  RipplingSDK.JobPayRateExceptions = JobPayRateExceptions;
1648
+ RipplingSDK.AppUsers = AppUsers;
1612
1649
  RipplingSDK.BreakPolicies = BreakPolicies;
1613
1650
  RipplingSDK.BreakTypes = BreakTypes;
1614
1651
  RipplingSDK.BusinessStructurePaths = BusinessStructurePaths;
@@ -1621,6 +1658,8 @@ RipplingSDK.CustomApps = CustomApps;
1621
1658
  RipplingSDK.CustomFields = CustomFields;
1622
1659
  RipplingSDK.CustomPages = CustomPages;
1623
1660
  RipplingSDK.CustomSettings = CustomSettings;
1661
+ RipplingSDK.Devices = Devices;
1662
+ RipplingSDK.DeviceOrders = DeviceOrders;
1624
1663
  RipplingSDK.DraftHires = DraftHires;
1625
1664
  RipplingSDK.EarningTypes = EarningTypes;
1626
1665
  RipplingSDK.EarningsInputs = EarningsInputs;
@@ -1950,6 +1989,15 @@ export declare namespace RipplingSDK {
1950
1989
  type JobPayRateExceptionListChangeLogParams as JobPayRateExceptionListChangeLogParams,
1951
1990
  };
1952
1991
 
1992
+ export {
1993
+ AppUsers as AppUsers,
1994
+ type AppUserListResponse as AppUserListResponse,
1995
+ type AppUserRetrieveResponse as AppUserRetrieveResponse,
1996
+ type AppUserListResponsesPageCursorURL as AppUserListResponsesPageCursorURL,
1997
+ type AppUserListParams as AppUserListParams,
1998
+ type AppUserRetrieveParams as AppUserRetrieveParams,
1999
+ };
2000
+
1953
2001
  export {
1954
2002
  BreakPolicies as BreakPolicies,
1955
2003
  type BreakPolicyListResponse as BreakPolicyListResponse,
@@ -2056,6 +2104,24 @@ export declare namespace RipplingSDK {
2056
2104
  type CustomSettingUpdateParams as CustomSettingUpdateParams,
2057
2105
  };
2058
2106
 
2107
+ export {
2108
+ Devices as Devices,
2109
+ type DeviceListResponse as DeviceListResponse,
2110
+ type DeviceRetrieveResponse as DeviceRetrieveResponse,
2111
+ type DeviceListResponsesPageCursorURL as DeviceListResponsesPageCursorURL,
2112
+ type DeviceListParams as DeviceListParams,
2113
+ type DeviceRetrieveParams as DeviceRetrieveParams,
2114
+ };
2115
+
2116
+ export {
2117
+ DeviceOrders as DeviceOrders,
2118
+ type DeviceOrderListResponse as DeviceOrderListResponse,
2119
+ type DeviceOrderRetrieveResponse as DeviceOrderRetrieveResponse,
2120
+ type DeviceOrderListResponsesPageCursorURL as DeviceOrderListResponsesPageCursorURL,
2121
+ type DeviceOrderListParams as DeviceOrderListParams,
2122
+ type DeviceOrderRetrieveParams as DeviceOrderRetrieveParams,
2123
+ };
2124
+
2059
2125
  export {
2060
2126
  DraftHires as DraftHires,
2061
2127
  type DraftHireCreateResponse as DraftHireCreateResponse,
@@ -108,8 +108,6 @@ interface SerializedHeaderEdits
108
108
 
109
109
  export type SectionFieldsLayout = 'one_column' | 'two_column' | 'three_column' | 'responsive';
110
110
  export type TabLayout = 'vertical' | 'horizontal';
111
- export type SectionMovementOption = 'static' | 'tab' | 'free';
112
- export type FieldMovementOption = 'tab' | 'free';
113
111
  export type CustomObjectCustomSectionComponentKey = 'attachments' | 'comments';
114
112
 
115
113
  /** Default value wrapper used by `SectionField.defaultValue`. */
@@ -131,8 +129,6 @@ export interface SectionFieldOptions {
131
129
  height?: number;
132
130
  /** Whether the layout manager can remove this field. Optional. */
133
131
  canBeDeleted?: boolean;
134
- /** Controls how the field can be moved in the UI. Optional. */
135
- movementOption?: FieldMovementOption;
136
132
  }
137
133
 
138
134
  /** A typed field entry inside a `fields_section`. */
@@ -153,8 +149,6 @@ export interface PageLayoutSectionOptions {
153
149
  canBeDeleted?: boolean;
154
150
  /** Whether the layout manager can rename this section. Optional. */
155
151
  canBeRenamed?: boolean;
156
- /** Controls how the section can be moved. Optional. */
157
- movementOption?: SectionMovementOption;
158
152
  /** Hide the section title. Optional. */
159
153
  hideName?: boolean;
160
154
  }
@@ -755,7 +749,6 @@ function toSerializedSectionField(
755
749
  if (options.defaultValue != null) normalized.defaultValue = options.defaultValue;
756
750
  if (options.height != null) normalized.height = options.height;
757
751
  if (options.canBeDeleted != null) normalized.canBeDeleted = options.canBeDeleted;
758
- if (options.movementOption != null) normalized.movementOption = options.movementOption;
759
752
  return normalized;
760
753
  }
761
754
 
@@ -765,7 +758,6 @@ function copySectionOptions<T extends PageLayoutSectionOptions>(
765
758
  ): T {
766
759
  if (input.canBeDeleted != null) target.canBeDeleted = input.canBeDeleted;
767
760
  if (input.canBeRenamed != null) target.canBeRenamed = input.canBeRenamed;
768
- if (input.movementOption != null) target.movementOption = input.movementOption;
769
761
  if (input.hideName != null) target.hideName = input.hideName;
770
762
  return target;
771
763
  }
@@ -892,6 +884,17 @@ function cloneJson<T>(value: T): T {
892
884
  return JSON.parse(JSON.stringify(value)) as T;
893
885
  }
894
886
 
887
+ function stripMovementOptions(value: unknown): void {
888
+ if (Array.isArray(value)) {
889
+ for (const item of value) stripMovementOptions(item);
890
+ return;
891
+ }
892
+ if (value == null || typeof value !== 'object') return;
893
+ const record = value as Record<string, unknown>;
894
+ delete record['movementOption'];
895
+ for (const item of Object.values(record)) stripMovementOptions(item);
896
+ }
897
+
895
898
  const HEADER_EDIT_KEYS = new Set([
896
899
  'newTitleField',
897
900
  'titleFieldDeleted',
@@ -2275,6 +2278,8 @@ export class CustomObjectPageLayout {
2275
2278
  * @returns A plain object with `type: 'CUSTOM_OBJECT_PAGE_LAYOUT'`.
2276
2279
  */
2277
2280
  toDict(): Record<string, any> {
2281
+ const tabEdits = cloneJson(this._tabEdits);
2282
+ stripMovementOptions(tabEdits);
2278
2283
  const d: Record<string, any> = {
2279
2284
  type: CustomObjectPageLayout.componentType,
2280
2285
  layout_id: this._layoutId,
@@ -2283,7 +2288,7 @@ export class CustomObjectPageLayout {
2283
2288
  name: this._name,
2284
2289
  // Packaged layouts are never system-created (backend invariant).
2285
2290
  system_created: false,
2286
- tab_edits: this._tabEdits,
2291
+ tab_edits: tabEdits,
2287
2292
  header_edits: this._headerEdits,
2288
2293
  visibility_conditions: this._visibilityConditions,
2289
2294
  blueprint_key: this._blueprintKey ?? this._customObjectApiName,
@@ -52,7 +52,6 @@ export {
52
52
  type CustomObjectPageLayoutProps,
53
53
  type CustomSection,
54
54
  type CustomTab,
55
- type FieldMovementOption,
56
55
  type FieldRqlName,
57
56
  type FieldsSection,
58
57
  type HeaderEdits,
@@ -86,7 +85,6 @@ export {
86
85
  type SectionFieldRef,
87
86
  type SectionFieldsLayout,
88
87
  type SectionKey,
89
- type SectionMovementOption,
90
88
  type SystemHeaderFieldEdit,
91
89
  type SystemSectionEdit,
92
90
  type SystemTabEdit,
@@ -0,0 +1,270 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../core/resource';
4
+ import * as BusinessPartnersAPI from './business-partners';
5
+ import * as WorkersAPI from './workers';
6
+ import { APIPromise } from '../core/api-promise';
7
+ import { PageCursorURL, PagePromise } from '../core/pagination';
8
+ import { RequestOptions } from '../internal/request-options';
9
+ import { path } from '../internal/utils/path';
10
+
11
+ /**
12
+ * Mappings between Rippling workers and their user accounts in third-party apps
13
+ */
14
+ export class AppUsers extends APIResource {
15
+ /**
16
+ * A list of app users.
17
+ *
18
+ * - Requires: `API Tier 1`
19
+ * - Filterable fields: `worker_id`, `spoke_user_identifier`, `app_handle`,
20
+ * `created_at`, `updated_at`
21
+ * - Expandable fields: `worker`
22
+ * - Sortable fields: `id`, `created_at`, `updated_at`
23
+ */
24
+ list(
25
+ query: AppUserListParams | null | undefined = {},
26
+ options?: RequestOptions,
27
+ ): PagePromise<AppUserListResponsesPageCursorURL, AppUserListResponse> {
28
+ return this._client.getAPIList('/app-users/', PageCursorURL<AppUserListResponse>, { query, ...options });
29
+ }
30
+
31
+ /**
32
+ * Retrieve a specific app user
33
+ */
34
+ retrieve(
35
+ id: string,
36
+ query: AppUserRetrieveParams | null | undefined = {},
37
+ options?: RequestOptions,
38
+ ): APIPromise<AppUserRetrieveResponse> {
39
+ return this._client.get(path`/app-users/${id}/`, { query, ...options });
40
+ }
41
+ }
42
+
43
+ export type AppUserListResponsesPageCursorURL = PageCursorURL<AppUserListResponse>;
44
+
45
+ /**
46
+ * Maps a Rippling worker (if any) to their user account in a third-party
47
+ * app (e.g. Slack, Jira, GitHub). Sourced from SpokeUser records.
48
+ *
49
+ * Includes orphan accounts — third-party app accounts with no matching
50
+ * Rippling worker (`worker_id=None`, `match_state=NOT_MATCHED`). These are
51
+ * the primary signal for IT-admin triage. Uses `BaseResourceDTO` rather
52
+ * than `BaseEmployeeResourceDTO` so the platform's role-based auto-filter
53
+ * does not silently drop orphans for non-admin tokens. Company scoping is
54
+ * enforced explicitly in `AppUsersAPIViewSet.get_queryset`; the `app-users.read`
55
+ * scope is the access gate.
56
+ *
57
+ * Resource name aligns with how the product surfaces these in the UI
58
+ * ("Slack account", "GitHub account") and matches the equivalent concept
59
+ * in Okta's IAM API (AppUser).
60
+ *
61
+ * Designed for point lookups: list endpoint requires at least one filter
62
+ * on `worker_id` or `spoke_user_identifier` to prevent bulk enumeration of the
63
+ * org's identity graph across connected apps.
64
+ *
65
+ * `spoke_user_identifier` reads `SpokeUser.spokeId` — the user identifier
66
+ * stored for the third-party account. Depending on the integration, this may
67
+ * be an email, username, account handle, or app-specific user id.
68
+ */
69
+ export interface AppUserListResponse {
70
+ /**
71
+ * Identifier field
72
+ */
73
+ id: string;
74
+
75
+ /**
76
+ * Record creation date
77
+ */
78
+ created_at: string;
79
+
80
+ /**
81
+ * Record update date
82
+ */
83
+ updated_at: string;
84
+
85
+ /**
86
+ * Human-readable display name for the third-party app (e.g. 'Slack', 'GitHub').
87
+ * Sourced from the customer-configured SpokeOwner.app_display_name; falls back to
88
+ * a title-cased app handle when the customer hasn't set one.
89
+ */
90
+ app_display_name?: string;
91
+
92
+ /**
93
+ * Machine-readable identifier for the third-party app (e.g. 'slack', 'jira',
94
+ * 'asana'). Stable across the App Shop catalog.
95
+ */
96
+ app_handle?: string;
97
+
98
+ /**
99
+ * The user's email address in the third-party app, if known. Null when the app
100
+ * does not expose an email or Rippling did not capture one.
101
+ */
102
+ external_email?: string;
103
+
104
+ /**
105
+ * The user's display name in the third-party app, if known. Null when the app does
106
+ * not surface a separate username.
107
+ */
108
+ external_username?: string;
109
+
110
+ /**
111
+ * Whether this third-party account has been matched to a Rippling worker.
112
+ */
113
+ match_state?: 'MATCHED' | 'NOT_MATCHED' | 'IGNORED';
114
+
115
+ /**
116
+ * Provisioning lifecycle state of this account in the third-party app.
117
+ */
118
+ push_state?:
119
+ | 'INIT'
120
+ | 'EMPLOYEE_CONFIRMATION_PENDING'
121
+ | 'EMPLOYEE_CONFIRMATION_ACCEPTED'
122
+ | 'EMPLOYEE_CONFIRMATION_REJECTED'
123
+ | 'INVITE_PENDING'
124
+ | 'INVITE_CONFIRMED'
125
+ | 'INVITE_FAILED'
126
+ | 'CREATE_PENDING'
127
+ | 'CREATE_CONFIRMED'
128
+ | 'CREATE_FAILED'
129
+ | 'DELETE_PENDING'
130
+ | 'DELETE_CONFIRMED'
131
+ | 'DELETE_FAILED'
132
+ | 'SUSPEND_PENDING'
133
+ | 'SUSPEND_CONFIRMED'
134
+ | 'SUSPEND_FAILED';
135
+
136
+ /**
137
+ * Identifier for the user's account in the third-party app workspace. Depending on
138
+ * the integration, this may be an email, username, account handle, or app-specific
139
+ * user id.
140
+ */
141
+ spoke_user_identifier?: string;
142
+
143
+ /**
144
+ * The Rippling worker associated with this external app account. Expanding this
145
+ * field requires both `app-users.read` and `workers.read` scopes.
146
+ *
147
+ * Expandable field
148
+ */
149
+ worker?: WorkersAPI.Worker;
150
+
151
+ /**
152
+ * ID of the Rippling worker associated with this external app account.
153
+ */
154
+ worker_id?: string;
155
+ }
156
+
157
+ /**
158
+ * Meta information for the response.
159
+ */
160
+ export interface AppUserRetrieveResponse extends BusinessPartnersAPI.Meta {
161
+ /**
162
+ * Identifier field
163
+ */
164
+ id: string;
165
+
166
+ /**
167
+ * Record creation date
168
+ */
169
+ created_at: string;
170
+
171
+ /**
172
+ * Record update date
173
+ */
174
+ updated_at: string;
175
+
176
+ /**
177
+ * Human-readable display name for the third-party app (e.g. 'Slack', 'GitHub').
178
+ * Sourced from the customer-configured SpokeOwner.app_display_name; falls back to
179
+ * a title-cased app handle when the customer hasn't set one.
180
+ */
181
+ app_display_name?: string;
182
+
183
+ /**
184
+ * Machine-readable identifier for the third-party app (e.g. 'slack', 'jira',
185
+ * 'asana'). Stable across the App Shop catalog.
186
+ */
187
+ app_handle?: string;
188
+
189
+ /**
190
+ * The user's email address in the third-party app, if known. Null when the app
191
+ * does not expose an email or Rippling did not capture one.
192
+ */
193
+ external_email?: string;
194
+
195
+ /**
196
+ * The user's display name in the third-party app, if known. Null when the app does
197
+ * not surface a separate username.
198
+ */
199
+ external_username?: string;
200
+
201
+ /**
202
+ * Whether this third-party account has been matched to a Rippling worker.
203
+ */
204
+ match_state?: 'MATCHED' | 'NOT_MATCHED' | 'IGNORED';
205
+
206
+ /**
207
+ * Provisioning lifecycle state of this account in the third-party app.
208
+ */
209
+ push_state?:
210
+ | 'INIT'
211
+ | 'EMPLOYEE_CONFIRMATION_PENDING'
212
+ | 'EMPLOYEE_CONFIRMATION_ACCEPTED'
213
+ | 'EMPLOYEE_CONFIRMATION_REJECTED'
214
+ | 'INVITE_PENDING'
215
+ | 'INVITE_CONFIRMED'
216
+ | 'INVITE_FAILED'
217
+ | 'CREATE_PENDING'
218
+ | 'CREATE_CONFIRMED'
219
+ | 'CREATE_FAILED'
220
+ | 'DELETE_PENDING'
221
+ | 'DELETE_CONFIRMED'
222
+ | 'DELETE_FAILED'
223
+ | 'SUSPEND_PENDING'
224
+ | 'SUSPEND_CONFIRMED'
225
+ | 'SUSPEND_FAILED';
226
+
227
+ /**
228
+ * Identifier for the user's account in the third-party app workspace. Depending on
229
+ * the integration, this may be an email, username, account handle, or app-specific
230
+ * user id.
231
+ */
232
+ spoke_user_identifier?: string;
233
+
234
+ /**
235
+ * The Rippling worker associated with this external app account. Expanding this
236
+ * field requires both `app-users.read` and `workers.read` scopes.
237
+ *
238
+ * Expandable field
239
+ */
240
+ worker?: WorkersAPI.Worker;
241
+
242
+ /**
243
+ * ID of the Rippling worker associated with this external app account.
244
+ */
245
+ worker_id?: string;
246
+ }
247
+
248
+ export interface AppUserListParams {
249
+ cursor?: string;
250
+
251
+ expand?: string;
252
+
253
+ filter?: string;
254
+
255
+ order_by?: string;
256
+ }
257
+
258
+ export interface AppUserRetrieveParams {
259
+ expand?: string;
260
+ }
261
+
262
+ export declare namespace AppUsers {
263
+ export {
264
+ type AppUserListResponse as AppUserListResponse,
265
+ type AppUserRetrieveResponse as AppUserRetrieveResponse,
266
+ type AppUserListResponsesPageCursorURL as AppUserListResponsesPageCursorURL,
267
+ type AppUserListParams as AppUserListParams,
268
+ type AppUserRetrieveParams as AppUserRetrieveParams,
269
+ };
270
+ }
@@ -0,0 +1,200 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../core/resource';
4
+ import * as BusinessPartnersAPI from './business-partners';
5
+ import * as WorkersAPI from './workers';
6
+ import { APIPromise } from '../core/api-promise';
7
+ import { PageCursorURL, PagePromise } from '../core/pagination';
8
+ import { RequestOptions } from '../internal/request-options';
9
+ import { path } from '../internal/utils/path';
10
+
11
+ /**
12
+ * Device orders (new device shipments, retrievals, etc.) for company workers
13
+ */
14
+ export class DeviceOrders extends APIResource {
15
+ /**
16
+ * A list of device orders.
17
+ *
18
+ * - Requires: `API Tier 2`
19
+ * - Filterable fields: `worker_id`, `status`
20
+ * - Expandable fields: `worker`
21
+ * - Sortable fields: `id`, `created_at`, `updated_at`
22
+ */
23
+ list(
24
+ query: DeviceOrderListParams | null | undefined = {},
25
+ options?: RequestOptions,
26
+ ): PagePromise<DeviceOrderListResponsesPageCursorURL, DeviceOrderListResponse> {
27
+ return this._client.getAPIList('/device-orders/', PageCursorURL<DeviceOrderListResponse>, {
28
+ query,
29
+ ...options,
30
+ });
31
+ }
32
+
33
+ /**
34
+ * Retrieve a specific device order
35
+ */
36
+ retrieve(
37
+ id: string,
38
+ query: DeviceOrderRetrieveParams | null | undefined = {},
39
+ options?: RequestOptions,
40
+ ): APIPromise<DeviceOrderRetrieveResponse> {
41
+ return this._client.get(path`/device-orders/${id}/`, { query, ...options });
42
+ }
43
+ }
44
+
45
+ export type DeviceOrderListResponsesPageCursorURL = PageCursorURL<DeviceOrderListResponse>;
46
+
47
+ export interface DeviceOrderListResponse {
48
+ /**
49
+ * Identifier field
50
+ */
51
+ id: string;
52
+
53
+ /**
54
+ * Record creation date
55
+ */
56
+ created_at: string;
57
+
58
+ /**
59
+ * Record update date
60
+ */
61
+ updated_at: string;
62
+
63
+ /**
64
+ * True when a cancellation has been requested but not yet completed.
65
+ */
66
+ cancel_requested?: boolean;
67
+
68
+ /**
69
+ * When the order reached a terminal state (COMPLETED, FAILED, or CANCELED).
70
+ */
71
+ completed_at?: string;
72
+
73
+ /**
74
+ * The type of hardware order, as reported by the underlying inventory order (for
75
+ * example: New Device Order, Warehouse Return, Warehouse Order, Add Existing
76
+ * Device, Assign Device, Empty Order, or Sell Device).
77
+ */
78
+ order_type?: string;
79
+
80
+ /**
81
+ * The ID of the role that requested the order (often an IT admin). Null if
82
+ * system-created.
83
+ */
84
+ requested_by_id?: string;
85
+
86
+ /**
87
+ * The order lifecycle state (InventoryFlowState): CREATED, RUNNING, COMPLETED,
88
+ * FAILED, CANCELING, CANCELED.
89
+ */
90
+ status?: string;
91
+
92
+ /**
93
+ * The warehouse / vendor provider servicing the order (e.g. CDW, INGRAMMICRO,
94
+ * TD_SYNNEX, GROWRK).
95
+ */
96
+ warehouse_provider?: string;
97
+
98
+ /**
99
+ * The worker the order is for.
100
+ *
101
+ * Expandable field
102
+ */
103
+ worker?: WorkersAPI.Worker;
104
+
105
+ /**
106
+ * The ID of the worker the order is for (the recipient). Null if unassigned.
107
+ */
108
+ worker_id?: string;
109
+ }
110
+
111
+ /**
112
+ * Meta information for the response.
113
+ */
114
+ export interface DeviceOrderRetrieveResponse extends BusinessPartnersAPI.Meta {
115
+ /**
116
+ * Identifier field
117
+ */
118
+ id: string;
119
+
120
+ /**
121
+ * Record creation date
122
+ */
123
+ created_at: string;
124
+
125
+ /**
126
+ * Record update date
127
+ */
128
+ updated_at: string;
129
+
130
+ /**
131
+ * True when a cancellation has been requested but not yet completed.
132
+ */
133
+ cancel_requested?: boolean;
134
+
135
+ /**
136
+ * When the order reached a terminal state (COMPLETED, FAILED, or CANCELED).
137
+ */
138
+ completed_at?: string;
139
+
140
+ /**
141
+ * The type of hardware order, as reported by the underlying inventory order (for
142
+ * example: New Device Order, Warehouse Return, Warehouse Order, Add Existing
143
+ * Device, Assign Device, Empty Order, or Sell Device).
144
+ */
145
+ order_type?: string;
146
+
147
+ /**
148
+ * The ID of the role that requested the order (often an IT admin). Null if
149
+ * system-created.
150
+ */
151
+ requested_by_id?: string;
152
+
153
+ /**
154
+ * The order lifecycle state (InventoryFlowState): CREATED, RUNNING, COMPLETED,
155
+ * FAILED, CANCELING, CANCELED.
156
+ */
157
+ status?: string;
158
+
159
+ /**
160
+ * The warehouse / vendor provider servicing the order (e.g. CDW, INGRAMMICRO,
161
+ * TD_SYNNEX, GROWRK).
162
+ */
163
+ warehouse_provider?: string;
164
+
165
+ /**
166
+ * The worker the order is for.
167
+ *
168
+ * Expandable field
169
+ */
170
+ worker?: WorkersAPI.Worker;
171
+
172
+ /**
173
+ * The ID of the worker the order is for (the recipient). Null if unassigned.
174
+ */
175
+ worker_id?: string;
176
+ }
177
+
178
+ export interface DeviceOrderListParams {
179
+ cursor?: string;
180
+
181
+ expand?: string;
182
+
183
+ filter?: string;
184
+
185
+ order_by?: string;
186
+ }
187
+
188
+ export interface DeviceOrderRetrieveParams {
189
+ expand?: string;
190
+ }
191
+
192
+ export declare namespace DeviceOrders {
193
+ export {
194
+ type DeviceOrderListResponse as DeviceOrderListResponse,
195
+ type DeviceOrderRetrieveResponse as DeviceOrderRetrieveResponse,
196
+ type DeviceOrderListResponsesPageCursorURL as DeviceOrderListResponsesPageCursorURL,
197
+ type DeviceOrderListParams as DeviceOrderListParams,
198
+ type DeviceOrderRetrieveParams as DeviceOrderRetrieveParams,
199
+ };
200
+ }