-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #94 from palantir/ea/ontology-tweaks
Ontology tweaks
- Loading branch information
Showing
10 changed files
with
221 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
68 changes: 68 additions & 0 deletions
68
examples/basic/sdk/src/generatedNoCheck/ontology/actions/assignEmployee1.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
import type { ActionDefinition, ObjectActionDataType } from '@osdk/api'; | ||
import type { ActionReturnTypeForOptions, ApplyActionOptions, NOOP, OsdkActionParameters } from '@osdk/client'; | ||
import type { Employee, Venture } from '../objects.js'; | ||
|
||
// Represents the definition of the parameters for the action | ||
export type ActionDef$assignEmployee1$Params = { | ||
'employee-1': { | ||
multiplicity: false; | ||
type: ObjectActionDataType<'Employee', Employee>; | ||
nullable: false; | ||
}; | ||
'venture-1': { | ||
multiplicity: false; | ||
type: ObjectActionDataType<'Venture', Venture>; | ||
nullable: false; | ||
}; | ||
}; | ||
|
||
// Represents the runtime arguments for the action | ||
export type assignEmployee1$Params = NOOP<OsdkActionParameters<ActionDef$assignEmployee1$Params>>; | ||
|
||
// Represents a fqn of the action | ||
export interface assignEmployee1 { | ||
/** | ||
* Assigns an employee to a venture | ||
*/ | ||
<OP extends ApplyActionOptions>(args: assignEmployee1$Params, options?: OP): Promise<ActionReturnTypeForOptions<OP>>; | ||
} | ||
|
||
// Represents the definition of the action | ||
export interface ActionDef$assignEmployee1 | ||
extends ActionDefinition<'assignEmployee1', 'Employee' | 'Venture', assignEmployee1> { | ||
type: 'action'; | ||
apiName: 'assignEmployee1'; | ||
description: 'Assigns an employee to a venture'; | ||
modifiedEntities: { Employee: { created: false; modified: true } }; | ||
parameters: ActionDef$assignEmployee1$Params; | ||
} | ||
|
||
export const assignEmployee1: ActionDef$assignEmployee1 = { | ||
type: 'action', | ||
apiName: 'assignEmployee1', | ||
parameters: { | ||
'employee-1': { | ||
multiplicity: false, | ||
type: { | ||
type: 'object', | ||
object: 'Employee', | ||
}, | ||
nullable: false, | ||
}, | ||
'venture-1': { | ||
multiplicity: false, | ||
type: { | ||
type: 'object', | ||
object: 'Venture', | ||
}, | ||
nullable: false, | ||
}, | ||
}, | ||
description: 'Assigns an employee to a venture', | ||
modifiedEntities: { | ||
Employee: { | ||
created: false, | ||
modified: true, | ||
}, | ||
}, | ||
}; |
1 change: 1 addition & 0 deletions
1
examples/basic/sdk/src/generatedNoCheck/ontology/actions/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
export { actionTakesAllParameterTypes } from './actionTakesAllParameterTypes.js'; | ||
export { assignEmployee1 } from './assignEmployee1.js'; | ||
export { createTodo } from './createTodo.js'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
examples/basic/sdk/src/generatedNoCheck/ontology/objects/Venture.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import type { ObjectTypeDefinition, ObjectTypeLinkDefinition, PropertyDef } from '@osdk/api'; | ||
|
||
import type { Employee } from './Employee.js'; | ||
|
||
export interface Venture extends ObjectTypeDefinition<'Venture', Venture> { | ||
description: 'A venture'; | ||
primaryKeyApiName: 'ventureId'; | ||
primaryKeyType: 'string'; | ||
links: { | ||
employees: ObjectTypeLinkDefinition<Employee, true>; | ||
}; | ||
properties: { | ||
ventureId: PropertyDef<'string', 'non-nullable', 'single'>; | ||
ventureName: PropertyDef<'string', 'nullable', 'single'>; | ||
ventureStart: PropertyDef<'datetime', 'nullable', 'single'>; | ||
}; | ||
} | ||
|
||
export const Venture: Venture = { | ||
type: 'object', | ||
apiName: 'Venture', | ||
description: 'A venture', | ||
primaryKeyApiName: 'ventureId', | ||
primaryKeyType: 'string', | ||
links: { | ||
employees: { | ||
multiplicity: true, | ||
targetType: 'Employee', | ||
}, | ||
}, | ||
properties: { | ||
ventureId: { | ||
multiplicity: false, | ||
type: 'string', | ||
nullable: false, | ||
}, | ||
ventureName: { | ||
multiplicity: false, | ||
type: 'string', | ||
nullable: true, | ||
}, | ||
ventureStart: { | ||
multiplicity: false, | ||
type: 'datetime', | ||
nullable: true, | ||
}, | ||
}, | ||
}; |