@codecks/fetch 2.0.0 → 2.0.1
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.
- package/README.md +2 -1
- package/dist/_exploration/api-requester.d.ts +3 -3
- package/dist/_exploration/api-requester.js +1 -1
- package/dist/_exploration/create-hooks.d.ts +5 -5
- package/dist/_exploration/loader.d.ts +2 -2
- package/dist/_exploration/store.d.ts +5 -5
- package/dist/{collection-utils-Ia_ahcpI.js → collection-utils-y85xawyq.js} +2 -1
- package/dist/{index-g5c30upI.d.ts → index-iEtXFnkY.d.ts} +2 -2
- package/dist/index.d.ts +3 -3
- package/dist/index.js +1 -1
- package/dist/{loader-types-D2Pf8qzH.d.ts → loader-types-CIO8hJAv.d.ts} +1 -1
- package/dist/{loader-utils-BZWanWDZ.d.ts → loader-utils-DdrmVo0F.d.ts} +1 -1
- package/dist/{query-type-DPNcQFpZ.d.ts → query-type-CwrwqxUP.d.ts} +3 -2
- package/dist/{store-ztk8y6Pm.d.ts → store-Dpx1yvWU.d.ts} +3 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -340,7 +340,8 @@ await dispatch("cards/update", {id, status: "done", assigneeId: null});
|
|
|
340
340
|
the listed values. Enums the API answers stay open, see [Field types](#field-types).
|
|
341
341
|
- **Response**: an action without one resolves to `undefined`.
|
|
342
342
|
- **Errors**: a refused action throws a `CodecksApiError` with the reason as its message, e.g.
|
|
343
|
-
`[403] requires card:write` for a read-only token.
|
|
343
|
+
`[403] requires card:write` for a read-only token. A missing scope has the `code`
|
|
344
|
+
`missing_scope` and the scope in `body.requiredScope`.
|
|
344
345
|
|
|
345
346
|
Each action's JSDoc holds its description and the token scopes it needs. `ActionMap`,
|
|
346
347
|
`ActionName`, `ActionParams<N>` and `ActionResponse<N>` are exported for wrapping `dispatch`.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import "../query-type-
|
|
2
|
-
import { FetchOptions } from "../loader-utils-
|
|
3
|
-
import { BaseRequester, MissingDataRequest } from "../loader-types-
|
|
1
|
+
import "../query-type-CwrwqxUP.js";
|
|
2
|
+
import { FetchOptions } from "../loader-utils-DdrmVo0F.js";
|
|
3
|
+
import { BaseRequester, MissingDataRequest } from "../loader-types-CIO8hJAv.js";
|
|
4
4
|
|
|
5
5
|
//#region src/_exploration/api-requester.d.ts
|
|
6
6
|
declare class ApiRequester implements BaseRequester {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { bearerTransport, configuredFetch, ensureMapValue } from "../collection-utils-
|
|
1
|
+
import { bearerTransport, configuredFetch, ensureMapValue } from "../collection-utils-y85xawyq.js";
|
|
2
2
|
import { serializeModel } from "../query-helpers-DndWBcMF.js";
|
|
3
3
|
|
|
4
4
|
//#region src/_exploration/utils/concurrency-limiter.ts
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { InferModelQuery, InferRelQuery, ModelDesc, ModelQuery, RelQuery, RelationEntry, TypedField } from "../query-type-
|
|
2
|
-
import { AccountId, AttachmentId, CardId, CardVisibility, Checkbox, CheckboxStats, DeckId, DefaultCard, DerivedStatus, FileId, MilestoneColor, MilestoneId, Priority, ProjectId, ProjectTagId, QueueEntryId, ReleaseId, ResolvableEntryId, ResolvableEntryReactionId, ResolvableId, SprintConfigId, SprintId, StartWeekday, TimeTrackingMode, TimelineScaleType, UserId, Workdays, WorkflowItemId, WorkflowMode } from "../loader-utils-
|
|
3
|
-
import "../loader-types-
|
|
4
|
-
import { _rootDesc } from "../index-
|
|
5
|
-
import { Store } from "../store-
|
|
1
|
+
import { InferModelQuery, InferRelQuery, ModelDesc, ModelQuery, RelQuery, RelationEntry, TypedField } from "../query-type-CwrwqxUP.js";
|
|
2
|
+
import { AccountId, AttachmentId, CardId, CardVisibility, Checkbox, CheckboxStats, DeckId, DefaultCard, DerivedStatus, FileId, MilestoneColor, MilestoneId, Priority, ProjectId, ProjectTagId, QueueEntryId, ReleaseId, ResolvableEntryId, ResolvableEntryReactionId, ResolvableId, SprintConfigId, SprintId, StartWeekday, TimeTrackingMode, TimelineScaleType, UserId, Workdays, WorkflowItemId, WorkflowMode } from "../loader-utils-DdrmVo0F.js";
|
|
3
|
+
import "../loader-types-CIO8hJAv.js";
|
|
4
|
+
import { _rootDesc } from "../index-iEtXFnkY.js";
|
|
5
|
+
import { Store } from "../store-Dpx1yvWU.js";
|
|
6
6
|
|
|
7
7
|
//#region src/_exploration/create-hooks.d.ts
|
|
8
8
|
declare const createHooks: (store: Store) => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "../query-type-
|
|
2
|
-
import { BaseLoader, BaseRequester, MissingDataRequest, OnLoadedFn } from "../loader-types-
|
|
1
|
+
import "../query-type-CwrwqxUP.js";
|
|
2
|
+
import { BaseLoader, BaseRequester, MissingDataRequest, OnLoadedFn } from "../loader-types-CIO8hJAv.js";
|
|
3
3
|
|
|
4
4
|
//#region src/_exploration/loader.d.ts
|
|
5
5
|
type DataRequestWithKey = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import "../query-type-
|
|
2
|
-
import "../loader-utils-
|
|
3
|
-
import "../loader-types-
|
|
4
|
-
import "../index-
|
|
5
|
-
import { Store } from "../store-
|
|
1
|
+
import "../query-type-CwrwqxUP.js";
|
|
2
|
+
import "../loader-utils-DdrmVo0F.js";
|
|
3
|
+
import "../loader-types-CIO8hJAv.js";
|
|
4
|
+
import "../index-iEtXFnkY.js";
|
|
5
|
+
import { Store } from "../store-Dpx1yvWU.js";
|
|
6
6
|
export { Store };
|
|
@@ -55,7 +55,8 @@ const configuredFetch = async (opts, url, init = {}) => {
|
|
|
55
55
|
const headers = new Headers(init.headers);
|
|
56
56
|
for (const [key, value] of Object.entries(opts.authHeaders)) headers.set(key, value);
|
|
57
57
|
if (opts.headers) for (const [key, value] of Object.entries(opts.headers)) headers.set(key, value);
|
|
58
|
-
const
|
|
58
|
+
const base = opts.baseUrl?.replace(/\/?$/, "/");
|
|
59
|
+
const fullUrl = base ? `${base}${url}` : url;
|
|
59
60
|
const signal = opts.timeout ? AbortSignal.timeout(opts.timeout) : init.signal;
|
|
60
61
|
const r = await fetchImpl(fullUrl, {
|
|
61
62
|
...init,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { InferModelQuery, InferRelQuery, Instance, ModelDesc, ModelQuery, RelQuery, RelationEntry } from "./query-type-
|
|
2
|
-
import { ActionName, ActionParams, ActionResponse, DataLoader, FetchOptions, LegacyFetchOptions, modelMap$1 as modelMap } from "./loader-utils-
|
|
1
|
+
import { InferModelQuery, InferRelQuery, Instance, ModelDesc, ModelQuery, RelQuery, RelationEntry } from "./query-type-CwrwqxUP.js";
|
|
2
|
+
import { ActionName, ActionParams, ActionResponse, DataLoader, FetchOptions, LegacyFetchOptions, modelMap$1 as modelMap } from "./loader-utils-DdrmVo0F.js";
|
|
3
3
|
|
|
4
4
|
//#region src/models/_root.d.ts
|
|
5
5
|
/** The starting point of every query. */
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "./query-type-
|
|
2
|
-
import { AccountId, ActionMap, ActionName, ActionParams, ActionResponse, AttachmentId, CardId, CardVisibility, Checkbox, CheckboxStats, CodecksApiError$1 as CodecksApiError, DataLoader, DeckId, DefaultCard, DerivedStatus, FetchOptions, FileId, LegacyFetchOptions, MilestoneColor, MilestoneId, Priority, ProjectId, ProjectTagId, QueueEntryId, ReleaseId, ResolvableEntryId, ResolvableEntryReactionId, ResolvableId, SprintConfigId, SprintId, StartWeekday, TimeTrackingMode, TimelineScaleType, UserId, Workdays, WorkflowItemId, WorkflowMode } from "./loader-utils-
|
|
3
|
-
import { buildFetchers, buildFetchersFromLoader, buildLegacyFetchers } from "./index-
|
|
1
|
+
import "./query-type-CwrwqxUP.js";
|
|
2
|
+
import { AccountId, ActionMap, ActionName, ActionParams, ActionResponse, AttachmentId, CardId, CardVisibility, Checkbox, CheckboxStats, CodecksApiError$1 as CodecksApiError, DataLoader, DeckId, DefaultCard, DerivedStatus, FetchOptions, FileId, LegacyFetchOptions, MilestoneColor, MilestoneId, Priority, ProjectId, ProjectTagId, QueueEntryId, ReleaseId, ResolvableEntryId, ResolvableEntryReactionId, ResolvableId, SprintConfigId, SprintId, StartWeekday, TimeTrackingMode, TimelineScaleType, UserId, Workdays, WorkflowItemId, WorkflowMode } from "./loader-utils-DdrmVo0F.js";
|
|
3
|
+
import { buildFetchers, buildFetchersFromLoader, buildLegacyFetchers } from "./index-iEtXFnkY.js";
|
|
4
4
|
export { AccountId, ActionMap, ActionName, ActionParams, ActionResponse, AttachmentId, CardId, CardVisibility, Checkbox, CheckboxStats, CodecksApiError, DataLoader, DeckId, DefaultCard, DerivedStatus, FetchOptions, FileId, LegacyFetchOptions, MilestoneColor, MilestoneId, Priority, ProjectId, ProjectTagId, QueueEntryId, ReleaseId, ResolvableEntryId, ResolvableEntryReactionId, ResolvableId, SprintConfigId, SprintId, StartWeekday, TimeTrackingMode, TimelineScaleType, UserId, Workdays, WorkflowItemId, WorkflowMode, buildFetchers, buildFetchersFromLoader, buildLegacyFetchers };
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CodecksApiError, bearerTransport, configuredFetch, ensureMapValue, legacyTransport } from "./collection-utils-
|
|
1
|
+
import { CodecksApiError, bearerTransport, configuredFetch, ensureMapValue, legacyTransport } from "./collection-utils-y85xawyq.js";
|
|
2
2
|
import { _rootDesc$1 as _rootDesc, getRelKey, makeModelQuerySerializable, modelMap, serializeInstanceQuery } from "./query-helpers-DndWBcMF.js";
|
|
3
3
|
|
|
4
4
|
//#region src/model-pool.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SerializableRelationQuery } from "./query-type-
|
|
1
|
+
import { SerializableRelationQuery } from "./query-type-CwrwqxUP.js";
|
|
2
2
|
|
|
3
3
|
//#region src/_exploration/loader-types.d.ts
|
|
4
4
|
type OnLoadedFn = (model: string, key: string, partialInstance: Record<string, unknown>) => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { InferModelQuery, ModelDesc, ModelQuery, Nominal, RelationEntry, TypedField } from "./query-type-
|
|
1
|
+
import { InferModelQuery, ModelDesc, ModelQuery, Nominal, RelationEntry, TypedField } from "./query-type-CwrwqxUP.js";
|
|
2
2
|
|
|
3
3
|
//#region src/models/File.d.ts
|
|
4
4
|
|
|
@@ -70,7 +70,8 @@ type OrderExpr<T> = {
|
|
|
70
70
|
field: T;
|
|
71
71
|
dir: "asc" | "desc";
|
|
72
72
|
};
|
|
73
|
-
type
|
|
73
|
+
type FieldName<T extends AnyDesc> = keyof T["fields"] & string;
|
|
74
|
+
type Order<T extends AnyDesc> = OneOrArray<OrderString<FieldName<T>>> | OneOrArray<OrderExpr<FieldName<T>>>;
|
|
74
75
|
type Operators<T> = {
|
|
75
76
|
op: "lt" | "lte" | "gt" | "gte";
|
|
76
77
|
value: T;
|
|
@@ -221,7 +222,7 @@ type InferModelQuery<M extends AnyDesc, Q extends ModelQuery<M, TMap>, TMap exte
|
|
|
221
222
|
type IsOptional<T, Test> = Test extends true ? T | null : T;
|
|
222
223
|
type EmptyObjIfNever<T> = [T] extends [never] ? {} : T;
|
|
223
224
|
type ExtractRelQueryArray<M extends AnyDesc, TMap extends ModelMap, Q extends RelQuery<M, TMap>> = { [K in keyof Q]: K extends keyof ExtractHasMany<M, TMap> ? Q[K] extends HasManyQueryWithAs<any, any>[] ? { [Item in Q[K][number] as Item["as"]]: InferHasMany<ExtractHasMany<M, TMap>[K]["model"], TMap, Item> } : never : never }[keyof Q];
|
|
224
|
-
type InferHasMany<M extends AnyDesc, TMap extends ModelMap, QM extends
|
|
225
|
+
type InferHasMany<M extends AnyDesc, TMap extends ModelMap, QM extends AbstractHasManyQuery> = QM extends {
|
|
225
226
|
type: "count";
|
|
226
227
|
} ? number : QM extends {
|
|
227
228
|
type: "exists";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ModelDesc, ModelQuery, RelationEntry, TypedField } from "./query-type-
|
|
2
|
-
import { AccountId, AttachmentId, CardId, CardVisibility, Checkbox, CheckboxStats, DeckId, DefaultCard, DerivedStatus, FileId, MilestoneColor, MilestoneId, Priority, ProjectId, ProjectTagId, QueueEntryId, ReleaseId, ResolvableEntryId, ResolvableEntryReactionId, ResolvableId, SprintConfigId, SprintId, StartWeekday, TimeTrackingMode, TimelineScaleType, UserId, Workdays, WorkflowItemId, WorkflowMode, modelMap$1 as modelMap } from "./loader-utils-
|
|
3
|
-
import { BaseLoader, LoaderResult, MissingDataRequest } from "./loader-types-
|
|
1
|
+
import { ModelDesc, ModelQuery, RelationEntry, TypedField } from "./query-type-CwrwqxUP.js";
|
|
2
|
+
import { AccountId, AttachmentId, CardId, CardVisibility, Checkbox, CheckboxStats, DeckId, DefaultCard, DerivedStatus, FileId, MilestoneColor, MilestoneId, Priority, ProjectId, ProjectTagId, QueueEntryId, ReleaseId, ResolvableEntryId, ResolvableEntryReactionId, ResolvableId, SprintConfigId, SprintId, StartWeekday, TimeTrackingMode, TimelineScaleType, UserId, Workdays, WorkflowItemId, WorkflowMode, modelMap$1 as modelMap } from "./loader-utils-DdrmVo0F.js";
|
|
3
|
+
import { BaseLoader, LoaderResult, MissingDataRequest } from "./loader-types-CIO8hJAv.js";
|
|
4
4
|
|
|
5
5
|
//#region src/_exploration/optimistic-manager.d.ts
|
|
6
6
|
|