From e84d5a3cf746464d3c6c9ee68b29a09a4c24917b Mon Sep 17 00:00:00 2001 From: Saurav Date: Fri, 26 Jul 2024 11:28:02 -0400 Subject: [PATCH 1/7] start js docs work --- .../client.api/src/timeseries/timeseries.ts | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/packages/client.api/src/timeseries/timeseries.ts b/packages/client.api/src/timeseries/timeseries.ts index be8d2ffb5..9add51d87 100644 --- a/packages/client.api/src/timeseries/timeseries.ts +++ b/packages/client.api/src/timeseries/timeseries.ts @@ -68,8 +68,36 @@ export interface TimeSeriesPoint { } export interface TimeSeriesProperty { + /** + * Queries the first point of the Timeseries + */ getFirstPoint(): Promise>; + /** + * Queries the last point of the Timeseries + */ getLastPoint(): Promise>; + /** + * Loads all points, within the given time range if that's provided + * @param query a query representing either an absolute or relative range of time + * @example + * const points = await employee.employeeStatus?.getAllPoints({ + $after: 1, + $unit: "month", + }); + */ getAllPoints(query?: TimeSeriesQuery): Promise>>; + /** + * Returns an async iterator to load all points + * within the given time range if that's provided + * @param query a query representing either an absolute or relative range of time + * @example + * const iterator = employee.employeeStatus?.asyncIter({ + $after: 1, + $unit: "month", + }); + for await (const point of iterator) { + // Handle time series point + } + */ asyncIterPoints(query?: TimeSeriesQuery): AsyncGenerator>; } From ab1101f74e0c29d6d6c1f52498e1c8d408562b7d Mon Sep 17 00:00:00 2001 From: Saurav Date: Tue, 30 Jul 2024 15:22:08 -0400 Subject: [PATCH 2/7] add objectset js docs --- etc/client.api.report.api.md | 60 ++++++--- .../client.api/src/objectSet/ObjectSet.ts | 115 ++++++++++++++++++ 2 files changed, 159 insertions(+), 16 deletions(-) diff --git a/etc/client.api.report.api.md b/etc/client.api.report.api.md index 09a11e96c..03d6dea05 100644 --- a/etc/client.api.report.api.md +++ b/etc/client.api.report.api.md @@ -413,13 +413,25 @@ export type LinkNames = keyof Q["links"] // @public (undocumented) export interface MinimalObjectSet extends BaseObjectSet { - // (undocumented) + // Warning: (tsdoc-escape-right-brace) The "}" character should be escaped using a backslash to avoid confusion with a TSDoc inline tag asyncIter: () => AsyncIterableIterator>; - // (undocumented) + // Warning: (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen + // Warning: (tsdoc-malformed-inline-tag) Expecting a TSDoc tag starting with "{@" + // Warning: (tsdoc-escape-right-brace) The "}" character should be escaped using a backslash to avoid confusion with a TSDoc inline tag fetchPage: , R extends boolean, const A extends Augments, S extends NullabilityAdherence = NullabilityAdherenceDefault>(args?: FetchPageArgs) => Promise>; - // (undocumented) + // Warning: (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen + // Warning: (tsdoc-malformed-inline-tag) Expecting a TSDoc tag starting with "{@" + // Warning: (tsdoc-escape-right-brace) The "}" character should be escaped using a backslash to avoid confusion with a TSDoc inline tag + // Warning: (tsdoc-malformed-inline-tag) Expecting a TSDoc tag starting with "{@" + // Warning: (tsdoc-escape-right-brace) The "}" character should be escaped using a backslash to avoid confusion with a TSDoc inline tag fetchPageWithErrors: , R extends boolean, const A extends Augments, S extends NullabilityAdherence = NullabilityAdherenceDefault>(args?: FetchPageArgs) => Promise>>; - // (undocumented) + // Warning: (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen + // Warning: (tsdoc-malformed-inline-tag) Expecting a TSDoc tag starting with "{@" + // Warning: (tsdoc-escape-right-brace) The "}" character should be escaped using a backslash to avoid confusion with a TSDoc inline tag + // Warning: (tsdoc-malformed-inline-tag) Expecting a TSDoc tag starting with "{@" + // Warning: (tsdoc-escape-right-brace) The "}" character should be escaped using a backslash to avoid confusion with a TSDoc inline tag + // Warning: (tsdoc-malformed-inline-tag) Expecting a TSDoc tag starting with "{@" + // Warning: (tsdoc-escape-right-brace) The "}" character should be escaped using a backslash to avoid confusion with a TSDoc inline tag where: (clause: WhereClause) => MinimalObjectSet; } @@ -445,21 +457,33 @@ export type NumericAggregateOption = "min" | "max" | "sum" | "avg" | "approximat // @public (undocumented) export interface ObjectSet extends MinimalObjectSet { - // (undocumented) + // Warning: (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen + // Warning: (tsdoc-malformed-inline-tag) Expecting a TSDoc tag starting with "{@" + // Warning: (tsdoc-malformed-inline-tag) Expecting a TSDoc tag starting with "{@" + // Warning: (tsdoc-escape-right-brace) The "}" character should be escaped using a backslash to avoid confusion with a TSDoc inline tag + // Warning: (tsdoc-malformed-inline-tag) Expecting a TSDoc tag starting with "{@" + // Warning: (tsdoc-malformed-inline-tag) Expecting a TSDoc tag starting with "{@" + // Warning: (tsdoc-escape-right-brace) The "}" character should be escaped using a backslash to avoid confusion with a TSDoc inline tag + // Warning: (tsdoc-escape-right-brace) The "}" character should be escaped using a backslash to avoid confusion with a TSDoc inline tag + // Warning: (tsdoc-escape-right-brace) The "}" character should be escaped using a backslash to avoid confusion with a TSDoc inline tag aggregate: >(req: AggregateOptsThatErrorsAndDisallowsOrderingWithMultipleGroupBy) => Promise>; - // (undocumented) fetchOne: Q extends ObjectTypeDefinition ? , R extends boolean, S extends false | "throw" = NullabilityAdherenceDefault>(primaryKey: PropertyValueClientToWire[Q["primaryKeyType"]], options?: SelectArg) => Promise> : never; - // (undocumented) fetchOneWithErrors: Q extends ObjectTypeDefinition ? , R extends boolean, S extends false | "throw" = NullabilityAdherenceDefault>(primaryKey: PropertyValueClientToWire[Q["primaryKeyType"]], options?: SelectArg) => Promise>> : never; - // (undocumented) + // Warning: (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen intersect: (...objectSets: ReadonlyArray>) => ObjectSet; - // (undocumented) + // Warning: (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen pivotTo: >(type: L) => ObjectSet>; - // (undocumented) + // Warning: (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen subtract: (...objectSets: ReadonlyArray>) => ObjectSet; - // (undocumented) + // Warning: (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen union: (...objectSets: ReadonlyArray>) => ObjectSet; - // (undocumented) + // Warning: (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen + // Warning: (tsdoc-malformed-inline-tag) Expecting a TSDoc tag starting with "{@" + // Warning: (tsdoc-escape-right-brace) The "}" character should be escaped using a backslash to avoid confusion with a TSDoc inline tag + // Warning: (tsdoc-malformed-inline-tag) Expecting a TSDoc tag starting with "{@" + // Warning: (tsdoc-escape-right-brace) The "}" character should be escaped using a backslash to avoid confusion with a TSDoc inline tag + // Warning: (tsdoc-malformed-inline-tag) Expecting a TSDoc tag starting with "{@" + // Warning: (tsdoc-escape-right-brace) The "}" character should be escaped using a backslash to avoid confusion with a TSDoc inline tag where: (clause: WhereClause) => ObjectSet; } @@ -720,13 +744,17 @@ export interface TimeSeriesPoint { // @public (undocumented) export interface TimeSeriesProperty { - // (undocumented) + // Warning: (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen + // Warning: (tsdoc-malformed-inline-tag) Expecting a TSDoc tag starting with "{@" + // Warning: (tsdoc-escape-right-brace) The "}" character should be escaped using a backslash to avoid confusion with a TSDoc inline tag + // Warning: (tsdoc-malformed-inline-tag) Expecting a TSDoc tag starting with "{@" + // Warning: (tsdoc-escape-right-brace) The "}" character should be escaped using a backslash to avoid confusion with a TSDoc inline tag asyncIterPoints(query?: TimeSeriesQuery): AsyncGenerator>; - // (undocumented) + // Warning: (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen + // Warning: (tsdoc-malformed-inline-tag) Expecting a TSDoc tag starting with "{@" + // Warning: (tsdoc-escape-right-brace) The "}" character should be escaped using a backslash to avoid confusion with a TSDoc inline tag getAllPoints(query?: TimeSeriesQuery): Promise>>; - // (undocumented) getFirstPoint(): Promise>; - // (undocumented) getLastPoint(): Promise>; } diff --git a/packages/client.api/src/objectSet/ObjectSet.ts b/packages/client.api/src/objectSet/ObjectSet.ts index cd95ce2ba..b78e8c6e4 100644 --- a/packages/client.api/src/objectSet/ObjectSet.ts +++ b/packages/client.api/src/objectSet/ObjectSet.ts @@ -44,6 +44,18 @@ import type { BaseObjectSet } from "./BaseObjectSet.js"; export interface MinimalObjectSet extends BaseObjectSet { + /** + * Gets a page of objects of this type, with a result wrapper + * @param args Args to specify next page token and page size, if applicable + * @example + * const myObjs = await objectSet.fetchPage({ + $pageSize: 10, + $nextPageToken: "nextPage" + }); + const myObjsResult = myObjs.data; + + * @returns a page of objects + */ fetchPage: < L extends ObjectOrInterfacePropertyKeysFrom2, R extends boolean, @@ -53,6 +65,20 @@ export interface MinimalObjectSet args?: FetchPageArgs, ) => Promise>; + /** + * Gets a page of objects of this type, with a result wrapper + * @param args Args to specify next page token and page size, if applicable + * @example + * const myObjs = await objectSet.fetchPage({ + $pageSize: 10, + $nextPageToken: "nextPage" + }); + + if(isOk(myObjs)){ + const myObjsResult = myObjs.value.data; + } + * @returns a page of objects, wrapped in a result wrapper + */ fetchPageWithErrors: < L extends ObjectOrInterfacePropertyKeysFrom2, R extends boolean, @@ -62,10 +88,28 @@ export interface MinimalObjectSet args?: FetchPageArgs, ) => Promise>>; + /** + * Allows you to filter an object set with a given clause + * @param clause Takes a filter clause + * @example + * await client(Office).where({ + meetingRooms: { $contains: "Grand Central" }, + meetingRoomCapacities: { $contains: 30 }, + }); + * @returns an objectSet + */ where: ( clause: WhereClause, ) => MinimalObjectSet; + /** + * Returns an async iterator to load all objects of this type + * @example + * for await (const obj of myObjectSet.asyncIter()) + // Handle obj + } + * @returns an async iterator to load all objects + */ asyncIter: () => AsyncIterableIterator>; } @@ -77,28 +121,96 @@ export interface InterfaceObjectSet> export interface ObjectSet extends MinimalObjectSet { + /** + * Aggregate on a field in an object type + * @param req an aggregation request where you can select fields and choose how to aggregate, e.g., max, min, avg, and also choose + * whether or not you order your results. You can also specify a groupBy field to group your aggregations + * @example + * const testAggregateCountWithGroups = await client(BoundariesUsState) + .aggregate({ + $select: { + $count: "unordered", + "latitude:max": "unordered", + "latitude:min": "unordered", + "latitude:avg": "unordered", + }, + $groupBy: { + usState: "exact", + longitude: { + $fixedWidth: 10, + }, + }, + }); + + * @returns aggregation results, sorted in the groups based on the groupBy clause (if applicable) + */ aggregate: >( req: AggregateOptsThatErrorsAndDisallowsOrderingWithMultipleGroupBy, ) => Promise>; + /** + * Allows you to filter an object set with a given clause + * @param clause Takes a filter clause + * @example + * await client(Office).where({ + meetingRooms: { $contains: "Grand Central" }, + meetingRoomCapacities: { $contains: 30 }, + }); + * @returns an objectSet + */ where: ( clause: WhereClause, ) => ObjectSet; + /** + * Unions object sets together + * @param objectSets objectSets you want to union with + * @example + * const unionObjectSet = complexFilteredEmployeeObjectSet.union( + simpleFilteredEmployeeObjectSet, + ); + * @returns the unioned object set + */ union: ( ...objectSets: ReadonlyArray> ) => ObjectSet; + /** + * Computes the intersection of object sets + * @param objectSets objectSets you want to intersect with + * @example + * const intersectedObjectSet = complexFilteredEmployeeObjectSet.intersect( + simpleFilteredEmployeeObjectSet, + ); + * @returns the intersected object set + */ intersect: ( ...objectSets: ReadonlyArray> ) => ObjectSet; + /** + * Computes the subtraction of object sets + * @param objectSets objectSets you want to subtract from + * @example + * const subtractObjectSet = complexFilteredEmployeeObjectSet.subtract( + simpleFilteredEmployeeObjectSet, + ); + * @returns the subtract object set + */ subtract: ( ...objectSets: ReadonlyArray> ) => ObjectSet; + /** + * Pivots the object set over to all its linked objects of the specified type + * @param type The linked object type you want to pivot to + * @returns an object set of the specified linked type + */ pivotTo: >(type: L) => ObjectSet>; + /** + * Fetches one object with the specified primary key, without a result wrapper + */ fetchOne: Q extends ObjectTypeDefinition ? < L extends ObjectOrInterfacePropertyKeysFrom2, R extends boolean, @@ -109,6 +221,9 @@ export interface ObjectSet ) => Promise> : never; + /** + * Fetches one object with the specified primary key, with a result wrapper + */ fetchOneWithErrors: Q extends ObjectTypeDefinition ? < L extends ObjectOrInterfacePropertyKeysFrom2, R extends boolean, From 2c9a0e498a7e84162f9ec6f26eb1c3dc31bd7e6e Mon Sep 17 00:00:00 2001 From: Saurav Date: Thu, 1 Aug 2024 11:21:10 -0400 Subject: [PATCH 3/7] couple more docs --- etc/client.api.report.api.md | 5 ++--- etc/client.report.api.md | 5 ++++- packages/client.api/src/object/Attachment.ts | 6 ++++++ packages/client.api/src/object/Result.ts | 10 ++++++++++ packages/client/src/createAttachmentFromRid.ts | 6 ++++++ 5 files changed, 28 insertions(+), 4 deletions(-) diff --git a/etc/client.api.report.api.md b/etc/client.api.report.api.md index f9006dcd8..a4149f591 100644 --- a/etc/client.api.report.api.md +++ b/etc/client.api.report.api.md @@ -132,9 +132,7 @@ export type ApplyBatchActionOptions = { // @public (undocumented) export interface Attachment { - // (undocumented) fetchContents(): Promise; - // (undocumented) fetchMetadata(): Promise; // (undocumented) rid: string; @@ -400,9 +398,10 @@ export type GroupByRange = [T, T]; export interface InterfaceObjectSet> extends MinimalObjectSet { } +// Warning: (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen // Warning: (ae-forgotten-export) The symbol "OkResult" needs to be exported by the entry point index.d.ts // -// @public (undocumented) +// @public export function isOk(a: Result): a is OkResult; // @public (undocumented) diff --git a/etc/client.report.api.md b/etc/client.report.api.md index 1715044ae..31f9eeaae 100644 --- a/etc/client.report.api.md +++ b/etc/client.report.api.md @@ -69,7 +69,10 @@ export interface Client extends SharedClient { >(o: CheckVersionBound): QuerySignatureFromDef; } -// @public (undocumented) +// Warning: (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen +// Warning: (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen +// +// @public export function createAttachmentFromRid(client: MinimalClient, rid: string): Attachment; // @public (undocumented) diff --git a/packages/client.api/src/object/Attachment.ts b/packages/client.api/src/object/Attachment.ts index b65ea1f43..213230dff 100644 --- a/packages/client.api/src/object/Attachment.ts +++ b/packages/client.api/src/object/Attachment.ts @@ -16,7 +16,13 @@ export interface Attachment { rid: string; + /** + * Fetches metadata for an attachment + */ fetchMetadata(): Promise; + /** + * Fetches actual content of attachment in Blob form + */ fetchContents(): Promise; } /** diff --git a/packages/client.api/src/object/Result.ts b/packages/client.api/src/object/Result.ts index c24fc0d03..d31463f5a 100644 --- a/packages/client.api/src/object/Result.ts +++ b/packages/client.api/src/object/Result.ts @@ -18,10 +18,20 @@ export type ErrorResult = { error: Error; value?: never }; export type OkResult = { value: V; error?: never }; export type Result = OkResult | ErrorResult; +/** + * Check if a result was successfully received + * @param a Result wrapped value + * @returns whether a result has a value in it + */ export function isOk(a: Result): a is OkResult { return ("value" in a); } +/** + * Check if a result contains an error value + * @param a Result wrapped value + * @returns whether a result has an error in it + */ export function isError(a: Result): a is ErrorResult { return ("error" in a); } diff --git a/packages/client/src/createAttachmentFromRid.ts b/packages/client/src/createAttachmentFromRid.ts index 4da344e79..60848447b 100644 --- a/packages/client/src/createAttachmentFromRid.ts +++ b/packages/client/src/createAttachmentFromRid.ts @@ -18,6 +18,12 @@ import type { Attachment } from "@osdk/client.api"; import { Ontologies } from "@osdk/internal.foundry"; import type { MinimalClient } from "./MinimalClientContext.js"; +/** + * Helper function to create an attachment type from a rid + * @param client + * @param rid rid of attachment in Foundry + * @returns + */ export function createAttachmentFromRid( client: MinimalClient, rid: string, From 23b115e68d44b93bdcb82374185d2f9c5f4debf8 Mon Sep 17 00:00:00 2001 From: Saurav Date: Mon, 19 Aug 2024 14:38:59 -0400 Subject: [PATCH 4/7] fix issues --- etc/client.api.report.api.md | 6 +--- etc/client.report.api.md | 3 -- packages/client.api/src/object/Result.ts | 2 +- .../client.api/src/objectSet/ObjectSet.ts | 32 +++++++++---------- .../client.api/src/timeseries/timeseries.ts | 4 +-- .../client/src/createAttachmentFromRid.ts | 4 +-- 6 files changed, 22 insertions(+), 29 deletions(-) diff --git a/etc/client.api.report.api.md b/etc/client.api.report.api.md index 7a5e71487..724edc343 100644 --- a/etc/client.api.report.api.md +++ b/etc/client.api.report.api.md @@ -393,7 +393,6 @@ export type GroupByRange = [T, T]; export interface InterfaceObjectSet> extends MinimalObjectSet { } -// Warning: (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen // Warning: (ae-forgotten-export) The symbol "OkResult" needs to be exported by the entry point index.d.ts // // @public @@ -407,17 +406,14 @@ export type LinkNames = keyof Q["links"] // @public (undocumented) export interface MinimalObjectSet extends BaseObjectSet { + // Warning: (tsdoc-malformed-inline-tag) Expecting a TSDoc tag starting with "{@" // Warning: (tsdoc-escape-right-brace) The "}" character should be escaped using a backslash to avoid confusion with a TSDoc inline tag asyncIter: () => AsyncIterableIterator>; // Warning: (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen - // Warning: (tsdoc-malformed-inline-tag) Expecting a TSDoc tag starting with "{@" - // Warning: (tsdoc-escape-right-brace) The "}" character should be escaped using a backslash to avoid confusion with a TSDoc inline tag fetchPage: , R extends boolean, const A extends Augments, S extends NullabilityAdherence = NullabilityAdherenceDefault>(args?: FetchPageArgs) => Promise>; // Warning: (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen // Warning: (tsdoc-malformed-inline-tag) Expecting a TSDoc tag starting with "{@" // Warning: (tsdoc-escape-right-brace) The "}" character should be escaped using a backslash to avoid confusion with a TSDoc inline tag - // Warning: (tsdoc-malformed-inline-tag) Expecting a TSDoc tag starting with "{@" - // Warning: (tsdoc-escape-right-brace) The "}" character should be escaped using a backslash to avoid confusion with a TSDoc inline tag fetchPageWithErrors: , R extends boolean, const A extends Augments, S extends NullabilityAdherence = NullabilityAdherenceDefault>(args?: FetchPageArgs) => Promise>>; // Warning: (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen // Warning: (tsdoc-malformed-inline-tag) Expecting a TSDoc tag starting with "{@" diff --git a/etc/client.report.api.md b/etc/client.report.api.md index 5a3f42c3c..abf86a5cf 100644 --- a/etc/client.report.api.md +++ b/etc/client.report.api.md @@ -75,9 +75,6 @@ export interface Client extends SharedClient { >(o: CheckVersionBound): QuerySignatureFromDef; } -// Warning: (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen -// Warning: (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen -// // @public export function createAttachmentFromRid(client: MinimalClient, rid: string): Attachment; diff --git a/packages/client.api/src/object/Result.ts b/packages/client.api/src/object/Result.ts index d31463f5a..fae3c1c51 100644 --- a/packages/client.api/src/object/Result.ts +++ b/packages/client.api/src/object/Result.ts @@ -20,7 +20,7 @@ export type Result = OkResult | ErrorResult; /** * Check if a result was successfully received - * @param a Result wrapped value + * @param a - result wrapped value * @returns whether a result has a value in it */ export function isOk(a: Result): a is OkResult { diff --git a/packages/client.api/src/objectSet/ObjectSet.ts b/packages/client.api/src/objectSet/ObjectSet.ts index b78e8c6e4..b22cca300 100644 --- a/packages/client.api/src/objectSet/ObjectSet.ts +++ b/packages/client.api/src/objectSet/ObjectSet.ts @@ -46,12 +46,12 @@ export interface MinimalObjectSet { /** * Gets a page of objects of this type, with a result wrapper - * @param args Args to specify next page token and page size, if applicable + * @param args - Args to specify next page token and page size, if applicable * @example - * const myObjs = await objectSet.fetchPage({ + * const myObjs = await objectSet.fetchPage(\{ $pageSize: 10, $nextPageToken: "nextPage" - }); + \}); const myObjsResult = myObjs.data; * @returns a page of objects @@ -67,12 +67,12 @@ export interface MinimalObjectSet /** * Gets a page of objects of this type, with a result wrapper - * @param args Args to specify next page token and page size, if applicable + * @param args - Args to specify next page token and page size, if applicable * @example - * const myObjs = await objectSet.fetchPage({ + * const myObjs = await objectSet.fetchPage(\{ $pageSize: 10, $nextPageToken: "nextPage" - }); + \}); if(isOk(myObjs)){ const myObjsResult = myObjs.value.data; @@ -90,7 +90,7 @@ export interface MinimalObjectSet /** * Allows you to filter an object set with a given clause - * @param clause Takes a filter clause + * @param clause - Takes a filter clause * @example * await client(Office).where({ meetingRooms: { $contains: "Grand Central" }, @@ -105,9 +105,9 @@ export interface MinimalObjectSet /** * Returns an async iterator to load all objects of this type * @example - * for await (const obj of myObjectSet.asyncIter()) - // Handle obj - } + * for await (const obj of myObjectSet.asyncIter()){ + * // Handle obj + * } * @returns an async iterator to load all objects */ asyncIter: () => AsyncIterableIterator>; @@ -123,7 +123,7 @@ export interface ObjectSet { /** * Aggregate on a field in an object type - * @param req an aggregation request where you can select fields and choose how to aggregate, e.g., max, min, avg, and also choose + * @param req - an aggregation request where you can select fields and choose how to aggregate, e.g., max, min, avg, and also choose * whether or not you order your results. You can also specify a groupBy field to group your aggregations * @example * const testAggregateCountWithGroups = await client(BoundariesUsState) @@ -150,7 +150,7 @@ export interface ObjectSet /** * Allows you to filter an object set with a given clause - * @param clause Takes a filter clause + * @param clause - Takes a filter clause * @example * await client(Office).where({ meetingRooms: { $contains: "Grand Central" }, @@ -164,7 +164,7 @@ export interface ObjectSet /** * Unions object sets together - * @param objectSets objectSets you want to union with + * @param objectSets - objectSets you want to union with * @example * const unionObjectSet = complexFilteredEmployeeObjectSet.union( simpleFilteredEmployeeObjectSet, @@ -177,7 +177,7 @@ export interface ObjectSet /** * Computes the intersection of object sets - * @param objectSets objectSets you want to intersect with + * @param objectSets - objectSets you want to intersect with * @example * const intersectedObjectSet = complexFilteredEmployeeObjectSet.intersect( simpleFilteredEmployeeObjectSet, @@ -190,7 +190,7 @@ export interface ObjectSet /** * Computes the subtraction of object sets - * @param objectSets objectSets you want to subtract from + * @param objectSets - objectSets you want to subtract from * @example * const subtractObjectSet = complexFilteredEmployeeObjectSet.subtract( simpleFilteredEmployeeObjectSet, @@ -203,7 +203,7 @@ export interface ObjectSet /** * Pivots the object set over to all its linked objects of the specified type - * @param type The linked object type you want to pivot to + * @param type - The linked object type you want to pivot to * @returns an object set of the specified linked type */ pivotTo: >(type: L) => ObjectSet>; diff --git a/packages/client.api/src/timeseries/timeseries.ts b/packages/client.api/src/timeseries/timeseries.ts index 9add51d87..e86a9e438 100644 --- a/packages/client.api/src/timeseries/timeseries.ts +++ b/packages/client.api/src/timeseries/timeseries.ts @@ -78,7 +78,7 @@ export interface TimeSeriesProperty { getLastPoint(): Promise>; /** * Loads all points, within the given time range if that's provided - * @param query a query representing either an absolute or relative range of time + * @param query - a query representing either an absolute or relative range of time * @example * const points = await employee.employeeStatus?.getAllPoints({ $after: 1, @@ -89,7 +89,7 @@ export interface TimeSeriesProperty { /** * Returns an async iterator to load all points * within the given time range if that's provided - * @param query a query representing either an absolute or relative range of time + * @param query - a query representing either an absolute or relative range of time * @example * const iterator = employee.employeeStatus?.asyncIter({ $after: 1, diff --git a/packages/client/src/createAttachmentFromRid.ts b/packages/client/src/createAttachmentFromRid.ts index 60848447b..2932354cd 100644 --- a/packages/client/src/createAttachmentFromRid.ts +++ b/packages/client/src/createAttachmentFromRid.ts @@ -20,8 +20,8 @@ import type { MinimalClient } from "./MinimalClientContext.js"; /** * Helper function to create an attachment type from a rid - * @param client - * @param rid rid of attachment in Foundry + * @param client - minimal client + * @param rid - rid of attachment in Foundry * @returns */ export function createAttachmentFromRid( From 77941ee0145bd45a20a853e1b6fbf20abcf78e37 Mon Sep 17 00:00:00 2001 From: Saurav Date: Mon, 19 Aug 2024 16:47:17 -0400 Subject: [PATCH 5/7] update report --- etc/client.api.report.api.md | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/etc/client.api.report.api.md b/etc/client.api.report.api.md index 724edc343..2deb631c9 100644 --- a/etc/client.api.report.api.md +++ b/etc/client.api.report.api.md @@ -409,13 +409,10 @@ export interface MinimalObjectSet extends // Warning: (tsdoc-malformed-inline-tag) Expecting a TSDoc tag starting with "{@" // Warning: (tsdoc-escape-right-brace) The "}" character should be escaped using a backslash to avoid confusion with a TSDoc inline tag asyncIter: () => AsyncIterableIterator>; - // Warning: (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen fetchPage: , R extends boolean, const A extends Augments, S extends NullabilityAdherence = NullabilityAdherenceDefault>(args?: FetchPageArgs) => Promise>; - // Warning: (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen // Warning: (tsdoc-malformed-inline-tag) Expecting a TSDoc tag starting with "{@" // Warning: (tsdoc-escape-right-brace) The "}" character should be escaped using a backslash to avoid confusion with a TSDoc inline tag fetchPageWithErrors: , R extends boolean, const A extends Augments, S extends NullabilityAdherence = NullabilityAdherenceDefault>(args?: FetchPageArgs) => Promise>>; - // Warning: (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen // Warning: (tsdoc-malformed-inline-tag) Expecting a TSDoc tag starting with "{@" // Warning: (tsdoc-escape-right-brace) The "}" character should be escaped using a backslash to avoid confusion with a TSDoc inline tag // Warning: (tsdoc-malformed-inline-tag) Expecting a TSDoc tag starting with "{@" @@ -447,7 +444,6 @@ export type NumericAggregateOption = "min" | "max" | "sum" | "avg" | "approximat // @public (undocumented) export interface ObjectSet extends MinimalObjectSet { - // Warning: (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen // Warning: (tsdoc-malformed-inline-tag) Expecting a TSDoc tag starting with "{@" // Warning: (tsdoc-malformed-inline-tag) Expecting a TSDoc tag starting with "{@" // Warning: (tsdoc-escape-right-brace) The "}" character should be escaped using a backslash to avoid confusion with a TSDoc inline tag @@ -459,15 +455,10 @@ export interface ObjectSet extends Minima aggregate: >(req: AggregateOptsThatErrorsAndDisallowsOrderingWithMultipleGroupBy) => Promise>; fetchOne: Q extends ObjectTypeDefinition ? , R extends boolean, S extends false | "throw" = NullabilityAdherenceDefault>(primaryKey: PropertyValueClientToWire[Q["primaryKeyType"]], options?: SelectArg) => Promise> : never; fetchOneWithErrors: Q extends ObjectTypeDefinition ? , R extends boolean, S extends false | "throw" = NullabilityAdherenceDefault>(primaryKey: PropertyValueClientToWire[Q["primaryKeyType"]], options?: SelectArg) => Promise>> : never; - // Warning: (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen intersect: (...objectSets: ReadonlyArray>) => ObjectSet; - // Warning: (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen pivotTo: >(type: L) => ObjectSet>; - // Warning: (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen subtract: (...objectSets: ReadonlyArray>) => ObjectSet; - // Warning: (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen union: (...objectSets: ReadonlyArray>) => ObjectSet; - // Warning: (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen // Warning: (tsdoc-malformed-inline-tag) Expecting a TSDoc tag starting with "{@" // Warning: (tsdoc-escape-right-brace) The "}" character should be escaped using a backslash to avoid confusion with a TSDoc inline tag // Warning: (tsdoc-malformed-inline-tag) Expecting a TSDoc tag starting with "{@" @@ -731,13 +722,11 @@ export interface TimeSeriesPoint { // @public (undocumented) export interface TimeSeriesProperty { - // Warning: (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen // Warning: (tsdoc-malformed-inline-tag) Expecting a TSDoc tag starting with "{@" // Warning: (tsdoc-escape-right-brace) The "}" character should be escaped using a backslash to avoid confusion with a TSDoc inline tag // Warning: (tsdoc-malformed-inline-tag) Expecting a TSDoc tag starting with "{@" // Warning: (tsdoc-escape-right-brace) The "}" character should be escaped using a backslash to avoid confusion with a TSDoc inline tag asyncIterPoints(query?: TimeSeriesQuery): AsyncGenerator>; - // Warning: (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen // Warning: (tsdoc-malformed-inline-tag) Expecting a TSDoc tag starting with "{@" // Warning: (tsdoc-escape-right-brace) The "}" character should be escaped using a backslash to avoid confusion with a TSDoc inline tag getAllPoints(query?: TimeSeriesQuery): Promise>>; From a762d767209dbce2a4399ec9575878ac7051007f Mon Sep 17 00:00:00 2001 From: Saurav Date: Mon, 19 Aug 2024 16:52:46 -0400 Subject: [PATCH 6/7] js docs fix --- etc/client.api.report.api.md | 4 ++++ packages/client.api/src/objectSet/ObjectSet.ts | 8 ++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/etc/client.api.report.api.md b/etc/client.api.report.api.md index 2deb631c9..9e6cf3b4b 100644 --- a/etc/client.api.report.api.md +++ b/etc/client.api.report.api.md @@ -409,9 +409,13 @@ export interface MinimalObjectSet extends // Warning: (tsdoc-malformed-inline-tag) Expecting a TSDoc tag starting with "{@" // Warning: (tsdoc-escape-right-brace) The "}" character should be escaped using a backslash to avoid confusion with a TSDoc inline tag asyncIter: () => AsyncIterableIterator>; + // Warning: (tsdoc-malformed-inline-tag) Expecting a TSDoc tag starting with "{@" + // Warning: (tsdoc-escape-right-brace) The "}" character should be escaped using a backslash to avoid confusion with a TSDoc inline tag fetchPage: , R extends boolean, const A extends Augments, S extends NullabilityAdherence = NullabilityAdherenceDefault>(args?: FetchPageArgs) => Promise>; // Warning: (tsdoc-malformed-inline-tag) Expecting a TSDoc tag starting with "{@" // Warning: (tsdoc-escape-right-brace) The "}" character should be escaped using a backslash to avoid confusion with a TSDoc inline tag + // Warning: (tsdoc-malformed-inline-tag) Expecting a TSDoc tag starting with "{@" + // Warning: (tsdoc-escape-right-brace) The "}" character should be escaped using a backslash to avoid confusion with a TSDoc inline tag fetchPageWithErrors: , R extends boolean, const A extends Augments, S extends NullabilityAdherence = NullabilityAdherenceDefault>(args?: FetchPageArgs) => Promise>>; // Warning: (tsdoc-malformed-inline-tag) Expecting a TSDoc tag starting with "{@" // Warning: (tsdoc-escape-right-brace) The "}" character should be escaped using a backslash to avoid confusion with a TSDoc inline tag diff --git a/packages/client.api/src/objectSet/ObjectSet.ts b/packages/client.api/src/objectSet/ObjectSet.ts index b22cca300..ca15c639e 100644 --- a/packages/client.api/src/objectSet/ObjectSet.ts +++ b/packages/client.api/src/objectSet/ObjectSet.ts @@ -48,10 +48,10 @@ export interface MinimalObjectSet * Gets a page of objects of this type, with a result wrapper * @param args - Args to specify next page token and page size, if applicable * @example - * const myObjs = await objectSet.fetchPage(\{ + * const myObjs = await objectSet.fetchPage({ $pageSize: 10, $nextPageToken: "nextPage" - \}); + }); const myObjsResult = myObjs.data; * @returns a page of objects @@ -69,10 +69,10 @@ export interface MinimalObjectSet * Gets a page of objects of this type, with a result wrapper * @param args - Args to specify next page token and page size, if applicable * @example - * const myObjs = await objectSet.fetchPage(\{ + * const myObjs = await objectSet.fetchPage({ $pageSize: 10, $nextPageToken: "nextPage" - \}); + }); if(isOk(myObjs)){ const myObjsResult = myObjs.value.data; From 1dcf5fe21f0a57bcc0e84facf0a0ced21e2f3536 Mon Sep 17 00:00:00 2001 From: Saurav Date: Tue, 20 Aug 2024 09:26:35 -0400 Subject: [PATCH 7/7] add js docs for object sets and changesets --- .changeset/clever-rings-yawn.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .changeset/clever-rings-yawn.md diff --git a/.changeset/clever-rings-yawn.md b/.changeset/clever-rings-yawn.md new file mode 100644 index 000000000..906171516 --- /dev/null +++ b/.changeset/clever-rings-yawn.md @@ -0,0 +1,6 @@ +--- +"@osdk/client.api": patch +"@osdk/client": patch +--- + +Add docs for object sets and attachments.