@lumeweb/pinner 0.1.3 → 0.1.5
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/esm/api/generated/content/content.msw.d.ts +8 -0
- package/dist/esm/api/generated/content/content.msw.js +147 -0
- package/dist/esm/api/generated/content/content.msw.js.map +1 -0
- package/dist/esm/api/generated/dns/dns.msw.d.ts +8 -0
- package/dist/esm/api/generated/dns/dns.msw.js +413 -0
- package/dist/esm/api/generated/dns/dns.msw.js.map +1 -0
- package/dist/esm/api/generated/files/files.msw.d.ts +8 -0
- package/dist/esm/api/generated/files/files.msw.js +150 -0
- package/dist/esm/api/generated/files/files.msw.js.map +1 -0
- package/dist/esm/api/generated/gateway/gateway.msw.d.ts +8 -0
- package/dist/esm/api/generated/gateway/gateway.msw.js +91 -0
- package/dist/esm/api/generated/gateway/gateway.msw.js.map +1 -0
- package/dist/esm/api/generated/index.msw.d.ts +10 -0
- package/dist/esm/api/generated/index.msw.js +11 -0
- package/dist/esm/api/generated/internal/internal.msw.d.ts +8 -0
- package/dist/esm/api/generated/internal/internal.msw.js +103 -0
- package/dist/esm/api/generated/internal/internal.msw.js.map +1 -0
- package/dist/esm/api/generated/ipns/ipns.msw.d.ts +8 -0
- package/dist/esm/api/generated/ipns/ipns.msw.js +205 -0
- package/dist/esm/api/generated/ipns/ipns.msw.js.map +1 -0
- package/dist/esm/api/generated/pinning/pinning.msw.d.ts +8 -0
- package/dist/esm/api/generated/pinning/pinning.msw.js +282 -0
- package/dist/esm/api/generated/pinning/pinning.msw.js.map +1 -0
- package/dist/esm/api/generated/schemas/iPNSRepublishResponse.d.ts +43 -0
- package/dist/esm/api/generated/schemas/websiteItem.d.ts +3 -0
- package/dist/esm/api/generated/schemas/websiteResponse.d.ts +3 -0
- package/dist/esm/api/generated/schemas/websiteValidateResponse.d.ts +1 -0
- package/dist/esm/api/generated/tus/tus.msw.d.ts +8 -0
- package/dist/esm/api/generated/tus/tus.msw.js +98 -0
- package/dist/esm/api/generated/tus/tus.msw.js.map +1 -0
- package/dist/esm/api/generated/websites/websites.msw.d.ts +8 -0
- package/dist/esm/api/generated/websites/websites.msw.js +417 -0
- package/dist/esm/api/generated/websites/websites.msw.js.map +1 -0
- package/dist/esm/api/ipns.d.ts +3 -2
- package/dist/esm/api/ipns.js +2 -3
- package/dist/esm/api/ipns.js.map +1 -1
- package/dist/esm/api/websites.d.ts +12 -2
- package/dist/esm/api/websites.js +20 -2
- package/dist/esm/api/websites.js.map +1 -1
- package/dist/esm/blockstore/unstorage-base.d.ts +1 -1
- package/dist/esm/blockstore/unstorage-base.js +1 -1
- package/dist/esm/index.d.ts +2 -2
- package/dist/esm/index.js +2 -2
- package/package.json +11 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"websites.js","names":[],"sources":["../../../src/api/websites.ts"],"sourcesContent":["import ky, { HTTPError } from \"ky\";\nimport { createNanoEvents } from \"nanoevents\";\nimport type { PinnerConfig } from \"../config\";\nimport type {\n WebsiteItemResponse,\n WebsiteRequest,\n WebsiteResponse,\n WebsiteUpdateRequest,\n WebsiteValidateResponse,\n WebsiteConfigResponse,\n SSLStatusInfo,\n} from \"./generated/schemas/index\";\n\n// SSL status constants\nexport const SSLStatus = {\n PENDING: \"pending\",\n VALIDATING: \"validating\",\n VALID: \"valid\",\n READY: \"ready\",\n FAILED: \"failed\",\n ERROR: \"error\",\n} as const;\n\nexport type SSLStatusValue = (typeof SSLStatus)[keyof typeof SSLStatus];\nimport {\n ConfigurationError,\n AuthenticationError,\n NotFoundError,\n NetworkError,\n ValidationError,\n} from \"@/errors\";\n\nexport interface WebsitesClientOptions {\n signal?: AbortSignal;\n}\n\nexport class WebsitesClient {\n private config: PinnerConfig;\n\n constructor(config: PinnerConfig) {\n if (!config.jwt) {\n throw new ConfigurationError(\"JWT token is required\");\n }\n this.config = config;\n }\n\n private getEndpoint(): string {\n return this.config.endpoint ?? \"https://ipfs.pinner.xyz\";\n }\n\n private async request<T>(\n path: string,\n options?: RequestInit & { signal?: AbortSignal },\n ): Promise<T> {\n if (!this.config.jwt) {\n throw new ConfigurationError(\"JWT token is required\");\n }\n\n try {\n const response = await ky(path, {\n prefix: this.getEndpoint(),\n headers: {\n Authorization: `Bearer ${this.config.jwt}`,\n \"Content-Type\": \"application/json\",\n },\n ...options,\n });\n\n if (response.status === 204) {\n return undefined as T;\n }\n\n const text = await response.text();\n if (!text) {\n return undefined as T;\n }\n\n return JSON.parse(text) as T;\n } catch (error) {\n if (error instanceof HTTPError) {\n const status = error.response.status;\n const body = await error.response.json().catch(() => ({}));\n\n if (status === 401) {\n throw new AuthenticationError(\n body.error || \"Authentication failed\",\n );\n }\n if (status === 403) {\n throw new AuthenticationError(\n body.error || \"Access forbidden\",\n );\n }\n if (status === 404) {\n throw new NotFoundError(body.error || \"Resource not found\");\n }\n if (status === 400) {\n throw new ValidationError(body.error || \"Invalid request\");\n }\n if (status === 410) {\n throw new ValidationError(body.error || \"Target is broken or gone\");\n }\n\n throw new NetworkError(\n body.error || `HTTP error: ${status}`,\n );\n }\n\n if (error instanceof Error) {\n throw new NetworkError(error.message);\n }\n\n throw new NetworkError(\"Unknown error occurred\");\n }\n }\n\n async listWebsites(options?: WebsitesClientOptions): Promise<WebsiteItemResponse> {\n return this.request<WebsiteItemResponse>(\"api/websites\", {\n signal: options?.signal,\n });\n }\n\n async createWebsite(\n request: WebsiteRequest,\n options?: WebsitesClientOptions,\n ): Promise<WebsiteResponse> {\n return this.request<WebsiteResponse>(\"api/websites\", {\n method: \"POST\",\n body: JSON.stringify(request),\n signal: options?.signal,\n });\n }\n\n async getWebsite(\n id: number,\n options?: WebsitesClientOptions,\n ): Promise<WebsiteResponse> {\n return this.request<WebsiteResponse>(`api/websites/${id}`, {\n signal: options?.signal,\n });\n }\n\n async updateWebsite(\n id: number,\n request: WebsiteUpdateRequest,\n options?: WebsitesClientOptions,\n ): Promise<WebsiteResponse> {\n return this.request<WebsiteResponse>(`api/websites/${id}`, {\n method: \"PUT\",\n body: JSON.stringify(request),\n signal: options?.signal,\n });\n }\n\n async deleteWebsite(\n id: number,\n options?: WebsitesClientOptions,\n ): Promise<void> {\n await this.request<void>(`api/websites/${id}`, {\n method: \"DELETE\",\n signal: options?.signal,\n });\n }\n\n async validateWebsite(\n id: number,\n options?: WebsitesClientOptions,\n ): Promise<WebsiteValidateResponse> {\n return this.request<WebsiteValidateResponse>(\n `api/websites/${id}/validate`,\n {\n method: \"POST\",\n signal: options?.signal,\n },\n );\n }\n\n async getSSLStatus(\n domain: string,\n options?: WebsitesClientOptions,\n ): Promise<SSLStatusInfo> {\n return this.request<SSLStatusInfo>(\n `api/websites/${encodeURIComponent(domain)}/ssl-status`,\n {\n signal: options?.signal,\n },\n );\n }\n\n async getWebsiteConfig(\n options?: WebsitesClientOptions,\n ): Promise<WebsiteConfigResponse> {\n return this.request<WebsiteConfigResponse>(\"api/websites/config\", {\n signal: options?.signal,\n });\n }\n\n watchSSL(\n domain: string,\n options?: WatchOptions,\n ): SSLWatcher {\n return new SSLWatcherImpl(this, domain, options);\n }\n}\n\nexport interface WatchOptions {\n interval?: number;\n timeout?: number;\n}\n\nexport interface SSLEvents {\n ready: (status: SSLStatusInfo) => void;\n error: (error: SSLError) => void;\n status: (status: SSLStatusInfo) => void;\n}\n\nexport interface SSLCallbacks {\n onReady?: (status: SSLStatusInfo) => void;\n onError?: (error: SSLError) => void;\n onStatus?: (status: SSLStatusInfo) => void;\n}\n\nexport interface SSLWatcher {\n start(callbacks: SSLCallbacks): Promise<void>;\n stop(): void;\n}\n\nexport interface SSLError extends Error {\n type: 'timeout' | 'error';\n details?: string;\n}\n\nconst DEFAULT_INTERVAL = 5000;\nconst DEFAULT_TIMEOUT = 300000;\n\nclass SSLWatcherImpl implements SSLWatcher {\n private emitter = createNanoEvents<SSLEvents>();\n private unbind: (() => void)[] = [];\n private intervalId: ReturnType<typeof setInterval> | null = null;\n private timeoutId: ReturnType<typeof setTimeout> | null = null;\n private stopped = false;\n private options: WatchOptions;\n private runId = 0;\n\n constructor(\n private client: WebsitesClient,\n private domain: string,\n options: WatchOptions = {},\n ) {\n this.options = {\n interval: options.interval ?? DEFAULT_INTERVAL,\n timeout: options.timeout ?? DEFAULT_TIMEOUT,\n };\n\n if (this.options.interval <= 0) {\n this.options.interval = DEFAULT_INTERVAL;\n }\n if (this.options.timeout <= 0) {\n this.options.timeout = DEFAULT_TIMEOUT;\n }\n }\n\n private emitError(\n message: string,\n type: SSLError['type'] = 'error',\n details?: string,\n ): void {\n const error: SSLError = new Error(message) as SSLError;\n error.type = type;\n error.details = details;\n this.emitter.emit('error', error);\n this.stop();\n }\n\n async start(callbacks: SSLCallbacks = {}): Promise<void> {\n this.stop();\n this.stopped = false;\n const currentRunId = ++this.runId;\n\n if (callbacks.onReady) {\n this.unbind.push(this.emitter.on('ready', callbacks.onReady));\n }\n if (callbacks.onError) {\n this.unbind.push(this.emitter.on('error', callbacks.onError));\n }\n if (callbacks.onStatus) {\n this.unbind.push(this.emitter.on('status', callbacks.onStatus));\n }\n\n const checkStatus = async (): Promise<void> => {\n if (this.stopped || this.runId !== currentRunId) {\n return;\n }\n\n try {\n const status = await this.client.getSSLStatus(this.domain);\n if (this.stopped || this.runId !== currentRunId) {\n return;\n }\n this.emitter.emit('status', status);\n\n if (status.status === SSLStatus.VALID || status.status === SSLStatus.READY) {\n this.emitter.emit('ready', status);\n this.stop();\n } else if (status.status === SSLStatus.FAILED || status.status === SSLStatus.ERROR) {\n this.emitError(\n status.error || 'SSL provisioning failed',\n 'error',\n status.error,\n );\n }\n } catch (err) {\n if (this.stopped || this.runId !== currentRunId) {\n return;\n }\n\n this.emitError(\n err instanceof Error ? err.message : 'Failed to check SSL status',\n 'error',\n );\n }\n };\n\n await checkStatus();\n\n if (this.stopped || this.runId !== currentRunId) {\n return;\n }\n\n this.intervalId = setInterval(checkStatus, this.options.interval);\n\n this.timeoutId = setTimeout(() => {\n if (!this.stopped && this.runId === currentRunId) {\n this.emitError('SSL provisioning timeout', 'timeout');\n }\n }, this.options.timeout);\n }\n\n stop(): void {\n this.stopped = true;\n\n this.unbind.forEach(unbind => unbind());\n this.unbind = [];\n\n if (this.intervalId) {\n clearInterval(this.intervalId);\n this.intervalId = null;\n }\n\n if (this.timeoutId) {\n clearTimeout(this.timeoutId);\n this.timeoutId = null;\n }\n }\n}\n"],"mappings":";;;;;AAcA,MAAa,YAAY;CACvB,SAAS;CACT,YAAY;CACZ,OAAO;CACP,OAAO;CACP,QAAQ;CACR,OAAO;CACR;AAeD,IAAa,iBAAb,MAA4B;CAC1B,AAAQ;CAER,YAAY,QAAsB;AAChC,MAAI,CAAC,OAAO,IACV,OAAM,IAAI,mBAAmB,wBAAwB;AAEvD,OAAK,SAAS;;CAGhB,AAAQ,cAAsB;AAC5B,SAAO,KAAK,OAAO,YAAY;;CAGjC,MAAc,QACZ,MACA,SACY;AACZ,MAAI,CAAC,KAAK,OAAO,IACf,OAAM,IAAI,mBAAmB,wBAAwB;AAGvD,MAAI;GACF,MAAM,WAAW,MAAM,GAAG,MAAM;IAC9B,QAAQ,KAAK,aAAa;IAC1B,SAAS;KACP,eAAe,UAAU,KAAK,OAAO;KACrC,gBAAgB;KACjB;IACD,GAAG;IACJ,CAAC;AAEF,OAAI,SAAS,WAAW,IACtB;GAGF,MAAM,OAAO,MAAM,SAAS,MAAM;AAClC,OAAI,CAAC,KACH;AAGF,UAAO,KAAK,MAAM,KAAK;WAChB,OAAO;AACd,OAAI,iBAAiB,WAAW;IAC9B,MAAM,SAAS,MAAM,SAAS;IAC9B,MAAM,OAAO,MAAM,MAAM,SAAS,MAAM,CAAC,aAAa,EAAE,EAAE;AAE1D,QAAI,WAAW,IACb,OAAM,IAAI,oBACR,KAAK,SAAS,wBACf;AAEH,QAAI,WAAW,IACb,OAAM,IAAI,oBACR,KAAK,SAAS,mBACf;AAEH,QAAI,WAAW,IACb,OAAM,IAAI,cAAc,KAAK,SAAS,qBAAqB;AAE7D,QAAI,WAAW,IACb,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,KAAK,UAAU,OAAO;AAEnC,QAAI,OAAO,WAAW,UAAU,SAAS,OAAO,WAAW,UAAU,OAAO;AAC1E,UAAK,QAAQ,KAAK,SAAS,OAAO;AAClC,UAAK,MAAM;eACF,OAAO,WAAW,UAAU,UAAU,OAAO,WAAW,UAAU,MAC3E,MAAK,UACH,OAAO,SAAS,2BAChB,SACA,OAAO,MACR;YAEI,KAAK;AACZ,QAAI,KAAK,WAAW,KAAK,UAAU,aACjC;AAGF,SAAK,UACH,eAAe,QAAQ,IAAI,UAAU,8BACrC,QACD;;;AAIL,QAAM,aAAa;AAEnB,MAAI,KAAK,WAAW,KAAK,UAAU,aACjC;AAGF,OAAK,aAAa,YAAY,aAAa,KAAK,QAAQ,SAAS;AAEjE,OAAK,YAAY,iBAAiB;AAChC,OAAI,CAAC,KAAK,WAAW,KAAK,UAAU,aAClC,MAAK,UAAU,4BAA4B,UAAU;KAEtD,KAAK,QAAQ,QAAQ;;CAG1B,OAAa;AACX,OAAK,UAAU;AAEf,OAAK,OAAO,SAAQ,WAAU,QAAQ,CAAC;AACvC,OAAK,SAAS,EAAE;AAEhB,MAAI,KAAK,YAAY;AACnB,iBAAc,KAAK,WAAW;AAC9B,QAAK,aAAa;;AAGpB,MAAI,KAAK,WAAW;AAClB,gBAAa,KAAK,UAAU;AAC5B,QAAK,YAAY"}
|
|
1
|
+
{"version":3,"file":"websites.js","names":[],"sources":["../../../src/api/websites.ts"],"sourcesContent":["import ky, { HTTPError } from \"ky\";\nimport { createNanoEvents } from \"nanoevents\";\nimport type { PinnerConfig } from \"../config\";\nimport type {\n WebsiteItemResponse,\n WebsiteRequest,\n WebsiteResponse,\n WebsiteUpdateRequest,\n WebsiteValidateResponse,\n WebsiteConfigResponse,\n SSLStatusInfo,\n} from \"./generated/schemas/index\";\n\n// SSL status constants\nexport const SSLStatus = {\n PENDING: \"pending\",\n VALIDATING: \"validating\",\n VALID: \"valid\",\n READY: \"ready\",\n FAILED: \"failed\",\n ERROR: \"error\",\n} as const;\n\nexport type SSLStatusValue = (typeof SSLStatus)[keyof typeof SSLStatus];\n\n// Website validation reason constants\nexport const WebsiteValidationReason = {\n VALIDATED: \"validated\",\n TOKEN_EXPIRED: \"token_expired\",\n DNS_MISSING: \"dns_missing\",\n DNS_MISMATCH: \"dns_mismatch\",\n TOKEN_MISSING: \"token_missing\",\n} as const;\n\nexport type WebsiteValidationReasonValue = (typeof WebsiteValidationReason)[keyof typeof WebsiteValidationReason];\n\nconst validationReasonValues = Object.values(WebsiteValidationReason) as readonly string[];\n\nexport function getValidationReason(response: WebsiteValidateResponse | null | undefined): WebsiteValidationReasonValue | \"\" {\n if (!response) {\n return \"\";\n }\n const reason = response.reason;\n if (typeof reason === \"string\" && validationReasonValues.includes(reason)) {\n return reason as WebsiteValidationReasonValue;\n }\n return \"\";\n}\n\nexport function isValidationReason(response: WebsiteValidateResponse | null | undefined, reason: WebsiteValidationReasonValue): boolean {\n if (!response) {\n return false;\n }\n return response.reason === reason;\n}\nimport {\n ConfigurationError,\n AuthenticationError,\n NotFoundError,\n NetworkError,\n ValidationError,\n} from \"@/errors\";\n\nexport interface WebsitesClientOptions {\n signal?: AbortSignal;\n}\n\nexport class WebsitesClient {\n private config: PinnerConfig;\n\n constructor(config: PinnerConfig) {\n if (!config.jwt) {\n throw new ConfigurationError(\"JWT token is required\");\n }\n this.config = config;\n }\n\n private getEndpoint(): string {\n return this.config.endpoint ?? \"https://ipfs.pinner.xyz\";\n }\n\n private async request<T>(\n path: string,\n options?: RequestInit & { signal?: AbortSignal },\n ): Promise<T> {\n if (!this.config.jwt) {\n throw new ConfigurationError(\"JWT token is required\");\n }\n\n try {\n const response = await ky(path, {\n prefix: this.getEndpoint(),\n headers: {\n Authorization: `Bearer ${this.config.jwt}`,\n \"Content-Type\": \"application/json\",\n },\n ...options,\n });\n\n if (response.status === 204) {\n return undefined as T;\n }\n\n const text = await response.text();\n if (!text) {\n return undefined as T;\n }\n\n return JSON.parse(text) as T;\n } catch (error) {\n if (error instanceof HTTPError) {\n const status = error.response.status;\n const body = await error.response.json().catch(() => ({}));\n\n if (status === 401) {\n throw new AuthenticationError(\n body.error || \"Authentication failed\",\n );\n }\n if (status === 403) {\n throw new AuthenticationError(\n body.error || \"Access forbidden\",\n );\n }\n if (status === 404) {\n throw new NotFoundError(body.error || \"Resource not found\");\n }\n if (status === 400) {\n throw new ValidationError(body.error || \"Invalid request\");\n }\n if (status === 410) {\n throw new ValidationError(body.error || \"Target is broken or gone\");\n }\n\n throw new NetworkError(\n body.error || `HTTP error: ${status}`,\n );\n }\n\n if (error instanceof Error) {\n throw new NetworkError(error.message);\n }\n\n throw new NetworkError(\"Unknown error occurred\");\n }\n }\n\n async listWebsites(options?: WebsitesClientOptions): Promise<WebsiteItemResponse> {\n return this.request<WebsiteItemResponse>(\"api/websites\", {\n signal: options?.signal,\n });\n }\n\n async createWebsite(\n request: WebsiteRequest,\n options?: WebsitesClientOptions,\n ): Promise<WebsiteResponse> {\n return this.request<WebsiteResponse>(\"api/websites\", {\n method: \"POST\",\n body: JSON.stringify(request),\n signal: options?.signal,\n });\n }\n\n async getWebsite(\n id: number,\n options?: WebsitesClientOptions,\n ): Promise<WebsiteResponse> {\n return this.request<WebsiteResponse>(`api/websites/${id}`, {\n signal: options?.signal,\n });\n }\n\n async updateWebsite(\n id: number,\n request: WebsiteUpdateRequest,\n options?: WebsitesClientOptions,\n ): Promise<WebsiteResponse> {\n return this.request<WebsiteResponse>(`api/websites/${id}`, {\n method: \"PUT\",\n body: JSON.stringify(request),\n signal: options?.signal,\n });\n }\n\n async deleteWebsite(\n id: number,\n options?: WebsitesClientOptions,\n ): Promise<void> {\n await this.request<void>(`api/websites/${id}`, {\n method: \"DELETE\",\n signal: options?.signal,\n });\n }\n\n async validateWebsite(\n id: number,\n options?: WebsitesClientOptions,\n ): Promise<WebsiteValidateResponse> {\n return this.request<WebsiteValidateResponse>(\n `api/websites/${id}/validate`,\n {\n method: \"POST\",\n signal: options?.signal,\n },\n );\n }\n\n async getSSLStatus(\n domain: string,\n options?: WebsitesClientOptions,\n ): Promise<SSLStatusInfo> {\n return this.request<SSLStatusInfo>(\n `api/websites/${encodeURIComponent(domain)}/ssl-status`,\n {\n signal: options?.signal,\n },\n );\n }\n\n async getWebsiteConfig(\n options?: WebsitesClientOptions,\n ): Promise<WebsiteConfigResponse> {\n return this.request<WebsiteConfigResponse>(\"api/websites/config\", {\n signal: options?.signal,\n });\n }\n\n watchSSL(\n domain: string,\n options?: WatchOptions,\n ): SSLWatcher {\n return new SSLWatcherImpl(this, domain, options);\n }\n}\n\nexport interface WatchOptions {\n interval?: number;\n timeout?: number;\n}\n\nexport interface SSLEvents {\n ready: (status: SSLStatusInfo) => void;\n error: (error: SSLError) => void;\n status: (status: SSLStatusInfo) => void;\n}\n\nexport interface SSLCallbacks {\n onReady?: (status: SSLStatusInfo) => void;\n onError?: (error: SSLError) => void;\n onStatus?: (status: SSLStatusInfo) => void;\n}\n\nexport interface SSLWatcher {\n start(callbacks: SSLCallbacks): Promise<void>;\n stop(): void;\n}\n\nexport interface SSLError extends Error {\n type: 'timeout' | 'error';\n details?: string;\n}\n\nconst DEFAULT_INTERVAL = 5000;\nconst DEFAULT_TIMEOUT = 300000;\n\nclass SSLWatcherImpl implements SSLWatcher {\n private emitter = createNanoEvents<SSLEvents>();\n private unbind: (() => void)[] = [];\n private intervalId: ReturnType<typeof setInterval> | null = null;\n private timeoutId: ReturnType<typeof setTimeout> | null = null;\n private stopped = false;\n private options: WatchOptions;\n private runId = 0;\n\n constructor(\n private client: WebsitesClient,\n private domain: string,\n options: WatchOptions = {},\n ) {\n this.options = {\n interval: options.interval ?? DEFAULT_INTERVAL,\n timeout: options.timeout ?? DEFAULT_TIMEOUT,\n };\n\n if (this.options.interval <= 0) {\n this.options.interval = DEFAULT_INTERVAL;\n }\n if (this.options.timeout <= 0) {\n this.options.timeout = DEFAULT_TIMEOUT;\n }\n }\n\n private emitError(\n message: string,\n type: SSLError['type'] = 'error',\n details?: string,\n ): void {\n const error: SSLError = new Error(message) as SSLError;\n error.type = type;\n error.details = details;\n this.emitter.emit('error', error);\n this.stop();\n }\n\n async start(callbacks: SSLCallbacks = {}): Promise<void> {\n this.stop();\n this.stopped = false;\n const currentRunId = ++this.runId;\n\n if (callbacks.onReady) {\n this.unbind.push(this.emitter.on('ready', callbacks.onReady));\n }\n if (callbacks.onError) {\n this.unbind.push(this.emitter.on('error', callbacks.onError));\n }\n if (callbacks.onStatus) {\n this.unbind.push(this.emitter.on('status', callbacks.onStatus));\n }\n\n const checkStatus = async (): Promise<void> => {\n if (this.stopped || this.runId !== currentRunId) {\n return;\n }\n\n try {\n const status = await this.client.getSSLStatus(this.domain);\n if (this.stopped || this.runId !== currentRunId) {\n return;\n }\n this.emitter.emit('status', status);\n\n if (status.status === SSLStatus.VALID || status.status === SSLStatus.READY) {\n this.emitter.emit('ready', status);\n this.stop();\n } else if (status.status === SSLStatus.FAILED || status.status === SSLStatus.ERROR) {\n this.emitError(\n status.error || 'SSL provisioning failed',\n 'error',\n status.error,\n );\n }\n } catch (err) {\n if (this.stopped || this.runId !== currentRunId) {\n return;\n }\n\n this.emitError(\n err instanceof Error ? err.message : 'Failed to check SSL status',\n 'error',\n );\n }\n };\n\n await checkStatus();\n\n if (this.stopped || this.runId !== currentRunId) {\n return;\n }\n\n this.intervalId = setInterval(checkStatus, this.options.interval);\n\n this.timeoutId = setTimeout(() => {\n if (!this.stopped && this.runId === currentRunId) {\n this.emitError('SSL provisioning timeout', 'timeout');\n }\n }, this.options.timeout);\n }\n\n stop(): void {\n this.stopped = true;\n\n this.unbind.forEach(unbind => unbind());\n this.unbind = [];\n\n if (this.intervalId) {\n clearInterval(this.intervalId);\n this.intervalId = null;\n }\n\n if (this.timeoutId) {\n clearTimeout(this.timeoutId);\n this.timeoutId = null;\n }\n }\n}\n"],"mappings":";;;;;AAcA,MAAa,YAAY;CACvB,SAAS;CACT,YAAY;CACZ,OAAO;CACP,OAAO;CACP,QAAQ;CACR,OAAO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AAK,WAAW,KAAK,UAAU,aACjC;AAEF,SAAK,QAAQ,KAAK,UAAU,OAAO;AAEnC,QAAI,OAAO,WAAW,UAAU,SAAS,OAAO,WAAW,UAAU,OAAO;AAC1E,UAAK,QAAQ,KAAK,SAAS,OAAO;AAClC,UAAK,MAAM;eACF,OAAO,WAAW,UAAU,UAAU,OAAO,WAAW,UAAU,MAC3E,MAAK,UACH,OAAO,SAAS,2BAChB,SACA,OAAO,MACR;YAEI,KAAK;AACZ,QAAI,KAAK,WAAW,KAAK,UAAU,aACjC;AAGF,SAAK,UACH,eAAe,QAAQ,IAAI,UAAU,8BACrC,QACD;;;AAIL,QAAM,aAAa;AAEnB,MAAI,KAAK,WAAW,KAAK,UAAU,aACjC;AAGF,OAAK,aAAa,YAAY,aAAa,KAAK,QAAQ,SAAS;AAEjE,OAAK,YAAY,iBAAiB;AAChC,OAAI,CAAC,KAAK,WAAW,KAAK,UAAU,aAClC,MAAK,UAAU,4BAA4B,UAAU;KAEtD,KAAK,QAAQ,QAAQ;;CAG1B,OAAa;AACX,OAAK,UAAU;AAEf,OAAK,OAAO,SAAQ,WAAU,QAAQ,CAAC;AACvC,OAAK,SAAS,EAAE;AAEhB,MAAI,KAAK,YAAY;AACnB,iBAAc,KAAK,WAAW;AAC9B,QAAK,aAAa;;AAGpB,MAAI,KAAK,WAAW;AAClB,gBAAa,KAAK,UAAU;AAC5B,QAAK,YAAY"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BaseBlockstore } from "
|
|
1
|
+
import { BaseBlockstore } from "blockstore-core";
|
|
2
2
|
import { Driver, Storage } from "unstorage";
|
|
3
3
|
import { Datastore } from "interface-datastore";
|
|
4
4
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { collectAsyncIterable } from "../utils/stream.js";
|
|
2
2
|
import { DEFAULT_BLOCKSTORE_PREFIX } from "../types/constants.js";
|
|
3
|
-
import { BaseBlockstore } from "
|
|
3
|
+
import { BaseBlockstore } from "blockstore-core";
|
|
4
4
|
import { CID } from "multiformats/cid";
|
|
5
5
|
import { createStorage } from "unstorage";
|
|
6
6
|
import { Key } from "interface-datastore";
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PinnerConfig } from "./config.js";
|
|
2
2
|
import { IpnsClient } from "./api/ipns.js";
|
|
3
|
-
import { WebsitesClient } from "./api/websites.js";
|
|
3
|
+
import { WebsiteValidationReason, WebsiteValidationReasonValue, WebsitesClient, getValidationReason, isValidationReason } from "./api/websites.js";
|
|
4
4
|
import { UploadInput, UploadOperation, UploadOptions, UploadProgress, UploadResult } from "./types/upload.js";
|
|
5
5
|
import { AbortOptions, RemoteAddOptions, RemoteLsOptions, RemotePin, RemotePins } from "./types/pin.js";
|
|
6
6
|
import { Pinner } from "./pinner.js";
|
|
@@ -15,4 +15,4 @@ import { asyncGeneratorToReadableStream, calculateStreamSize, readableStreamToAs
|
|
|
15
15
|
import { PinataAdapter } from "./adapters/pinata/v2/adapter-interface.js";
|
|
16
16
|
import { pinataAdapter } from "./adapters/pinata/v2/adapter.js";
|
|
17
17
|
import { PinataLegacyAdapter, pinataLegacyAdapter } from "./adapters/pinata/legacy/adapter.js";
|
|
18
|
-
export { type AbortOptions, AuthenticationError, type CarPreprocessOptions, type CarPreprocessResult, ConfigurationError, EmptyFileError, FILE_EXTENSION_CAR, IpnsClient, MIME_TYPE_CAR, MIME_TYPE_OCTET_STREAM, NetworkError, NotFoundError, PinError, type PinataAdapter, type PinataLegacyAdapter, Pinner, type PinnerConfig, PinnerError, RateLimitError, type RemoteAddOptions, type RemoteLsOptions, type RemotePin, type RemotePins, TimeoutError, type UnstorageBlockstoreOptions, UploadError, type UploadInput, UploadManager, type UploadOperation, type UploadOptions, type UploadProgress, type UploadResult, ValidationError, WebsitesClient, asyncGeneratorToReadableStream, calculateStreamSize, createBlockstore, createDatastore, destroyCarPreprocessor, isAuthenticationError, isCarFile, isRetryable, pinataAdapter, pinataLegacyAdapter, preprocessToCar, readableStreamToAsyncIterable, setDriverFactory, streamToBlob };
|
|
18
|
+
export { type AbortOptions, AuthenticationError, type CarPreprocessOptions, type CarPreprocessResult, ConfigurationError, EmptyFileError, FILE_EXTENSION_CAR, IpnsClient, MIME_TYPE_CAR, MIME_TYPE_OCTET_STREAM, NetworkError, NotFoundError, PinError, type PinataAdapter, type PinataLegacyAdapter, Pinner, type PinnerConfig, PinnerError, RateLimitError, type RemoteAddOptions, type RemoteLsOptions, type RemotePin, type RemotePins, TimeoutError, type UnstorageBlockstoreOptions, UploadError, type UploadInput, UploadManager, type UploadOperation, type UploadOptions, type UploadProgress, type UploadResult, ValidationError, WebsiteValidationReason, type WebsiteValidationReasonValue, WebsitesClient, asyncGeneratorToReadableStream, calculateStreamSize, createBlockstore, createDatastore, destroyCarPreprocessor, getValidationReason, isAuthenticationError, isCarFile, isRetryable, isValidationReason, pinataAdapter, pinataLegacyAdapter, preprocessToCar, readableStreamToAsyncIterable, setDriverFactory, streamToBlob };
|
package/dist/esm/index.js
CHANGED
|
@@ -7,11 +7,11 @@ import { destroyCarPreprocessor, isCarFile, preprocessToCar } from "./upload/car
|
|
|
7
7
|
import { AuthenticationError, ConfigurationError, EmptyFileError, NetworkError, NotFoundError, PinError, PinnerError, RateLimitError, TimeoutError, UploadError, ValidationError } from "./errors/index.js";
|
|
8
8
|
import { UploadManager } from "./upload/manager.js";
|
|
9
9
|
import { IpnsClient } from "./api/ipns.js";
|
|
10
|
-
import { WebsitesClient } from "./api/websites.js";
|
|
10
|
+
import { WebsiteValidationReason, WebsitesClient, getValidationReason, isValidationReason } from "./api/websites.js";
|
|
11
11
|
import { Pinner } from "./pinner.js";
|
|
12
12
|
import { isAuthenticationError, isRetryable } from "./types/type-guards.js";
|
|
13
13
|
import { pinataAdapter } from "./adapters/pinata/v2/adapter.js";
|
|
14
14
|
import { pinataLegacyAdapter } from "./adapters/pinata/legacy/adapter.js";
|
|
15
15
|
import "./adapters/pinata/index.js";
|
|
16
16
|
|
|
17
|
-
export { AuthenticationError, ConfigurationError, EmptyFileError, FILE_EXTENSION_CAR, IpnsClient, MIME_TYPE_CAR, MIME_TYPE_OCTET_STREAM, NetworkError, NotFoundError, PinError, Pinner, PinnerError, RateLimitError, TimeoutError, UploadError, UploadManager, ValidationError, WebsitesClient, asyncGeneratorToReadableStream, calculateStreamSize, createBlockstore, createDatastore, destroyCarPreprocessor, isAuthenticationError, isCarFile, isRetryable, pinataAdapter, pinataLegacyAdapter, preprocessToCar, readableStreamToAsyncIterable, setDriverFactory, streamToBlob };
|
|
17
|
+
export { AuthenticationError, ConfigurationError, EmptyFileError, FILE_EXTENSION_CAR, IpnsClient, MIME_TYPE_CAR, MIME_TYPE_OCTET_STREAM, NetworkError, NotFoundError, PinError, Pinner, PinnerError, RateLimitError, TimeoutError, UploadError, UploadManager, ValidationError, WebsiteValidationReason, WebsitesClient, asyncGeneratorToReadableStream, calculateStreamSize, createBlockstore, createDatastore, destroyCarPreprocessor, getValidationReason, isAuthenticationError, isCarFile, isRetryable, isValidationReason, pinataAdapter, pinataLegacyAdapter, preprocessToCar, readableStreamToAsyncIterable, setDriverFactory, streamToBlob };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lumeweb/pinner",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
@@ -16,6 +16,10 @@
|
|
|
16
16
|
"import": "./dist/esm/index.js",
|
|
17
17
|
"require": "./dist/cjs/index.js"
|
|
18
18
|
},
|
|
19
|
+
"./mocks": {
|
|
20
|
+
"types": "./dist/esm/api/generated/index.msw.d.ts",
|
|
21
|
+
"import": "./dist/esm/api/generated/index.msw.js"
|
|
22
|
+
},
|
|
19
23
|
"./adapters/pinata": {
|
|
20
24
|
"types": "./dist/esm/adapters/pinata.d.ts",
|
|
21
25
|
"import": "./dist/esm/adapters/pinata.js"
|
|
@@ -44,6 +48,7 @@
|
|
|
44
48
|
"@ipld/car": "^5.4.6",
|
|
45
49
|
"@uppy/core": "^5.2.0",
|
|
46
50
|
"@uppy/tus": "5.1.1",
|
|
51
|
+
"blockstore-core": "^6.1.3",
|
|
47
52
|
"blockstore-idb": "^3.0.2",
|
|
48
53
|
"datastore-idb": "^4.0.3",
|
|
49
54
|
"idb-keyval": "^6.2.2",
|
|
@@ -53,20 +58,21 @@
|
|
|
53
58
|
"ipaddr.js": "^2.4.0",
|
|
54
59
|
"ky": "^2.0.2",
|
|
55
60
|
"multiformats": "^13.4.2",
|
|
61
|
+
"nanoevents": "^9.1.0",
|
|
56
62
|
"p-defer": "^4.0.1",
|
|
57
63
|
"progress-events": "^1.1.0",
|
|
58
64
|
"tus-js-client": "4.3.1",
|
|
59
65
|
"unstorage": "^1.17.5",
|
|
60
|
-
"@lumeweb/portal-sdk": "0.1.
|
|
61
|
-
"@lumeweb/
|
|
62
|
-
"@lumeweb/
|
|
66
|
+
"@lumeweb/portal-sdk": "0.1.2",
|
|
67
|
+
"@lumeweb/uppy-post-upload": "0.1.1",
|
|
68
|
+
"@lumeweb/query-builder": "0.1.1"
|
|
63
69
|
},
|
|
64
70
|
"devDependencies": {
|
|
71
|
+
"@faker-js/faker": "^10.4.0",
|
|
65
72
|
"@mswjs/interceptors": "^0.41.9",
|
|
66
73
|
"@types/uuid": "^11.0.0",
|
|
67
74
|
"@vitest/browser-playwright": "^4.1.6",
|
|
68
75
|
"@vitest/ui": "4.1.5",
|
|
69
|
-
"blockstore-core": "^6.1.3",
|
|
70
76
|
"datastore-core": "^11.0.4",
|
|
71
77
|
"happy-dom": "^20.9.0",
|
|
72
78
|
"msw": "^2.14.6",
|