@osdk/seed-compiler 0.11.0 → 0.12.0

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.
@@ -1,51 +0,0 @@
1
- /*
2
- * Copyright 2025 Palantir Technologies, Inc. All rights reserved.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
-
17
- /**
18
- * Minimal schema for one object type — only what the compiler needs.
19
- *
20
- * - `properties`: property API name → wire type (e.g. `"timestamp"`, `"long"`),
21
- * used by the validator to enforce property existence, JS-type expectations,
22
- * and string format regexes.
23
- * - `primaryKeyApiName`: PK field name (for cross-file duplicate detection in merge).
24
- */
25
-
26
- /** Maps object type API name → its schema. */
27
-
28
- /**
29
- * Builds a {@link SchemaMap} from an `OntologyFullMetadata` document — the
30
- * shape produced by the OSDK SDK generator and serialized to
31
- * `ontology-metadata.json` alongside the generated `@ontology/sdk` package.
32
- *
33
- * Only `objectTypes` are read; the other top-level fields (action types,
34
- * query types, interfaces, etc.) are not relevant to seed validation.
35
- */
36
- export function schemaFromMetadata(metadata) {
37
- const map = new Map();
38
- for (const [apiName, full] of Object.entries(metadata.objectTypes)) {
39
- const ot = full.objectType;
40
- const properties = new Map();
41
- for (const [propApiName, prop] of Object.entries(ot.properties)) {
42
- properties.set(propApiName, prop.dataType.type);
43
- }
44
- map.set(apiName, {
45
- properties,
46
- primaryKeyApiName: ot.primaryKey
47
- });
48
- }
49
- return map;
50
- }
51
- //# sourceMappingURL=schema.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"schema.js","names":["schemaFromMetadata","metadata","map","Map","apiName","full","Object","entries","objectTypes","ot","objectType","properties","propApiName","prop","set","dataType","type","primaryKeyApiName","primaryKey"],"sources":["schema.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { OntologyFullMetadata } from \"@osdk/foundry.ontologies\";\n\n/**\n * Minimal schema for one object type — only what the compiler needs.\n *\n * - `properties`: property API name → wire type (e.g. `\"timestamp\"`, `\"long\"`),\n * used by the validator to enforce property existence, JS-type expectations,\n * and string format regexes.\n * - `primaryKeyApiName`: PK field name (for cross-file duplicate detection in merge).\n */\nexport interface ObjectTypeSchema {\n properties: Map<string, string>;\n primaryKeyApiName: string;\n}\n\n/** Maps object type API name → its schema. */\nexport type SchemaMap = Map<string, ObjectTypeSchema>;\n\n/**\n * Builds a {@link SchemaMap} from an `OntologyFullMetadata` document — the\n * shape produced by the OSDK SDK generator and serialized to\n * `ontology-metadata.json` alongside the generated `@ontology/sdk` package.\n *\n * Only `objectTypes` are read; the other top-level fields (action types,\n * query types, interfaces, etc.) are not relevant to seed validation.\n */\nexport function schemaFromMetadata(metadata: OntologyFullMetadata): SchemaMap {\n const map: SchemaMap = new Map();\n\n for (const [apiName, full] of Object.entries(metadata.objectTypes)) {\n const ot = full.objectType;\n\n const properties = new Map<string, string>();\n for (const [propApiName, prop] of Object.entries(ot.properties)) {\n properties.set(propApiName, prop.dataType.type);\n }\n\n map.set(apiName, {\n properties,\n primaryKeyApiName: ot.primaryKey,\n });\n }\n\n return map;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAMA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,kBAAkBA,CAACC,QAA8B,EAAa;EAC5E,MAAMC,GAAc,GAAG,IAAIC,GAAG,CAAC,CAAC;EAEhC,KAAK,MAAM,CAACC,OAAO,EAAEC,IAAI,CAAC,IAAIC,MAAM,CAACC,OAAO,CAACN,QAAQ,CAACO,WAAW,CAAC,EAAE;IAClE,MAAMC,EAAE,GAAGJ,IAAI,CAACK,UAAU;IAE1B,MAAMC,UAAU,GAAG,IAAIR,GAAG,CAAiB,CAAC;IAC5C,KAAK,MAAM,CAACS,WAAW,EAAEC,IAAI,CAAC,IAAIP,MAAM,CAACC,OAAO,CAACE,EAAE,CAACE,UAAU,CAAC,EAAE;MAC/DA,UAAU,CAACG,GAAG,CAACF,WAAW,EAAEC,IAAI,CAACE,QAAQ,CAACC,IAAI,CAAC;IACjD;IAEAd,GAAG,CAACY,GAAG,CAACV,OAAO,EAAE;MACfO,UAAU;MACVM,iBAAiB,EAAER,EAAE,CAACS;IACxB,CAAC,CAAC;EACJ;EAEA,OAAOhB,GAAG;AACZ","ignoreList":[]}
@@ -1,24 +0,0 @@
1
- import type { OntologyFullMetadata } from "@osdk/foundry.ontologies";
2
- /**
3
- * Minimal schema for one object type — only what the compiler needs.
4
- *
5
- * - `properties`: property API name → wire type (e.g. `"timestamp"`, `"long"`),
6
- * used by the validator to enforce property existence, JS-type expectations,
7
- * and string format regexes.
8
- * - `primaryKeyApiName`: PK field name (for cross-file duplicate detection in merge).
9
- */
10
- export interface ObjectTypeSchema {
11
- properties: Map<string, string>;
12
- primaryKeyApiName: string;
13
- }
14
- /** Maps object type API name → its schema. */
15
- export type SchemaMap = Map<string, ObjectTypeSchema>;
16
- /**
17
- * Builds a {@link SchemaMap} from an `OntologyFullMetadata` document — the
18
- * shape produced by the OSDK SDK generator and serialized to
19
- * `ontology-metadata.json` alongside the generated `@ontology/sdk` package.
20
- *
21
- * Only `objectTypes` are read; the other top-level fields (action types,
22
- * query types, interfaces, etc.) are not relevant to seed validation.
23
- */
24
- export declare function schemaFromMetadata(metadata: OntologyFullMetadata): SchemaMap;
@@ -1 +0,0 @@
1
- {"mappings":"AAgBA,cAAc,4BAA4B,0BAA2B;;;;;;;;;AAUrE,iBAAiB,iBAAiB;CAChC,YAAY;CACZ;AACD;;AAGD,YAAY,YAAY,YAAY;;;;;;;;;AAUpC,OAAO,iBAAS,mBAAmBA,UAAU,uBAAuB","names":["metadata: OntologyFullMetadata"],"sources":["../../src/schema.ts"],"version":3,"file":"schema.d.ts"}