@rippling/rippling-sdk 0.2.0-alpha.113 → 0.2.0-alpha.114
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.
- package/client.d.mts +23 -8
- package/client.d.mts.map +1 -1
- package/client.d.ts +23 -8
- package/client.d.ts.map +1 -1
- package/client.js +17 -0
- package/client.js.map +1 -1
- package/client.mjs +17 -0
- package/client.mjs.map +1 -1
- package/lib/manifest/app.d.mts +20 -1
- package/lib/manifest/app.d.mts.map +1 -1
- package/lib/manifest/app.d.ts +20 -1
- package/lib/manifest/app.d.ts.map +1 -1
- package/lib/manifest/app.js +50 -0
- package/lib/manifest/app.js.map +1 -1
- package/lib/manifest/app.mjs +51 -1
- package/lib/manifest/app.mjs.map +1 -1
- package/lib/manifest/composition.d.mts +3 -0
- package/lib/manifest/composition.d.mts.map +1 -1
- package/lib/manifest/composition.d.ts +3 -0
- package/lib/manifest/composition.d.ts.map +1 -1
- package/lib/manifest/composition.js.map +1 -1
- package/lib/manifest/composition.mjs.map +1 -1
- package/lib/manifest/definitions/app.js +4 -1
- package/lib/manifest/definitions/app.js.map +1 -1
- package/lib/manifest/definitions/app.mjs +4 -1
- package/lib/manifest/definitions/app.mjs.map +1 -1
- package/lib/manifest/definitions/function.d.mts.map +1 -1
- package/lib/manifest/definitions/function.d.ts.map +1 -1
- package/lib/manifest/definitions/function.js +1 -0
- package/lib/manifest/definitions/function.js.map +1 -1
- package/lib/manifest/definitions/function.mjs +1 -0
- package/lib/manifest/definitions/function.mjs.map +1 -1
- package/lib/manifest/definitions/group.d.mts +64 -0
- package/lib/manifest/definitions/group.d.mts.map +1 -0
- package/lib/manifest/definitions/group.d.ts +64 -0
- package/lib/manifest/definitions/group.d.ts.map +1 -0
- package/lib/manifest/definitions/group.js +57 -0
- package/lib/manifest/definitions/group.js.map +1 -0
- package/lib/manifest/definitions/group.mjs +50 -0
- package/lib/manifest/definitions/group.mjs.map +1 -0
- package/lib/manifest/definitions/index.d.mts +4 -0
- package/lib/manifest/definitions/index.d.mts.map +1 -1
- package/lib/manifest/definitions/index.d.ts +4 -0
- package/lib/manifest/definitions/index.d.ts.map +1 -1
- package/lib/manifest/definitions/index.js +7 -1
- package/lib/manifest/definitions/index.js.map +1 -1
- package/lib/manifest/definitions/index.mjs +2 -0
- package/lib/manifest/definitions/index.mjs.map +1 -1
- package/lib/manifest/definitions/saved-super-group.d.mts +12 -0
- package/lib/manifest/definitions/saved-super-group.d.mts.map +1 -0
- package/lib/manifest/definitions/saved-super-group.d.ts +12 -0
- package/lib/manifest/definitions/saved-super-group.d.ts.map +1 -0
- package/lib/manifest/definitions/saved-super-group.js +26 -0
- package/lib/manifest/definitions/saved-super-group.js.map +1 -0
- package/lib/manifest/definitions/saved-super-group.mjs +21 -0
- package/lib/manifest/definitions/saved-super-group.mjs.map +1 -0
- package/lib/manifest/existing-manifest-context.d.mts +3 -0
- package/lib/manifest/existing-manifest-context.d.mts.map +1 -1
- package/lib/manifest/existing-manifest-context.d.ts +3 -0
- package/lib/manifest/existing-manifest-context.d.ts.map +1 -1
- package/lib/manifest/existing-manifest-context.js +15 -0
- package/lib/manifest/existing-manifest-context.js.map +1 -1
- package/lib/manifest/existing-manifest-context.mjs +15 -0
- package/lib/manifest/existing-manifest-context.mjs.map +1 -1
- package/lib/manifest/group.d.mts +83 -0
- package/lib/manifest/group.d.mts.map +1 -0
- package/lib/manifest/group.d.ts +83 -0
- package/lib/manifest/group.d.ts.map +1 -0
- package/lib/manifest/group.js +207 -0
- package/lib/manifest/group.js.map +1 -0
- package/lib/manifest/group.mjs +203 -0
- package/lib/manifest/group.mjs.map +1 -0
- package/lib/manifest/index.d.mts +2 -0
- package/lib/manifest/index.d.mts.map +1 -1
- package/lib/manifest/index.d.ts +2 -0
- package/lib/manifest/index.d.ts.map +1 -1
- package/lib/manifest/index.js +5 -1
- package/lib/manifest/index.js.map +1 -1
- package/lib/manifest/index.mjs +2 -0
- package/lib/manifest/index.mjs.map +1 -1
- package/lib/manifest/manifest-builder.d.mts +1 -1
- package/lib/manifest/manifest-builder.d.mts.map +1 -1
- package/lib/manifest/manifest-builder.d.ts +1 -1
- package/lib/manifest/manifest-builder.d.ts.map +1 -1
- package/lib/manifest/manifest-builder.js.map +1 -1
- package/lib/manifest/manifest-builder.mjs.map +1 -1
- package/lib/manifest/manifest-function.d.mts +16 -0
- package/lib/manifest/manifest-function.d.mts.map +1 -1
- package/lib/manifest/manifest-function.d.ts +16 -0
- package/lib/manifest/manifest-function.d.ts.map +1 -1
- package/lib/manifest/manifest-function.js +67 -0
- package/lib/manifest/manifest-function.js.map +1 -1
- package/lib/manifest/manifest-function.mjs +68 -1
- package/lib/manifest/manifest-function.mjs.map +1 -1
- package/lib/manifest/saved-super-group.d.mts +43 -0
- package/lib/manifest/saved-super-group.d.mts.map +1 -0
- package/lib/manifest/saved-super-group.d.ts +43 -0
- package/lib/manifest/saved-super-group.d.ts.map +1 -0
- package/lib/manifest/saved-super-group.js +136 -0
- package/lib/manifest/saved-super-group.js.map +1 -0
- package/lib/manifest/saved-super-group.mjs +132 -0
- package/lib/manifest/saved-super-group.mjs.map +1 -0
- package/package.json +1 -1
- package/resources/application-submissions.d.mts +261 -0
- package/resources/application-submissions.d.mts.map +1 -0
- package/resources/application-submissions.d.ts +261 -0
- package/resources/application-submissions.d.ts.map +1 -0
- package/resources/application-submissions.js +112 -0
- package/resources/application-submissions.js.map +1 -0
- package/resources/application-submissions.mjs +108 -0
- package/resources/application-submissions.mjs.map +1 -0
- package/resources/bills.d.mts +913 -12
- package/resources/bills.d.mts.map +1 -1
- package/resources/bills.d.ts +913 -12
- package/resources/bills.d.ts.map +1 -1
- package/resources/bills.js +221 -0
- package/resources/bills.js.map +1 -1
- package/resources/bills.mjs +221 -0
- package/resources/bills.mjs.map +1 -1
- package/resources/candidate-applications.d.mts +247 -9
- package/resources/candidate-applications.d.mts.map +1 -1
- package/resources/candidate-applications.d.ts +247 -9
- package/resources/candidate-applications.d.ts.map +1 -1
- package/resources/candidate-applications.js +37 -5
- package/resources/candidate-applications.js.map +1 -1
- package/resources/candidate-applications.mjs +37 -5
- package/resources/candidate-applications.mjs.map +1 -1
- package/resources/card-transactions.d.mts +1580 -30
- package/resources/card-transactions.d.mts.map +1 -1
- package/resources/card-transactions.d.ts +1580 -30
- package/resources/card-transactions.d.ts.map +1 -1
- package/resources/card-transactions.js +404 -4
- package/resources/card-transactions.js.map +1 -1
- package/resources/card-transactions.mjs +404 -4
- package/resources/card-transactions.mjs.map +1 -1
- package/resources/index.d.mts +6 -4
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +6 -4
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +7 -3
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +2 -0
- package/resources/index.mjs.map +1 -1
- package/resources/job-posts.d.mts +345 -0
- package/resources/job-posts.d.mts.map +1 -0
- package/resources/job-posts.d.ts +345 -0
- package/resources/job-posts.d.ts.map +1 -0
- package/resources/job-posts.js +110 -0
- package/resources/job-posts.js.map +1 -0
- package/resources/job-posts.mjs +106 -0
- package/resources/job-posts.mjs.map +1 -0
- package/resources/job-requisitions.d.mts +96 -4
- package/resources/job-requisitions.d.mts.map +1 -1
- package/resources/job-requisitions.d.ts +96 -4
- package/resources/job-requisitions.d.ts.map +1 -1
- package/resources/job-requisitions.js +64 -3
- package/resources/job-requisitions.js.map +1 -1
- package/resources/job-requisitions.mjs +64 -3
- package/resources/job-requisitions.mjs.map +1 -1
- package/resources/reimbursements.d.mts +1106 -64
- package/resources/reimbursements.d.mts.map +1 -1
- package/resources/reimbursements.d.ts +1106 -64
- package/resources/reimbursements.d.ts.map +1 -1
- package/resources/reimbursements.js +208 -0
- package/resources/reimbursements.js.map +1 -1
- package/resources/reimbursements.mjs +208 -0
- package/resources/reimbursements.mjs.map +1 -1
- package/resources/scheduled-payouts.d.mts +0 -2
- package/resources/scheduled-payouts.d.mts.map +1 -1
- package/resources/scheduled-payouts.d.ts +0 -2
- package/resources/scheduled-payouts.d.ts.map +1 -1
- package/resources/scheduled-payouts.js +0 -2
- package/resources/scheduled-payouts.js.map +1 -1
- package/resources/scheduled-payouts.mjs +0 -2
- package/resources/scheduled-payouts.mjs.map +1 -1
- package/src/client.ts +66 -0
- package/src/lib/manifest/app.ts +72 -2
- package/src/lib/manifest/composition.ts +8 -2
- package/src/lib/manifest/definitions/app.ts +4 -1
- package/src/lib/manifest/definitions/function.ts +1 -0
- package/src/lib/manifest/definitions/group.ts +159 -0
- package/src/lib/manifest/definitions/index.ts +25 -0
- package/src/lib/manifest/definitions/saved-super-group.ts +28 -0
- package/src/lib/manifest/existing-manifest-context.ts +24 -0
- package/src/lib/manifest/group.ts +282 -0
- package/src/lib/manifest/index.ts +16 -0
- package/src/lib/manifest/manifest-builder.ts +1 -0
- package/src/lib/manifest/manifest-function.ts +91 -1
- package/src/lib/manifest/saved-super-group.ts +171 -0
- package/src/resources/application-submissions.ts +315 -0
- package/src/resources/bills.ts +1085 -12
- package/src/resources/candidate-applications.ts +282 -9
- package/src/resources/card-transactions.ts +1874 -32
- package/src/resources/index.ts +24 -0
- package/src/resources/job-posts.ts +415 -0
- package/src/resources/job-requisitions.ts +110 -3
- package/src/resources/reimbursements.ts +1299 -63
- package/src/resources/scheduled-payouts.ts +0 -2
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { getExistingManifestContext, type ExistingManifestContextOptions } from './existing-manifest-context';
|
|
2
2
|
import type { ManifestComponentDeletion, ManifestScope } from './manifest-builder';
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
optionalStringComponentField,
|
|
5
|
+
requireObjectComponentField,
|
|
6
|
+
requireStringComponentField,
|
|
7
|
+
} from './_existing-component-fields';
|
|
8
|
+
import { Group } from './group';
|
|
9
|
+
import type { SavedSuperGroup } from './saved-super-group';
|
|
4
10
|
|
|
5
11
|
/**
|
|
6
12
|
* Initialization properties for {@link ManifestFunction}.
|
|
@@ -55,6 +61,36 @@ export interface ManifestFunctionProps {
|
|
|
55
61
|
* Optional. @default `false`
|
|
56
62
|
*/
|
|
57
63
|
isAsync?: boolean;
|
|
64
|
+
/** Embedded group controlling who can run this function. */
|
|
65
|
+
runnerGroup?: Group | null;
|
|
66
|
+
/** Embedded group controlling who can view this function. */
|
|
67
|
+
viewerGroup?: Group | null;
|
|
68
|
+
/** Embedded group controlling who can edit this function. */
|
|
69
|
+
editorGroup?: Group | null;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function inlineGroup(group: Group | null | undefined): Group | null | undefined {
|
|
73
|
+
if (group != null && typeof group._toDict !== 'function') {
|
|
74
|
+
throw new TypeError('Inline function groups must be created with defineGroup or Group.');
|
|
75
|
+
}
|
|
76
|
+
return group;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
function groupFromExistingComponent(
|
|
80
|
+
component: Record<string, unknown>,
|
|
81
|
+
key: 'runner_group' | 'viewer_group' | 'editor_group',
|
|
82
|
+
): Group | null | undefined {
|
|
83
|
+
const value = component[key];
|
|
84
|
+
if (value == null) return value;
|
|
85
|
+
const apiName = requireStringComponentField(component, 'api_name', ManifestFunction.componentType);
|
|
86
|
+
const slot =
|
|
87
|
+
key === 'runner_group' ? 'runner'
|
|
88
|
+
: key === 'viewer_group' ? 'viewer'
|
|
89
|
+
: 'editor';
|
|
90
|
+
return Group._fromExistingConfig(
|
|
91
|
+
requireObjectComponentField(component, key, ManifestFunction.componentType),
|
|
92
|
+
{ meObjId: `FUNCTION:${apiName}:${slot}`, spokeOwnerHandle: 'DUMMY_FUNCTIONS' },
|
|
93
|
+
);
|
|
58
94
|
}
|
|
59
95
|
|
|
60
96
|
/**
|
|
@@ -108,6 +144,9 @@ export class ManifestFunction {
|
|
|
108
144
|
private readonly _deploymentOptions: Record<string, any> | undefined;
|
|
109
145
|
private readonly _allowedDomains: string[] | undefined;
|
|
110
146
|
private readonly _isAsync: boolean;
|
|
147
|
+
private readonly _runnerGroup: Group | null | undefined;
|
|
148
|
+
private readonly _viewerGroup: Group | null | undefined;
|
|
149
|
+
private readonly _editorGroup: Group | null | undefined;
|
|
111
150
|
|
|
112
151
|
/**
|
|
113
152
|
* @param scope - The manifest to register this function with.
|
|
@@ -122,6 +161,9 @@ export class ManifestFunction {
|
|
|
122
161
|
this._deploymentOptions = props.deploymentOptions;
|
|
123
162
|
this._allowedDomains = props.allowedDomains;
|
|
124
163
|
this._isAsync = props.isAsync ?? false;
|
|
164
|
+
this._runnerGroup = inlineGroup(props.runnerGroup);
|
|
165
|
+
this._viewerGroup = inlineGroup(props.viewerGroup);
|
|
166
|
+
this._editorGroup = inlineGroup(props.editorGroup);
|
|
125
167
|
scope._register(this);
|
|
126
168
|
}
|
|
127
169
|
|
|
@@ -139,6 +181,12 @@ export class ManifestFunction {
|
|
|
139
181
|
name: requireStringComponentField(component, 'name', ManifestFunction.componentType),
|
|
140
182
|
description: optionalStringComponentField(component, 'description'),
|
|
141
183
|
};
|
|
184
|
+
const runnerGroup = groupFromExistingComponent(component, 'runner_group');
|
|
185
|
+
const viewerGroup = groupFromExistingComponent(component, 'viewer_group');
|
|
186
|
+
const editorGroup = groupFromExistingComponent(component, 'editor_group');
|
|
187
|
+
if (runnerGroup !== undefined) props.runnerGroup = runnerGroup;
|
|
188
|
+
if (viewerGroup !== undefined) props.viewerGroup = viewerGroup;
|
|
189
|
+
if (editorGroup !== undefined) props.editorGroup = editorGroup;
|
|
142
190
|
if (component['code_draft'] !== undefined) props.code = component['code_draft'];
|
|
143
191
|
if (component['dependencies'] !== undefined) props.dependencies = component['dependencies'];
|
|
144
192
|
if (component['deployment_options'] !== undefined) {
|
|
@@ -156,6 +204,27 @@ export class ManifestFunction {
|
|
|
156
204
|
return this._apiName;
|
|
157
205
|
}
|
|
158
206
|
|
|
207
|
+
getRunnerGroup(): Group | null | undefined {
|
|
208
|
+
return this._runnerGroup;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
getViewerGroup(): Group | null | undefined {
|
|
212
|
+
return this._viewerGroup;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
getEditorGroup(): Group | null | undefined {
|
|
216
|
+
return this._editorGroup;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
/** Only saved groups referenced by embedded rules become manifest dependencies. */
|
|
220
|
+
getReferencedGroups(): SavedSuperGroup[] {
|
|
221
|
+
return [
|
|
222
|
+
...(this._runnerGroup?.getReferencedGroups() ?? []),
|
|
223
|
+
...(this._viewerGroup?.getReferencedGroups() ?? []),
|
|
224
|
+
...(this._editorGroup?.getReferencedGroups() ?? []),
|
|
225
|
+
];
|
|
226
|
+
}
|
|
227
|
+
|
|
159
228
|
/**
|
|
160
229
|
* Replaces the TypeScript handler source code for this function.
|
|
161
230
|
*/
|
|
@@ -181,6 +250,27 @@ export class ManifestFunction {
|
|
|
181
250
|
if (this._deploymentOptions != null) component['deployment_options'] = this._deploymentOptions;
|
|
182
251
|
if (this._allowedDomains != null) component['allowed_domains'] = this._allowedDomains;
|
|
183
252
|
if (this._isAsync) component['is_async'] = true;
|
|
253
|
+
if (this._runnerGroup !== undefined) {
|
|
254
|
+
component['runner_group'] =
|
|
255
|
+
this._runnerGroup?._toDict({
|
|
256
|
+
meObjId: `FUNCTION:${this._apiName}:runner`,
|
|
257
|
+
spokeOwnerHandle: 'DUMMY_FUNCTIONS',
|
|
258
|
+
}) ?? null;
|
|
259
|
+
}
|
|
260
|
+
if (this._viewerGroup !== undefined) {
|
|
261
|
+
component['viewer_group'] =
|
|
262
|
+
this._viewerGroup?._toDict({
|
|
263
|
+
meObjId: `FUNCTION:${this._apiName}:viewer`,
|
|
264
|
+
spokeOwnerHandle: 'DUMMY_FUNCTIONS',
|
|
265
|
+
}) ?? null;
|
|
266
|
+
}
|
|
267
|
+
if (this._editorGroup !== undefined) {
|
|
268
|
+
component['editor_group'] =
|
|
269
|
+
this._editorGroup?._toDict({
|
|
270
|
+
meObjId: `FUNCTION:${this._apiName}:editor`,
|
|
271
|
+
spokeOwnerHandle: 'DUMMY_FUNCTIONS',
|
|
272
|
+
}) ?? null;
|
|
273
|
+
}
|
|
184
274
|
return component;
|
|
185
275
|
}
|
|
186
276
|
}
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import { getExistingManifestContext, type ExistingManifestContextOptions } from './existing-manifest-context';
|
|
2
|
+
import type { ManifestComponentDeletion, ManifestScope } from './manifest-builder';
|
|
3
|
+
import { Group, type GroupConfig, type GroupCoreRqlRule } from './group';
|
|
4
|
+
|
|
5
|
+
/** Saved-group creation only; Composer does not support updating sharing grants. */
|
|
6
|
+
export interface SavedSuperGroupSharingGrant {
|
|
7
|
+
shouldNotify: boolean;
|
|
8
|
+
groups: readonly { group: Group; grantType: 'VIEWER' | 'COLLABORATOR' }[];
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface SavedSuperGroupProps {
|
|
12
|
+
apiName: string;
|
|
13
|
+
group: Group;
|
|
14
|
+
spokeOwnerHandle?: string;
|
|
15
|
+
aliasAccessType?: 'Open' | 'Restricted';
|
|
16
|
+
/** Installed with a new saved group; Composer rejects changes to an existing sharing grant. */
|
|
17
|
+
sharingGrant?: SavedSuperGroupSharingGrant;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function validateApiName(apiName: string): void {
|
|
21
|
+
if (typeof apiName !== 'string' || !apiName.endsWith('__c')) {
|
|
22
|
+
throw new Error('SavedSuperGroup apiName must end with "__c".');
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/** Saved identity for a reusable SUPERGROUP configuration. */
|
|
27
|
+
export class SavedSuperGroup {
|
|
28
|
+
static readonly componentType = 'SUPERGROUP' as const;
|
|
29
|
+
|
|
30
|
+
static toDeletionIdentifier(apiName: string): ManifestComponentDeletion {
|
|
31
|
+
return {
|
|
32
|
+
type: SavedSuperGroup.componentType,
|
|
33
|
+
api_name: apiName,
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/** Fresh content is reusable; hydrated content remains bound to this saved group's identity. */
|
|
38
|
+
readonly group: Group;
|
|
39
|
+
private readonly _apiName: string;
|
|
40
|
+
private readonly _spokeOwnerHandle: string | undefined;
|
|
41
|
+
private readonly _aliasAccessType: 'Open' | 'Restricted' | undefined;
|
|
42
|
+
private readonly _sharingGrant: SavedSuperGroupSharingGrant | undefined;
|
|
43
|
+
private _loadedFromExisting = false;
|
|
44
|
+
|
|
45
|
+
constructor(scope: ManifestScope, props: SavedSuperGroupProps) {
|
|
46
|
+
validateApiName(props.apiName);
|
|
47
|
+
if (
|
|
48
|
+
typeof props.group !== 'object' ||
|
|
49
|
+
props.group === null ||
|
|
50
|
+
typeof props.group._toDict !== 'function'
|
|
51
|
+
) {
|
|
52
|
+
throw new Error('SavedSuperGroup group must be a Group.');
|
|
53
|
+
}
|
|
54
|
+
this.group = props.group;
|
|
55
|
+
this._apiName = props.apiName;
|
|
56
|
+
this._spokeOwnerHandle = props.spokeOwnerHandle;
|
|
57
|
+
this._aliasAccessType = props.aliasAccessType;
|
|
58
|
+
this._sharingGrant =
|
|
59
|
+
props.sharingGrant === undefined ?
|
|
60
|
+
undefined
|
|
61
|
+
: {
|
|
62
|
+
shouldNotify: props.sharingGrant.shouldNotify,
|
|
63
|
+
groups: props.sharingGrant.groups.map(({ group, grantType }) => ({ group, grantType })),
|
|
64
|
+
};
|
|
65
|
+
scope._register(this);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
static loadFromExisting(apiName: string, options: ExistingManifestContextOptions = {}): SavedSuperGroup {
|
|
69
|
+
return getExistingManifestContext(options).loadSavedSuperGroup(apiName);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/** @internal Hydrates a saved alias from existing manifest wire JSON. */
|
|
73
|
+
static _fromExistingComponent(scope: ManifestScope, component: Record<string, unknown>): SavedSuperGroup {
|
|
74
|
+
if (component['type'] !== SavedSuperGroup.componentType) {
|
|
75
|
+
throw new Error(`SavedSuperGroup component type must be "${SavedSuperGroup.componentType}".`);
|
|
76
|
+
}
|
|
77
|
+
if (component['group_type'] !== 'ALIAS') {
|
|
78
|
+
throw new Error('SavedSuperGroup group_type must be "ALIAS".');
|
|
79
|
+
}
|
|
80
|
+
const apiName = component['api_name'];
|
|
81
|
+
if (typeof apiName !== 'string') {
|
|
82
|
+
throw new Error('SUPERGROUP component field "api_name" must be a string.');
|
|
83
|
+
}
|
|
84
|
+
validateApiName(apiName);
|
|
85
|
+
const savedSuperGroup = new SavedSuperGroup(scope, {
|
|
86
|
+
apiName,
|
|
87
|
+
group: Group._fromExistingConfig(component, { savedApiName: apiName }),
|
|
88
|
+
});
|
|
89
|
+
savedSuperGroup._loadedFromExisting = true;
|
|
90
|
+
return savedSuperGroup;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
getApiName(): string {
|
|
94
|
+
return this._apiName;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
getName(): string {
|
|
98
|
+
return this.group.getName();
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
setName(name: string): this {
|
|
102
|
+
this.group.setName(name);
|
|
103
|
+
return this;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
setDescription(description: string | null): this {
|
|
107
|
+
this.group.setDescription(description);
|
|
108
|
+
return this;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
setCoreRqlRule(rule: GroupCoreRqlRule | null): this {
|
|
112
|
+
this.group.setCoreRqlRule(rule);
|
|
113
|
+
return this;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
getReferencedGroups(): SavedSuperGroup[] {
|
|
117
|
+
return [
|
|
118
|
+
...this.group.getReferencedGroups(),
|
|
119
|
+
...(this._sharingGrant?.groups.flatMap(({ group }) => group.getReferencedGroups()) ?? []),
|
|
120
|
+
];
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
toDict(): GroupConfig {
|
|
124
|
+
const config = this.group._toDict({ savedApiName: this._apiName });
|
|
125
|
+
if (this._loadedFromExisting) {
|
|
126
|
+
config['api_name'] = this._apiName;
|
|
127
|
+
return config;
|
|
128
|
+
}
|
|
129
|
+
if (this._sharingGrant !== undefined) {
|
|
130
|
+
if (typeof this._sharingGrant.shouldNotify !== 'boolean') {
|
|
131
|
+
throw new TypeError('Sharing grant notifications must be explicitly enabled or disabled.');
|
|
132
|
+
}
|
|
133
|
+
const owner = this._spokeOwnerHandle ?? 'GROUP_MANAGER';
|
|
134
|
+
const grantTypes = new Set<string>();
|
|
135
|
+
const groups = this._sharingGrant.groups.map(({ group, grantType }) => {
|
|
136
|
+
if ((grantType !== 'VIEWER' && grantType !== 'COLLABORATOR') || grantTypes.has(grantType)) {
|
|
137
|
+
throw new TypeError(
|
|
138
|
+
'Saved-group permission groups require distinct VIEWER or COLLABORATOR grants.',
|
|
139
|
+
);
|
|
140
|
+
}
|
|
141
|
+
grantTypes.add(grantType);
|
|
142
|
+
if (group == null || typeof group._toDict !== 'function') {
|
|
143
|
+
throw new TypeError('Sharing permissions require inline Group values.');
|
|
144
|
+
}
|
|
145
|
+
const permission = group._toDict({
|
|
146
|
+
meObjId: `SUPERGROUP:${this._apiName}:sharing_grant:${grantType}`,
|
|
147
|
+
spokeOwnerHandle: owner,
|
|
148
|
+
});
|
|
149
|
+
if (permission['group_type'] === 'ALIAS' || permission['sharing_grant']) {
|
|
150
|
+
throw new TypeError('Sharing permission groups cannot be saved groups or contain sharing grants.');
|
|
151
|
+
}
|
|
152
|
+
return { ...permission, grant_type: grantType };
|
|
153
|
+
});
|
|
154
|
+
config['sharing_grant'] = {
|
|
155
|
+
type: 'SHARING_GRANT',
|
|
156
|
+
spoke_owner_handle: owner,
|
|
157
|
+
groups: groups.length === 0 ? null : groups,
|
|
158
|
+
config: 'ALIAS',
|
|
159
|
+
should_notify: this._sharingGrant.shouldNotify,
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
return {
|
|
163
|
+
...config,
|
|
164
|
+
api_name: this._apiName,
|
|
165
|
+
identity_format_version: 2,
|
|
166
|
+
group_type: 'ALIAS',
|
|
167
|
+
spoke_owner_handle: this._spokeOwnerHandle ?? 'GROUP_MANAGER',
|
|
168
|
+
alias_access_type: this._aliasAccessType ?? null,
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
}
|
|
@@ -0,0 +1,315 @@
|
|
|
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 { APIPromise } from '../core/api-promise';
|
|
6
|
+
import { buildHeaders } from '../internal/headers';
|
|
7
|
+
import { RequestOptions } from '../internal/request-options';
|
|
8
|
+
import { path } from '../internal/utils/path';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* An application by a candidate to a specific job requisition
|
|
12
|
+
*/
|
|
13
|
+
export class ApplicationSubmissions extends APIResource {
|
|
14
|
+
/**
|
|
15
|
+
* Poll a receipt returned by application submission to discover creation status.
|
|
16
|
+
* On SUCCEEDED, retain application_id and candidate_id for recruiting status
|
|
17
|
+
* queries. Only the submitting integration in the same company can read the
|
|
18
|
+
* receipt. Requires candidate-applications.read or
|
|
19
|
+
* candidate-applications.read-write. UNKNOWN indicates an interrupted worker or no
|
|
20
|
+
* update for an hour; the application may still be created. Continue checking this
|
|
21
|
+
* receipt and do not automatically submit with a new key. Receipts and their
|
|
22
|
+
* idempotency keys are retained indefinitely with no automatic expiry. The receipt
|
|
23
|
+
* remains queryable and the key continues to replay it; UNKNOWN does not expire
|
|
24
|
+
* either.
|
|
25
|
+
*
|
|
26
|
+
* @example HTTP
|
|
27
|
+
* Representative request and response shapes.
|
|
28
|
+
* ```
|
|
29
|
+
* GET /application-submissions/{id}/ HTTP/1.1
|
|
30
|
+
* Host: rest.ripplingapis.com
|
|
31
|
+
* Accept: application/json
|
|
32
|
+
* Rippling-Api-Version: 2024-08-01
|
|
33
|
+
*
|
|
34
|
+
* HTTP/1.1 200 OK
|
|
35
|
+
* Content-Type: application/json
|
|
36
|
+
*
|
|
37
|
+
* {
|
|
38
|
+
* "__meta": {
|
|
39
|
+
* "redacted_fields": [
|
|
40
|
+
* {}
|
|
41
|
+
* ]
|
|
42
|
+
* }
|
|
43
|
+
* }
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
retrieve(id: string, options?: RequestOptions): APIPromise<ApplicationSubmissionRetrieveResponse> {
|
|
47
|
+
return this._client.get(path`/application-submissions/${id}/`, options);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Accepts an application for asynchronous processing and returns the full
|
|
52
|
+
* ApplicationSubmission receipt, including id, status, result IDs, and timestamps.
|
|
53
|
+
* Poll GET /application-submissions/{id}/ for creation status and result IDs.
|
|
54
|
+
* Supply Idempotency-Key (1-255 characters) to replay the same receipt after a
|
|
55
|
+
* lost response. Reusing a key with a different payload returns HTTP 409.
|
|
56
|
+
* Concurrent requests with the same key and payload return the same receipt and
|
|
57
|
+
* enqueue creation once. Receipts and their idempotency keys are retained
|
|
58
|
+
* indefinitely with no automatic expiry. The same key continues to replay its
|
|
59
|
+
* receipt; use a new key for a new submission. The one-hour UNKNOWN threshold does
|
|
60
|
+
* not expire the receipt or key. When job_post_id is supplied, it must belong to
|
|
61
|
+
* job_id, the authenticated company, and the same Recruiting installation.
|
|
62
|
+
* Duplicate submissions for the same candidate and job are matched to the existing
|
|
63
|
+
* active application; when job_post_id is supplied, duplicate matching is scoped
|
|
64
|
+
* to that job post, so the same candidate can apply to multiple posts under one
|
|
65
|
+
* requisition. After creation, use GET /candidate-applications/ to track
|
|
66
|
+
* recruiting status.
|
|
67
|
+
*
|
|
68
|
+
* @example HTTP
|
|
69
|
+
* Representative request and response shapes.
|
|
70
|
+
* ```
|
|
71
|
+
* POST /application-submissions/ HTTP/1.1
|
|
72
|
+
* Host: rest.ripplingapis.com
|
|
73
|
+
* Content-Type: application/json
|
|
74
|
+
* Accept: application/json
|
|
75
|
+
* Rippling-Api-Version: 2024-08-01
|
|
76
|
+
*
|
|
77
|
+
* {
|
|
78
|
+
* "candidate": {
|
|
79
|
+
* "email": "dev@stainless.com",
|
|
80
|
+
* "first_name": "first_name",
|
|
81
|
+
* "last_name": "last_name",
|
|
82
|
+
* "phone_number": "phone_number"
|
|
83
|
+
* },
|
|
84
|
+
* "job_id": "job_id"
|
|
85
|
+
* }
|
|
86
|
+
*
|
|
87
|
+
* HTTP/1.1 200 OK
|
|
88
|
+
* Content-Type: application/json
|
|
89
|
+
*
|
|
90
|
+
* {
|
|
91
|
+
* "id": "string",
|
|
92
|
+
* "created_at": "2025-01-01T00:00:00Z",
|
|
93
|
+
* "updated_at": "2025-01-01T00:00:00Z",
|
|
94
|
+
* "status": "QUEUED",
|
|
95
|
+
* "application_id": "string",
|
|
96
|
+
* "candidate_id": "string",
|
|
97
|
+
* "outcome": "CREATED",
|
|
98
|
+
* "error_code": "PROCESSING_INTERRUPTED"
|
|
99
|
+
* }
|
|
100
|
+
* ```
|
|
101
|
+
*/
|
|
102
|
+
create(
|
|
103
|
+
params: ApplicationSubmissionCreateParams,
|
|
104
|
+
options?: RequestOptions,
|
|
105
|
+
): APIPromise<ApplicationSubmissionCreateResponse> {
|
|
106
|
+
const { 'Idempotency-Key': idempotencyKey, ...body } = params;
|
|
107
|
+
return this._client.post('/application-submissions/', {
|
|
108
|
+
body,
|
|
109
|
+
...options,
|
|
110
|
+
headers: buildHeaders([
|
|
111
|
+
{ ...(idempotencyKey != null ? { 'Idempotency-Key': idempotencyKey } : undefined) },
|
|
112
|
+
options?.headers,
|
|
113
|
+
]),
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Meta information for the response.
|
|
120
|
+
*/
|
|
121
|
+
export interface ApplicationSubmissionRetrieveResponse extends BusinessPartnersAPI.Meta {
|
|
122
|
+
/**
|
|
123
|
+
* Identifier field
|
|
124
|
+
*/
|
|
125
|
+
id: string;
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Record creation date
|
|
129
|
+
*/
|
|
130
|
+
created_at: string;
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* QUEUED or PROCESSING until creation completes; SUCCEEDED includes result IDs;
|
|
134
|
+
* FAILED means creation exhausted retries. UNKNOWN means processing was
|
|
135
|
+
* interrupted or no update was received for an hour; creation may still complete.
|
|
136
|
+
* Do not resubmit with a new key automatically.
|
|
137
|
+
*/
|
|
138
|
+
status: 'QUEUED' | 'PROCESSING' | 'SUCCEEDED' | 'FAILED' | 'UNKNOWN';
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Record update date
|
|
142
|
+
*/
|
|
143
|
+
updated_at: string;
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Created or matched application ID
|
|
147
|
+
*/
|
|
148
|
+
application_id?: string | null;
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* Created or matched candidate ID
|
|
152
|
+
*/
|
|
153
|
+
candidate_id?: string | null;
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Safe machine-readable failure code. PROCESSING_INTERRUPTED means a worker was
|
|
157
|
+
* interrupted and creation may still complete; APPLICATION_CREATION_FAILED means
|
|
158
|
+
* creation exhausted retries. Null when no worker failure has been recorded,
|
|
159
|
+
* including when UNKNOWN is caused only by a stale receipt.
|
|
160
|
+
*/
|
|
161
|
+
error_code?: 'PROCESSING_INTERRUPTED' | 'APPLICATION_CREATION_FAILED' | null;
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* CREATED when this submission created the application; MATCHED when it reused an
|
|
165
|
+
* existing application. Null until successful, or for older receipts without a
|
|
166
|
+
* recorded outcome.
|
|
167
|
+
*/
|
|
168
|
+
outcome?: 'CREATED' | 'MATCHED' | null;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* Creation outcome for one submission, separate from the application's recruiting
|
|
173
|
+
* status.
|
|
174
|
+
*/
|
|
175
|
+
export interface ApplicationSubmissionCreateResponse {
|
|
176
|
+
/**
|
|
177
|
+
* Identifier field
|
|
178
|
+
*/
|
|
179
|
+
id: string;
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* Record creation date
|
|
183
|
+
*/
|
|
184
|
+
created_at: string;
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* QUEUED or PROCESSING until creation completes; SUCCEEDED includes result IDs;
|
|
188
|
+
* FAILED means creation exhausted retries. UNKNOWN means processing was
|
|
189
|
+
* interrupted or no update was received for an hour; creation may still complete.
|
|
190
|
+
* Do not resubmit with a new key automatically.
|
|
191
|
+
*/
|
|
192
|
+
status: 'QUEUED' | 'PROCESSING' | 'SUCCEEDED' | 'FAILED' | 'UNKNOWN';
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* Record update date
|
|
196
|
+
*/
|
|
197
|
+
updated_at: string;
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* Created or matched application ID
|
|
201
|
+
*/
|
|
202
|
+
application_id?: string | null;
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* Created or matched candidate ID
|
|
206
|
+
*/
|
|
207
|
+
candidate_id?: string | null;
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* Safe machine-readable failure code. PROCESSING_INTERRUPTED means a worker was
|
|
211
|
+
* interrupted and creation may still complete; APPLICATION_CREATION_FAILED means
|
|
212
|
+
* creation exhausted retries. Null when no worker failure has been recorded,
|
|
213
|
+
* including when UNKNOWN is caused only by a stale receipt.
|
|
214
|
+
*/
|
|
215
|
+
error_code?: 'PROCESSING_INTERRUPTED' | 'APPLICATION_CREATION_FAILED' | null;
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* CREATED when this submission created the application; MATCHED when it reused an
|
|
219
|
+
* existing application. Null until successful, or for older receipts without a
|
|
220
|
+
* recorded outcome.
|
|
221
|
+
*/
|
|
222
|
+
outcome?: 'CREATED' | 'MATCHED' | null;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
export interface ApplicationSubmissionCreateParams {
|
|
226
|
+
/**
|
|
227
|
+
* Body param
|
|
228
|
+
*/
|
|
229
|
+
candidate: ApplicationSubmissionCreateParams.Candidate;
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* Body param: Job requisition identifier.
|
|
233
|
+
*/
|
|
234
|
+
job_id: string;
|
|
235
|
+
|
|
236
|
+
/**
|
|
237
|
+
* Body param: Optional free-text name of the candidate's current employer, for
|
|
238
|
+
* example 'Acme Inc.'. Supply the employer name, not a Rippling company ID. No
|
|
239
|
+
* field-specific maximum length is enforced.
|
|
240
|
+
*/
|
|
241
|
+
current_company?: string;
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* Body param: Optional location-specific job post identifier belonging to job_id.
|
|
245
|
+
*/
|
|
246
|
+
job_post_id?: string;
|
|
247
|
+
|
|
248
|
+
/**
|
|
249
|
+
* Body param: Optional free-text description of the candidate's current location,
|
|
250
|
+
* for example 'Seattle, WA, US'. Supply a string, not a structured address or Work
|
|
251
|
+
* Location ID. No field-specific maximum length is enforced.
|
|
252
|
+
*/
|
|
253
|
+
location?: string;
|
|
254
|
+
|
|
255
|
+
/**
|
|
256
|
+
* Body param: Optional S3 or CDN URL of a resume already uploaded through Rippling
|
|
257
|
+
* Recruiting's file-upload flow. The file must be in permitted Recruiting storage
|
|
258
|
+
* for the authenticated company or a shared Recruiting upload area. Supply
|
|
259
|
+
* resume_file_extension with a supported MIME type; otherwise the resume is
|
|
260
|
+
* ignored. Base64 file contents and arbitrary external URLs are not accepted.
|
|
261
|
+
*/
|
|
262
|
+
resume?: string;
|
|
263
|
+
|
|
264
|
+
/**
|
|
265
|
+
* Body param: MIME type of the supplied resume, rather than a filename extension.
|
|
266
|
+
* Supported values: application/pdf, application/msword,
|
|
267
|
+
* application/vnd.openxmlformats-officedocument.wordprocessingml.document,
|
|
268
|
+
* text/plain, video/mp4, video/webm. Required to attach a supplied resume; a
|
|
269
|
+
* missing or unsupported value causes the resume to be ignored.
|
|
270
|
+
*/
|
|
271
|
+
resume_file_extension?: string;
|
|
272
|
+
|
|
273
|
+
/**
|
|
274
|
+
* Body param: Optional identifier of a role in the authenticated company.
|
|
275
|
+
*/
|
|
276
|
+
sourcing_credit?: string;
|
|
277
|
+
|
|
278
|
+
/**
|
|
279
|
+
* Header param: Reuse this key with the same request body to retrieve the same
|
|
280
|
+
* submission receipt. Omitting it creates a new receipt for each request.
|
|
281
|
+
*/
|
|
282
|
+
'Idempotency-Key'?: string;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
export namespace ApplicationSubmissionCreateParams {
|
|
286
|
+
export interface Candidate {
|
|
287
|
+
/**
|
|
288
|
+
* Candidate's email address.
|
|
289
|
+
*/
|
|
290
|
+
email: string;
|
|
291
|
+
|
|
292
|
+
/**
|
|
293
|
+
* Candidate's first name.
|
|
294
|
+
*/
|
|
295
|
+
first_name: string;
|
|
296
|
+
|
|
297
|
+
/**
|
|
298
|
+
* Candidate's last name.
|
|
299
|
+
*/
|
|
300
|
+
last_name: string;
|
|
301
|
+
|
|
302
|
+
/**
|
|
303
|
+
* Candidate phone number in E.164 format.
|
|
304
|
+
*/
|
|
305
|
+
phone_number: string;
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
export declare namespace ApplicationSubmissions {
|
|
310
|
+
export {
|
|
311
|
+
type ApplicationSubmissionRetrieveResponse as ApplicationSubmissionRetrieveResponse,
|
|
312
|
+
type ApplicationSubmissionCreateResponse as ApplicationSubmissionCreateResponse,
|
|
313
|
+
type ApplicationSubmissionCreateParams as ApplicationSubmissionCreateParams,
|
|
314
|
+
};
|
|
315
|
+
}
|