target-supabase-sdk 0.2.14 → 0.2.15

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/dist/node.js CHANGED
@@ -6,8 +6,8 @@ export { C as CLI_PROD_FLAG, S as SERVICE_ENV_PROFILE_ENV_KEY, w as SERVICE_ENV_
6
6
  import { randomBytes, createHash } from 'node:crypto';
7
7
  import { readFile, unlink, mkdir, writeFile, rename, access, stat, readdir, constants } from 'node:fs/promises';
8
8
  import { dirname, resolve, join, isAbsolute } from 'node:path';
9
- import { bh as sha256Hex, bm as getErrorMessage, bn as LOG_TOPIC_NODE, aL as postRegisterNode, ap as patchChangeNodeStatus, N as NodeStatus, aA as patchStopNode, ax as patchNodeHeartBeat, E as EMPTY_REGISTRY_SLOT_RUNTIME_STATE, b7 as runRegistrySlotGuardCheck, aZ as registrySlotRuntimePatchFromGuardResult, c as CategoryNode, Q as evaluateBusyNodeLiveness, az as patchServiceRuntime, ag as isLogEntry, x as claimServiceRegistrySlot, k as ServiceRegistryError, e as CategoryRepo, R as ResultCode, bo as LOG_TOPIC_TASK, m as TASK_REPO_USAGE, a6 as getScanRemoteRepoValues, at as patchClaimTask, bp as CRITICAL_UNKNOWN_TASK_TRACE_ID, ar as patchChangeTaskStatus, o as TaskStatusAction, bq as toError, aT as postTaskSchema, br as createTaskRow, n as TaskStatus } from './chunks/task-queue-qSnsfiIg.js';
10
- export { A as ApiMethod, C as CategoryConfig, a as CategoryExtraction, b as CategoryLink, d as CategoryParcel, f as CategoryService, g as CategoryTask, D as DEFAULT_SYSTEM_REGISTRY_SEED_SLOTS, L as LINK_MANIFEST_VERSION, h as LIST_MANIFEST_VERSION, P as POST_TASK_DEFAULT_MAX_ATTEMPTS, i as ParcelManager, j as PostLinkValidator, S as ServiceLifecycleStatus, l as ServiceSlotStatus, T as TARGET_SYSTEM_REGISTRY_KEY, p as apiDetailsSchema, q as appendSystemRegistrySlots, r as assertRegistrySlotAvailable, s as assertRegistrySlotOwner, t as buildEmptyServiceSlots, u as buildLinkTargetDraft, v as buildListTargetDraft, w as buildSystemRegistryConfigDetails, y as classifyNetworkError, z as countTasksByType, B as createActiveServiceLifecycle, F as createClaimedRegistrySlotRuntimeState, G as createStorageProviderRegistry, H as createUploadTracker, I as decodeLogBatch, J as decodeLogBatchList, K as defaultL3ServiceDetails, M as deleteParcel, O as deleteParcelSchema, U as fetchBinaryWithRetry, V as fetchWithRetry, W as fieldDefinitionSchema, X as flattenLogBatch, Y as flattenLogBatches, Z as formatNetworkError, _ as getApi, $ as getApiSchema, a0 as getConfig, a1 as getConfigSchema, a2 as getExtraction, a3 as getExtractionSchema, a4 as getParcel, a5 as getParcelSchema, a7 as getScanRemoteRepoValuesSchema, a8 as getService, a9 as getServiceSchema, aa as getTargetSystemRegistry, ab as getValueAtPath, ac as installChunkFetchRegistry, ad as isHttpUrl, ae as isLocalFilesystemPath, af as isLogBatchList, ah as isOpaqueChunkUrl, ai as isRetryableHttpStatus, aj as linkTargetDraftBuildInputSchema, ak as parcelDetailsSchema, al as parseLogBatchMeta, am as parseProviderPrefixedUrl, an as parseServiceSlot, ao as parseServiceSlots, aq as patchChangeNodeStatusSchema, as as patchChangeTaskStatusSchema, au as patchClaimTaskSchema, av as patchExtractionObjects, aw as patchExtractionObjectsSchema, ay as patchNodeHeartBeatSchema, aB as patchStopNodeSchema, aC as patchTaskProgress, aD as patchTaskProgressSchema, aE as postApi, aF as postApiSchema, aG as postExtraction, aH as postExtractionSchema, aI as postLinkCreate, aJ as postParcel, aK as postParcelSchema, aM as postRegisterNodeSchema, aN as postService, aO as postServiceInstance, aP as postServiceSchema, aQ as postSystemRegistryConfig, aR as postSystemRegistryConfigSchema, aS as postTask, aU as postTaskWithRetry, aV as publishParcel, aW as registerProviderChunkResolver, aX as registerService, aY as registerServiceAtStartup, a_ as releaseSystemRegistrySlots, a$ as releaseSystemRegistrySlotsByServiceId, b0 as requestHasBody, b1 as resetSystemRegistryConfig, b2 as resetSystemRegistryConfigSchema, b3 as resolveActiveRegistryServiceId, b4 as resolveFetchUrl, b5 as restoreParcel, b6 as restoreParcelById, b8 as sanitizeFileName, b9 as sanitizeParcelFileName, ba as scanExtractionList, bb as scanExtractionListSchema, bc as schemaDefinitionSchema, bd as serviceDetailsSchema, be as serviceLifecycleSchema, bf as serviceNodeSnapshotSchema, bg as serviceRuntimeSchema, bi as summarizeTaskQueue, bj as systemRegistrySeedSlotSchema, bk as unregisterService, bl as unregisterServiceAtShutdown } from './chunks/task-queue-qSnsfiIg.js';
9
+ import { bi as sha256Hex, bo as getErrorMessage, bp as LOG_TOPIC_NODE, aM as postRegisterNode, aq as patchChangeNodeStatus, N as NodeStatus, aB as patchStopNode, ay as patchNodeHeartBeat, E as EMPTY_REGISTRY_SLOT_RUNTIME_STATE, b8 as runRegistrySlotGuardCheck, a_ as registrySlotRuntimePatchFromGuardResult, c as CategoryNode, U as evaluateBusyNodeLiveness, aA as patchServiceRuntime, ah as isLogEntry, x as claimServiceRegistrySlot, k as ServiceRegistryError, e as CategoryRepo, R as ResultCode, bq as LOG_TOPIC_TASK, m as TASK_REPO_USAGE, a7 as getScanRemoteRepoValues, au as patchClaimTask, br as CRITICAL_UNKNOWN_TASK_TRACE_ID, as as patchChangeTaskStatus, o as TaskStatusAction, bs as toError, aU as postTaskSchema, bt as createTaskRow, n as TaskStatus } from './chunks/task-queue-DCY_0Qj0.js';
10
+ export { A as ApiMethod, C as CategoryConfig, a as CategoryExtraction, b as CategoryLink, d as CategoryParcel, f as CategoryService, g as CategoryTask, D as DEFAULT_SYSTEM_REGISTRY_SEED_SLOTS, L as LINK_MANIFEST_VERSION, h as LIST_MANIFEST_VERSION, P as POST_TASK_DEFAULT_MAX_ATTEMPTS, i as ParcelManager, j as PostLinkValidator, S as ServiceLifecycleStatus, l as ServiceSlotStatus, T as TARGET_SYSTEM_REGISTRY_KEY, p as apiDetailsSchema, q as appendSystemRegistrySlots, r as assertRegistrySlotAvailable, s as assertRegistrySlotOwner, t as buildEmptyServiceSlots, u as buildLinkTargetDraft, v as buildListTargetDraft, w as buildSystemRegistryConfigDetails, y as classifyNetworkError, z as countTasksByType, B as createActiveServiceLifecycle, F as createClaimedRegistrySlotRuntimeState, G as createStorageProviderRegistry, H as createUploadTracker, I as decodeLogBatch, J as decodeLogBatchList, K as defaultL3ServiceDetails, M as deleteParcel, O as deleteParcelSchema, Q as escapeIlikePattern, V as fetchBinaryWithRetry, W as fetchWithRetry, X as fieldDefinitionSchema, Y as flattenLogBatch, Z as flattenLogBatches, _ as formatNetworkError, $ as getApi, a0 as getApiSchema, a1 as getConfig, a2 as getConfigSchema, a3 as getExtraction, a4 as getExtractionSchema, a5 as getParcel, a6 as getParcelSchema, a8 as getScanRemoteRepoValuesSchema, a9 as getService, aa as getServiceSchema, ab as getTargetSystemRegistry, ac as getValueAtPath, ad as installChunkFetchRegistry, ae as isHttpUrl, af as isLocalFilesystemPath, ag as isLogBatchList, ai as isOpaqueChunkUrl, aj as isRetryableHttpStatus, ak as linkTargetDraftBuildInputSchema, al as parcelDetailsSchema, am as parseLogBatchMeta, an as parseProviderPrefixedUrl, ao as parseServiceSlot, ap as parseServiceSlots, ar as patchChangeNodeStatusSchema, at as patchChangeTaskStatusSchema, av as patchClaimTaskSchema, aw as patchExtractionObjects, ax as patchExtractionObjectsSchema, az as patchNodeHeartBeatSchema, aC as patchStopNodeSchema, aD as patchTaskProgress, aE as patchTaskProgressSchema, aF as postApi, aG as postApiSchema, aH as postExtraction, aI as postExtractionSchema, aJ as postLinkCreate, aK as postParcel, aL as postParcelSchema, aN as postRegisterNodeSchema, aO as postService, aP as postServiceInstance, aQ as postServiceSchema, aR as postSystemRegistryConfig, aS as postSystemRegistryConfigSchema, aT as postTask, aV as postTaskWithRetry, aW as publishParcel, aX as registerProviderChunkResolver, aY as registerService, aZ as registerServiceAtStartup, a$ as releaseSystemRegistrySlots, b0 as releaseSystemRegistrySlotsByServiceId, b1 as requestHasBody, b2 as resetSystemRegistryConfig, b3 as resetSystemRegistryConfigSchema, b4 as resolveActiveRegistryServiceId, b5 as resolveFetchUrl, b6 as restoreParcel, b7 as restoreParcelById, b9 as sanitizeFileName, ba as sanitizeParcelFileName, bb as scanExtractionList, bc as scanExtractionListSchema, bd as schemaDefinitionSchema, be as serviceDetailsSchema, bf as serviceLifecycleSchema, bg as serviceNodeSnapshotSchema, bh as serviceRuntimeSchema, bj as summarizeTaskQueue, bk as systemRegistrySeedSlotSchema, bl as toPostgrestTextArrayLiteral, bm as unregisterService, bn as unregisterServiceAtShutdown } from './chunks/task-queue-DCY_0Qj0.js';
11
11
  import { spawn } from 'node:child_process';
12
12
  import { tmpdir } from 'node:os';
13
13
  import { pathToFileURL } from 'node:url';
@@ -0,0 +1,23 @@
1
+ /**
2
+ * PostgREST / Supabase JS client helpers for `target` table filters.
3
+ *
4
+ * @see `.cursor/skills/postgrest-query-filters/SKILL.md`
5
+ */
6
+ /**
7
+ * Escape `%`, `_`, and `\` for PostgREST `ilike` patterns.
8
+ * Also strips commas — they break `.or()` filter strings when multiple columns are searched.
9
+ */
10
+ export declare function escapeIlikePattern(raw: string): string;
11
+ /**
12
+ * Format a JS string array as a PostgreSQL `text[]` literal for PostgREST filter values.
13
+ *
14
+ * Required when tag values contain `:` or other special characters, and when using
15
+ * `.filter(column, "not.ov", literal)` — `.not("column", "ov", jsArray)` stringifies
16
+ * with `Array#toString()` and produces an invalid array literal.
17
+ *
18
+ * @example
19
+ * toPostgrestTextArrayLiteral(["stop-word:base", "small-word"])
20
+ * // → '{"stop-word:base","small-word"}'
21
+ */
22
+ export declare function toPostgrestTextArrayLiteral(values: readonly string[]): string;
23
+ //# sourceMappingURL=postgrest.utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"postgrest.utils.d.ts","sourceRoot":"","sources":["../../../src/shared/utils/postgrest.utils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEtD;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,CAE7E"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "target-supabase-sdk",
3
- "version": "0.2.14",
3
+ "version": "0.2.15",
4
4
  "description": "Supabase client initializer and data access APIs",
5
5
  "license": "MIT",
6
6
  "author": "KyLoc20",
package/src/browser.ts CHANGED
@@ -233,6 +233,7 @@ export {
233
233
  classifyNetworkError,
234
234
  formatNetworkError,
235
235
  } from "./shared/utils/network-error";
236
+ export { escapeIlikePattern, toPostgrestTextArrayLiteral } from "./shared/utils/postgrest.utils";
236
237
  export type { SanitizeFileNameOptions } from "./shared/utils/safe-file-name";
237
238
  export { sanitizeFileName, sanitizeParcelFileName } from "./shared/utils/safe-file-name";
238
239
  export { sha256Hex } from "./shared/utils/sha256";
@@ -0,0 +1,28 @@
1
+ /**
2
+ * PostgREST / Supabase JS client helpers for `target` table filters.
3
+ *
4
+ * @see `.cursor/skills/postgrest-query-filters/SKILL.md`
5
+ */
6
+
7
+ /**
8
+ * Escape `%`, `_`, and `\` for PostgREST `ilike` patterns.
9
+ * Also strips commas — they break `.or()` filter strings when multiple columns are searched.
10
+ */
11
+ export function escapeIlikePattern(raw: string): string {
12
+ return raw.replace(/\\/g, "\\\\").replace(/%/g, "\\%").replace(/_/g, "\\_").replace(/,/g, "");
13
+ }
14
+
15
+ /**
16
+ * Format a JS string array as a PostgreSQL `text[]` literal for PostgREST filter values.
17
+ *
18
+ * Required when tag values contain `:` or other special characters, and when using
19
+ * `.filter(column, "not.ov", literal)` — `.not("column", "ov", jsArray)` stringifies
20
+ * with `Array#toString()` and produces an invalid array literal.
21
+ *
22
+ * @example
23
+ * toPostgrestTextArrayLiteral(["stop-word:base", "small-word"])
24
+ * // → '{"stop-word:base","small-word"}'
25
+ */
26
+ export function toPostgrestTextArrayLiteral(values: readonly string[]): string {
27
+ return `{${values.map((v) => `"${v.replace(/\\/g, "\\\\").replace(/"/g, '\\"')}"`).join(",")}}`;
28
+ }