@microsoft/rayfin-data 1.31.0 → 1.33.0-beta.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,6 +1,6 @@
1
1
  import type { ApiClient as ApiClientType } from '@microsoft/rayfin-lib';
2
- import { GraphQLEntityClient } from '../graphql/GraphQLEntityClient';
3
- import type { EntitySchema } from '../graphql/types';
2
+ import { GraphQLEntityClient } from '../graphql/GraphQLEntityClient.js';
3
+ import type { EntitySchema } from '../graphql/types.js';
4
4
  /**
5
5
  * Type-safe data clients based on entity schema.
6
6
  */
@@ -12,7 +12,7 @@ export type TypedDataClients<TSchema extends EntitySchema> = {
12
12
  *
13
13
  * Use the `createDataApi` factory function to create instances instead of instantiating directly.
14
14
  *
15
- * @template TSchema - Object type mapping entity names to their types
15
+ * @typeParam TSchema - Object type mapping entity names to their types
16
16
  */
17
17
  export declare class DataApi<TSchema extends EntitySchema = Record<string, any>> {
18
18
  private apiClient;
@@ -35,7 +35,7 @@ export declare class DataApi<TSchema extends EntitySchema = Record<string, any>>
35
35
  /**
36
36
  * Create a type-safe DataApi instance for interacting with Data API Builder GraphQL endpoints.
37
37
  *
38
- * @template TSchema - Object type mapping entity names to their types
38
+ * @typeParam TSchema - Object type mapping entity names to their types
39
39
  * @param apiClient - The ApiClient instance for making HTTP requests
40
40
  * @returns A fully typed DataApi instance with direct entity access
41
41
  *
@@ -1,11 +1,11 @@
1
- import { GraphQLClient } from '../graphql/GraphQLClient';
2
- import { GraphQLEntityClient } from '../graphql/GraphQLEntityClient';
1
+ import { GraphQLClient } from '../graphql/GraphQLClient.js';
2
+ import { GraphQLEntityClient } from '../graphql/GraphQLEntityClient.js';
3
3
  /**
4
4
  * Data-specific operations client for interacting with Data API Builder GraphQL endpoints.
5
5
  *
6
6
  * Use the `createDataApi` factory function to create instances instead of instantiating directly.
7
7
  *
8
- * @template TSchema - Object type mapping entity names to their types
8
+ * @typeParam TSchema - Object type mapping entity names to their types
9
9
  */
10
10
  export class DataApi {
11
11
  apiClient;
@@ -78,7 +78,7 @@ export class DataApi {
78
78
  /**
79
79
  * Create a type-safe DataApi instance for interacting with Data API Builder GraphQL endpoints.
80
80
  *
81
- * @template TSchema - Object type mapping entity names to their types
81
+ * @typeParam TSchema - Object type mapping entity names to their types
82
82
  * @param apiClient - The ApiClient instance for making HTTP requests
83
83
  * @returns A fully typed DataApi instance with direct entity access
84
84
  *
@@ -1,6 +1,6 @@
1
- import type { GraphQLClient } from './GraphQLClient';
2
- import { GraphQLQueryBuilder } from './GraphQLQueryBuilder';
3
- import type { EntitySchema, CreateInput, UpdateInput, WhereUniqueInput, FilterInput, OrderByInput, FieldSelection } from './types';
1
+ import type { GraphQLClient } from './GraphQLClient.js';
2
+ import { GraphQLQueryBuilder } from './GraphQLQueryBuilder.js';
3
+ import type { EntitySchema, CreateInput, UpdateInput, WhereUniqueInput, FilterInput, OrderByInput, FieldSelection } from './types.js';
4
4
  export declare class GraphQLEntityClient<TSchema extends EntitySchema, TEntity extends keyof TSchema> {
5
5
  private graphqlClient;
6
6
  private entityNameString;
@@ -39,7 +39,7 @@ export declare class GraphQLEntityClient<TSchema extends EntitySchema, TEntity e
39
39
  private extractMutationResult;
40
40
  /**
41
41
  * Transforms flat FK fields (e.g. category_id) in mutation responses back into
42
- * nested relationship objects (e.g. category: { id: "..." }) based on the
42
+ * nested relationship objects (e.g. `category: { id: "..." }`) based on the
43
43
  * relationship keys present in the original input.
44
44
  */
45
45
  private nestRelationshipFields;
@@ -1,7 +1,7 @@
1
1
  import { getPrimaryKeyField } from '@microsoft/rayfin-core';
2
- import { deserializeDabResponse } from '../utils/serialization';
3
- import { GraphQLQueryBuilder } from './GraphQLQueryBuilder';
4
- import { formatGraphQLValue } from './formatValue';
2
+ import { deserializeDabResponse } from '../utils/serialization.js';
3
+ import { GraphQLQueryBuilder } from './GraphQLQueryBuilder.js';
4
+ import { formatGraphQLValue } from './formatValue.js';
5
5
  export class GraphQLEntityClient {
6
6
  graphqlClient;
7
7
  entityNameString;
@@ -237,7 +237,7 @@ export class GraphQLEntityClient {
237
237
  }
238
238
  /**
239
239
  * Transforms flat FK fields (e.g. category_id) in mutation responses back into
240
- * nested relationship objects (e.g. category: { id: "..." }) based on the
240
+ * nested relationship objects (e.g. `category: { id: "..." }`) based on the
241
241
  * relationship keys present in the original input.
242
242
  */
243
243
  nestRelationshipFields(responseData, inputData) {
@@ -1,10 +1,10 @@
1
- import type { GraphQLClient } from './GraphQLClient';
2
- import type { EntitySchema, FilterInput, OrderByInput, PagedResult, FieldSelection } from './types';
1
+ import type { GraphQLClient } from './GraphQLClient.js';
2
+ import type { EntitySchema, FilterInput, OrderByInput, PagedResult, FieldSelection } from './types.js';
3
3
  /**
4
4
  * Fluent GraphQL query builder for constructing and executing complex queries.
5
5
  *
6
- * @template TSchema The entity schema type
7
- * @template TEntity The specific entity name
6
+ * @typeParam TSchema - The entity schema type
7
+ * @typeParam TEntity - The specific entity name
8
8
  */
9
9
  export declare class GraphQLQueryBuilder<TSchema extends EntitySchema, TEntity extends keyof TSchema> {
10
10
  private graphqlClient;
@@ -1,12 +1,12 @@
1
1
  import { getPrimaryKeyField } from '@microsoft/rayfin-core';
2
2
  import { EntityNameResolver } from '@microsoft/rayfin-lib';
3
- import { ResponseHandler } from './ResponseHandler';
4
- import { formatGraphQLValue } from './formatValue';
3
+ import { ResponseHandler } from './ResponseHandler.js';
4
+ import { formatGraphQLValue } from './formatValue.js';
5
5
  /**
6
6
  * Fluent GraphQL query builder for constructing and executing complex queries.
7
7
  *
8
- * @template TSchema The entity schema type
9
- * @template TEntity The specific entity name
8
+ * @typeParam TSchema - The entity schema type
9
+ * @typeParam TEntity - The specific entity name
10
10
  */
11
11
  export class GraphQLQueryBuilder {
12
12
  graphqlClient;
@@ -1,4 +1,4 @@
1
- import type { PagedResult } from './types';
1
+ import type { PagedResult } from './types.js';
2
2
  export declare class ResponseError extends Error {
3
3
  readonly context: {
4
4
  response?: any;
@@ -1,4 +1,4 @@
1
- import { deserializeDabResponse } from '../utils/serialization';
1
+ import { deserializeDabResponse } from '../utils/serialization.js';
2
2
  export class ResponseError extends Error {
3
3
  context;
4
4
  constructor(message, context = {}) {
@@ -120,7 +120,7 @@ export type OrderByInput<T> = {
120
120
  [K in keyof T]?: 'asc' | 'desc';
121
121
  };
122
122
  /**
123
- * Extracts the primary key field from an entity using the centralized {@link PrimaryKeyField} type.
123
+ * Extracts the primary key field from an entity using the centralized `PrimaryKeyField` type.
124
124
  *
125
125
  * @see {@link RelationshipInput} for usage in mutation input types
126
126
  */
@@ -157,7 +157,7 @@ export type RelationshipInput<T> = T | PrimaryKeyOnly<T>;
157
157
  * Detects if a type is a relationship (object with a primary key that's not a primitive wrapper).
158
158
  *
159
159
  * @remarks
160
- * A relationship is detected as an object type that has a {@link PrimaryKeyField} property,
160
+ * A relationship is detected as an object type that has a `PrimaryKeyField` property,
161
161
  * but is not a Date or Array (which are object types but not relationships).
162
162
  */
163
163
  export type IsRelationship<T> = PrimaryKeyField extends keyof T ? T extends Date | Array<any> ? false : true : false;
package/dist/index.d.ts CHANGED
@@ -1,9 +1,9 @@
1
- export { createDataApi, DataApi } from './client/DataApi';
2
- export type { TypedDataClients } from './client/DataApi';
3
- export { GraphQLClient } from './graphql/GraphQLClient';
4
- export { GraphQLEntityClient } from './graphql/GraphQLEntityClient';
5
- export { GraphQLQueryBuilder } from './graphql/GraphQLQueryBuilder';
6
- export { ResponseHandler } from './graphql/ResponseHandler';
7
- export type { GraphQLRequest, GraphQLResponse } from './graphql/GraphQLClient';
8
- export type { EntitySchema, CleanEntityKeys, NestedFieldPath, IsRelationship, RelationshipInput, PrimaryKeyOnly, MutationInput, CreateInput, UpdateInput, WhereUniqueInput, FilterInput, FilterValue, RelationshipIsNullFilter, FieldFilterInput, FieldSelection, OrderByInput, PaginationConfig, PagedResult, StringFilterInput, NumberFilterInput, BooleanFilterInput, DateFilterInput, GenericFilterInput, } from './graphql/types';
1
+ export { createDataApi, DataApi } from './client/DataApi.js';
2
+ export type { TypedDataClients } from './client/DataApi.js';
3
+ export { GraphQLClient } from './graphql/GraphQLClient.js';
4
+ export { GraphQLEntityClient } from './graphql/GraphQLEntityClient.js';
5
+ export { GraphQLQueryBuilder } from './graphql/GraphQLQueryBuilder.js';
6
+ export { ResponseHandler } from './graphql/ResponseHandler.js';
7
+ export type { GraphQLRequest, GraphQLResponse } from './graphql/GraphQLClient.js';
8
+ export type { EntitySchema, CleanEntityKeys, NestedFieldPath, IsRelationship, RelationshipInput, PrimaryKeyOnly, MutationInput, CreateInput, UpdateInput, WhereUniqueInput, FilterInput, FilterValue, RelationshipIsNullFilter, FieldFilterInput, FieldSelection, OrderByInput, PaginationConfig, PagedResult, StringFilterInput, NumberFilterInput, BooleanFilterInput, DateFilterInput, GenericFilterInput, } from './graphql/types.js';
9
9
  //# sourceMappingURL=index.d.ts.map
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  // Main exports
2
- export { createDataApi, DataApi } from './client/DataApi';
3
- export { GraphQLClient } from './graphql/GraphQLClient';
4
- export { GraphQLEntityClient } from './graphql/GraphQLEntityClient';
5
- export { GraphQLQueryBuilder } from './graphql/GraphQLQueryBuilder';
2
+ export { createDataApi, DataApi } from './client/DataApi.js';
3
+ export { GraphQLClient } from './graphql/GraphQLClient.js';
4
+ export { GraphQLEntityClient } from './graphql/GraphQLEntityClient.js';
5
+ export { GraphQLQueryBuilder } from './graphql/GraphQLQueryBuilder.js';
6
6
  // DAB utilities
7
- export { ResponseHandler } from './graphql/ResponseHandler';
7
+ export { ResponseHandler } from './graphql/ResponseHandler.js';
8
8
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@microsoft/rayfin-data",
3
- "version": "1.31.0",
3
+ "version": "1.33.0-beta.0",
4
4
  "description": "Type-safe client library for Data API Builder endpoints",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -13,8 +13,8 @@
13
13
  "assets/docs"
14
14
  ],
15
15
  "dependencies": {
16
- "@microsoft/rayfin-lib": "1.31.0",
17
- "@microsoft/rayfin-core": "1.31.0"
16
+ "@microsoft/rayfin-core": "1.33.0-beta.0",
17
+ "@microsoft/rayfin-lib": "1.33.0-beta.0"
18
18
  },
19
19
  "devDependencies": {
20
20
  "@types/node": "^20.0.0",
@@ -51,7 +51,7 @@
51
51
  "kind": "api-reference"
52
52
  },
53
53
  "scripts": {
54
- "build": "tsc",
54
+ "build": "tsc && node ../scripts/fix-esm-extensions.mjs ./dist",
55
55
  "build:watch": "tsc --watch",
56
56
  "clean": "rimraf dist && rimraf .tsbuildinfo",
57
57
  "test": "vitest run",