@distilled.cloud/cloudflare 0.15.1 → 0.16.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@distilled.cloud/cloudflare",
3
- "version": "0.15.1",
3
+ "version": "0.16.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/alchemy-run/distilled",
@@ -56,14 +56,14 @@
56
56
  "fmt": "oxfmt --write src",
57
57
  "lint": "oxlint --fix src",
58
58
  "check": "tsgo && oxlint src && oxfmt --check src",
59
- "test": "vitest run --exclude specs",
59
+ "test": "vitest run --exclude specs --passWithNoTests",
60
60
  "publish:npm": "bun run build && bun publish --access public",
61
61
  "generate": "bun run scripts/generate.ts && oxlint --fix src && oxfmt --write src && oxfmt --write src",
62
62
  "specs:fetch": "git submodule update --force --init --recursive --depth=1 specs/cloudflare-typescript && git -C specs/cloudflare-typescript checkout -- .",
63
63
  "specs:update": "git -C specs/cloudflare-typescript fetch && git -C specs/cloudflare-typescript checkout main && git -C specs/cloudflare-typescript pull"
64
64
  },
65
65
  "dependencies": {
66
- "@distilled.cloud/core": "0.15.1",
66
+ "@distilled.cloud/core": "0.16.0",
67
67
  "effect": "4.0.0-beta.58"
68
68
  },
69
69
  "devDependencies": {
@@ -216,19 +216,15 @@ export const listStores: API.PaginatedOperationMethod<
216
216
  }));
217
217
 
218
218
  export interface CreateStoreRequest {
219
- /** Path param: Account Identifier */
219
+ /** Account identifier */
220
220
  accountId: string;
221
- /** Body param: */
222
- body: { name: string }[];
221
+ /** The name of the store */
222
+ name: string;
223
223
  }
224
224
 
225
225
  export const CreateStoreRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
226
226
  accountId: Schema.String.pipe(T.HttpPath("account_id")),
227
- body: Schema.Array(
228
- Schema.Struct({
229
- name: Schema.String,
230
- }),
231
- ).pipe(T.HttpBody()),
227
+ name: Schema.String,
232
228
  }).pipe(
233
229
  T.Http({
234
230
  method: "POST",
@@ -237,38 +233,39 @@ export const CreateStoreRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
237
233
  ) as unknown as Schema.Schema<CreateStoreRequest>;
238
234
 
239
235
  export interface CreateStoreResponse {
240
- result: { id: string; created: string; modified: string; name: string }[];
236
+ /** Store identifier */
237
+ id: string;
238
+ /** When the store was created */
239
+ created: string;
240
+ /** When the store was modified */
241
+ modified: string;
242
+ /** The name of the store */
243
+ name: string;
241
244
  }
242
245
 
243
246
  export const CreateStoreResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
244
- result: Schema.Array(
245
- Schema.Struct({
246
- id: Schema.String,
247
- created: Schema.String,
248
- modified: Schema.String,
249
- name: Schema.String,
250
- }),
251
- ),
252
- }) as unknown as Schema.Schema<CreateStoreResponse>;
247
+ id: Schema.String,
248
+ created: Schema.String,
249
+ modified: Schema.String,
250
+ name: Schema.String,
251
+ }).pipe(
252
+ T.ResponsePath("result"),
253
+ ) as unknown as Schema.Schema<CreateStoreResponse>;
253
254
 
254
255
  export type CreateStoreError =
255
256
  | DefaultErrors
256
257
  | InvalidAccountId
257
258
  | MaximumStoresExceeded;
258
259
 
259
- export const createStore: API.PaginatedOperationMethod<
260
+ export const createStore: API.OperationMethod<
260
261
  CreateStoreRequest,
261
262
  CreateStoreResponse,
262
263
  CreateStoreError,
263
264
  Credentials | HttpClient.HttpClient
264
- > = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
265
+ > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
265
266
  input: CreateStoreRequest,
266
267
  output: CreateStoreResponse,
267
268
  errors: [InvalidAccountId, MaximumStoresExceeded],
268
- pagination: {
269
- mode: "single",
270
- items: "result",
271
- } as const,
272
269
  }));
273
270
 
274
271
  export interface DeleteStoreRequest {
@@ -93,12 +93,6 @@ export class RouteNotFound extends Schema.TaggedErrorClass<RouteNotFound>()(
93
93
  ) {}
94
94
  T.applyErrorMatchers(RouteNotFound, [{ code: 10009 }]);
95
95
 
96
- export class ScriptStartupError extends Schema.TaggedErrorClass<ScriptStartupError>()(
97
- "ScriptStartupError",
98
- { code: Schema.Number, message: Schema.String },
99
- ) {}
100
- T.applyErrorMatchers(ScriptStartupError, [{ code: 10021 }]);
101
-
102
96
  export class ScriptModuleNotFound extends Schema.TaggedErrorClass<ScriptModuleNotFound>()(
103
97
  "ScriptModuleNotFound",
104
98
  { code: Schema.Number, message: Schema.String },
@@ -107,6 +101,12 @@ T.applyErrorMatchers(ScriptModuleNotFound, [
107
101
  { code: 10021, message: { includes: "No such module" } },
108
102
  ]);
109
103
 
104
+ export class ScriptStartupError extends Schema.TaggedErrorClass<ScriptStartupError>()(
105
+ "ScriptStartupError",
106
+ { code: Schema.Number, message: Schema.String },
107
+ ) {}
108
+ T.applyErrorMatchers(ScriptStartupError, [{ code: 10021 }]);
109
+
110
110
  export class SecretNotFound extends Schema.TaggedErrorClass<SecretNotFound>()(
111
111
  "SecretNotFound",
112
112
  { code: Schema.Number, message: Schema.String },