Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into mf/upgrade-generator
Browse files Browse the repository at this point in the history
  • Loading branch information
mfedderly committed Feb 14, 2024
2 parents 9bfa98b + f7f4441 commit cb2772a
Show file tree
Hide file tree
Showing 90 changed files with 1,129 additions and 264 deletions.
5 changes: 5 additions & 0 deletions .monorepolint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,10 @@ export default {
options: {
entries: {
license: "Apache-2.0",
repository: {
"type": "git",
"url": "https://github.com/palantir/osdk-ts.git",
},
},
entriesExist: ["version"],
},
Expand Down Expand Up @@ -357,6 +361,7 @@ package you do so at your own risk.
"access",
"author",
"license",
"repository",
"exports",
"file",
"scripts",
Expand Down
4 changes: 4 additions & 0 deletions examples/basic/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
"private": true,
"version": "0.0.0",
"license": "Apache-2.0",
"repository": {
"type": "git",
"url": "https://github.com/palantir/osdk-ts.git"
},
"exports": {
".": {
"types": "./build/types/index.d.ts",
Expand Down
88 changes: 88 additions & 0 deletions examples/basic/cli/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,94 @@ async function runTests() {

console.log(result.data[0].geohash);

// drew a polygon that intersects NY, NJ and PA
const intersectResult = await client.objects.BoundariesUsState.where({
geometry10M: {
$intersects: {
polygon: [
[
[
-75.09653518696345,
41.45348773788706,
],
[
-74.72935560273072,
40.946390252360715,
],
[
-74.06735144976177,
41.20045829999643,
],
[
-74.3141382218981,
41.67866397375818,
],
[
-75.09653518696345,
41.45348773788706,
],
],
],
},
},
}).fetchPageOrThrow();

console.log(intersectResult.data.map(data => data.usState));
console.log(intersectResult.data[0].geometry10M);

const intersectResultGeojson = await client.objects.BoundariesUsState
.where({
$not: {
geometry10M: {
$intersects: {
type: "Polygon",
coordinates: [
[
[
-75.09653518696345,
41.45348773788706,
],
[
-74.72935560273072,
40.946390252360715,
],
[
-74.06735144976177,
41.20045829999643,
],
[
-74.3141382218981,
41.67866397375818,
],
[
-75.09653518696345,
41.45348773788706,
],
],
],
},
},
},
}).fetchPageOrThrow();

// should be every state except NJ,NY,PA
console.log(intersectResultGeojson.data.map(data => data.usState));

// drew a bbox that intersects NY, NJ and PA
const intersectResultbbox = await client.objects.BoundariesUsState
.where({
geometry10M: {
$intersects: [
-75.18845865422688,
41.151409247298204,
-74.38919193981752,
41.676311210175015,
],
},
}).fetchPageOrThrow();

console.log(intersectResultbbox.data.map(data => data.usState));

await typeChecks(client);
} catch (e) {
console.error("Caught an error we did not expect", typeof e);
Expand Down
25 changes: 25 additions & 0 deletions examples/basic/sdk/ontology.json
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,31 @@
},
"linkTypes": []
},
"BoundariesUsState": {
"objectType": {
"apiName": "BoundariesUsState",
"primaryKey": "usState",
"displayName": "Boundaries US State",
"description": "Boundaries US State",
"properties": {
"usState": {
"dataType": {
"type": "string"
}
},
"geometry10M": {
"dataType": {
"type": "geoshape"
},
"description": "geoshape",
"displayName": "Geometry10M"
}
},
"status": "ACTIVE",
"rid": "ridforBoundariesUsState"
},
"linkTypes": []
},
"Todo": {
"objectType": {
"apiName": "Todo",
Expand Down
4 changes: 4 additions & 0 deletions examples/basic/sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
"version": "0.0.0",
"description": "",
"license": "Apache-2.0",
"repository": {
"type": "git",
"url": "https://github.com/palantir/osdk-ts.git"
},
"exports": {
".": {
"types": "./build/types/index.d.ts",
Expand Down
5 changes: 4 additions & 1 deletion examples/basic/sdk/src/generatedNoCheck/Ontology.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const _Ontology = {
metadata: OntologyMetadata,
objects: {
WeatherStation: Objects.WeatherStation,
BoundariesUsState: Objects.BoundariesUsState,
Todo: Objects.Todo,
Person: Objects.Person,
Employee: Objects.Employee,
Expand All @@ -23,7 +24,9 @@ const _Ontology = {
interfaces: {
SimpleInterface: Interfaces.SimpleInterface,
},
} satisfies OntologyDefinition<'WeatherStation' | 'Todo' | 'Person' | 'Employee' | 'ObjectTypeWithAllPropertyTypes'>;
} satisfies OntologyDefinition<
'WeatherStation' | 'BoundariesUsState' | 'Todo' | 'Person' | 'Employee' | 'ObjectTypeWithAllPropertyTypes'
>;

type _Ontology = typeof _Ontology;
export interface Ontology extends _Ontology {}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export * from './objects/BoundariesUsState.js';
export * from './objects/Employee.js';
export * from './objects/ObjectTypeWithAllPropertyTypes.js';
export * from './objects/Person.js';
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import type { ObjectTypeDefinition } from '@osdk/api';

export const BoundariesUsState = {
apiName: 'BoundariesUsState',
description: 'Boundaries US State',
primaryKeyType: 'string',
links: {},
properties: {
usState: {
multiplicity: false,
type: 'string',
nullable: false,
},
geometry10M: {
multiplicity: false,
description: 'geoshape',
type: 'geoshape',
nullable: true,
},
},
} satisfies ObjectTypeDefinition<'BoundariesUsState', never>;
4 changes: 4 additions & 0 deletions examples/one_dot_one/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
"version": "0.0.17",
"description": "",
"license": "Apache-2.0",
"repository": {
"type": "git",
"url": "https://github.com/palantir/osdk-ts.git"
},
"exports": {
".": {
"types": "./build/types/index.d.ts",
Expand Down
4 changes: 4 additions & 0 deletions examples/todoapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
"private": true,
"version": "0.0.10",
"license": "Apache-2.0",
"repository": {
"type": "git",
"url": "https://github.com/palantir/osdk-ts.git"
},
"scripts": {
"build": "tsc && vite build",
"codegen": "rm -rf src/generatedNoCheck/* src/generatedNoCheck2/* && osdk unstable typescript generate --outDir src/generatedNoCheck --ontologyPath ontology.json --version dev && osdk unstable typescript generate --outDir src/generatedNoCheck2 --beta --ontologyPath ontology.json --version dev",
Expand Down
4 changes: 4 additions & 0 deletions monorepo/eslint-config-sane/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
"private": true,
"version": "0.0.0",
"license": "Apache-2.0",
"repository": {
"type": "git",
"url": "https://github.com/palantir/osdk-ts.git"
},
"exports": {
"./library": {
"require": "./library.cjs"
Expand Down
4 changes: 4 additions & 0 deletions monorepo/mytsup/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
"private": true,
"version": "0.0.0",
"license": "Apache-2.0",
"repository": {
"type": "git",
"url": "https://github.com/palantir/osdk-ts.git"
},
"exports": {
".": {
"import": "./tsup.mjs"
Expand Down
4 changes: 4 additions & 0 deletions monorepo/tsconfig/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
"private": true,
"version": "0.0.0",
"license": "Apache-2.0",
"repository": {
"type": "git",
"url": "https://github.com/palantir/osdk-ts.git"
},
"exports": {
"./base": "./tsconfig.base.json"
},
Expand Down
4 changes: 4 additions & 0 deletions packages/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
"description": "",
"access": "public",
"license": "Apache-2.0",
"repository": {
"type": "git",
"url": "https://github.com/palantir/osdk-ts.git"
},
"exports": {
".": {
"types": "./build/types/index.d.ts",
Expand Down
5 changes: 5 additions & 0 deletions packages/cli/changelog/0.5.0/pr-47.v2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
type: improvement
improvement:
description: Increase CLI max width to 150 columns
links:
- https://github.com/palantir/osdk-ts/pull/47
5 changes: 5 additions & 0 deletions packages/cli/changelog/0.5.0/pr-49.v2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
type: improvement
improvement:
description: Debug log site zip stats
links:
- https://github.com/palantir/osdk-ts/pull/49
5 changes: 5 additions & 0 deletions packages/cli/changelog/0.5.0/pr-51.v2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
type: improvement
improvement:
description: Clean up yargs handling and consola imports
links:
- https://github.com/palantir/osdk-ts/pull/51
5 changes: 5 additions & 0 deletions packages/cli/changelog/0.6.0/pr-54.v2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
type: improvement
improvement:
description: Review CLI docs wording
links:
- https://github.com/palantir/osdk-ts/pull/54
5 changes: 5 additions & 0 deletions packages/cli/changelog/0.6.0/pr-56.v2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
type: improvement
improvement:
description: Prompt user for destructive CLI commands
links:
- https://github.com/palantir/osdk-ts/pull/56
5 changes: 5 additions & 0 deletions packages/cli/changelog/0.6.0/pr-58.v2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
type: improvement
improvement:
description: Display site link after CLI site deploy command
links:
- https://github.com/palantir/osdk-ts/pull/58
5 changes: 5 additions & 0 deletions packages/cli/changelog/0.7.0/pr-50.v2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
type: improvement
improvement:
description: Harmonize usage of optional `foundryUrl` across all cli commands
links:
- https://github.com/palantir/osdk-ts/pull/50
5 changes: 5 additions & 0 deletions packages/cli/changelog/0.7.0/pr-52.v2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
type: improvement
improvement:
description: Handle version/autoVersion selection in the parsing layer
links:
- https://github.com/palantir/osdk-ts/pull/52
5 changes: 5 additions & 0 deletions packages/cli/changelog/0.7.0/pr-55.v2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
type: improvement
improvement:
description: Address minor issues
links:
- https://github.com/palantir/osdk-ts/pull/55
5 changes: 5 additions & 0 deletions packages/cli/changelog/0.7.0/pr-61.v2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
type: improvement
improvement:
description: CLI error tips
links:
- https://github.com/palantir/osdk-ts/pull/61
5 changes: 5 additions & 0 deletions packages/cli/changelog/0.7.0/pr-63.v2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
type: improvement
improvement:
description: Update ExitProcessError tips and use option instead of argument
links:
- https://github.com/palantir/osdk-ts/pull/63
8 changes: 7 additions & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
{
"name": "@osdk/cli",
"version": "0.4.0",
"version": "0.8.0",
"description": "",
"access": "public",
"license": "Apache-2.0",
"repository": {
"type": "git",
"url": "https://github.com/palantir/osdk-ts.git"
},
"exports": {
".": {
"types": "./build/types/index.d.ts",
Expand Down Expand Up @@ -38,12 +42,14 @@
"consola": "^3.2.3",
"find-up": "^7.0.0",
"open": "^9.1.0",
"semver": "^7.6.0",
"yargs": "^17.7.2"
},
"devDependencies": {
"@types/archiver": "^6.0.0",
"@types/ngeohash": "^0.6.4",
"@types/node": "^18.0.0",
"@types/semver": "^7.5.7",
"@types/yargs": "^17.0.29",
"ts-expect": "^1.3.0",
"typescript": "^5.2.2"
Expand Down
6 changes: 5 additions & 1 deletion packages/cli/src/ExitProcessError.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@
*/

export class ExitProcessError extends Error {
constructor(public readonly errorCode: number, msg?: string) {
constructor(
public readonly errorCode: number,
public readonly msg?: string,
public readonly tip?: string,
) {
super(msg);
}
}
Loading

0 comments on commit cb2772a

Please sign in to comment.