order3000 1.9.0 → 1.10.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/dist/client.cjs CHANGED
@@ -494,9 +494,47 @@ class AssetsResource extends BaseResource {
494
494
  if (options.type) {
495
495
  queryParams.set("type", options.type);
496
496
  }
497
+ return this.request("GET", `?${queryParams.toString()}`);
498
+ }
499
+ /**
500
+ * Permanently remove a venue asset by id — the storage object, the `assets`
501
+ * row, and every junction link (an `everywhere` delete). The venue-wide
502
+ * counterpart to deleting an asset from a single entity.
503
+ *
504
+ * Proxies the dual-mode `deleteAsset` server action via
505
+ * `DELETE /venues/{venueId}/assets/{assetId}`. The action also publishes
506
+ * `order3000.assets.updated`, so every open asset library for the venue
507
+ * updates live.
508
+ *
509
+ * @param assetId - The globally-unique asset id
510
+ * @returns `{ success, deleted }`
511
+ */
512
+ async delete(assetId) {
497
513
  return this.request(
498
- "GET",
499
- `?${queryParams.toString()}`
514
+ "DELETE",
515
+ `/${encodeURIComponent(assetId)}`
516
+ );
517
+ }
518
+ /**
519
+ * Edit a venue asset's metadata (tags / caption / alt / active flag / crop)
520
+ * by id. Only the supplied fields are written; per-locale `caption` / `alt`
521
+ * merge into the existing record rather than overwriting it.
522
+ *
523
+ * Proxies the dual-mode `editAsset` server action via
524
+ * `PATCH /venues/{venueId}/assets/{assetId}`. The action also publishes
525
+ * `order3000.assets.updated`, so every open asset library for the venue
526
+ * updates live — the grid refetches and any open EditAssetModal showing this
527
+ * asset re-seeds to reflect the edit.
528
+ *
529
+ * @param assetId - The globally-unique asset id
530
+ * @param input - The fields to change
531
+ * @returns The updated asset row
532
+ */
533
+ async update(assetId, input) {
534
+ return this.request(
535
+ "PATCH",
536
+ `/${encodeURIComponent(assetId)}`,
537
+ input
500
538
  );
501
539
  }
502
540
  }
package/dist/client.d.cts CHANGED
@@ -1826,12 +1826,14 @@ interface components {
1826
1826
  createdBy: string | null;
1827
1827
  updatedBy: string | null;
1828
1828
  venueId: string | null;
1829
+ contentHash: string | null;
1829
1830
  };
1830
1831
  publicUrl: string | null;
1831
1832
  };
1832
1833
  /** DeleteAssetResponse */
1833
1834
  DeleteAssetResponse: {
1834
1835
  success: boolean;
1836
+ deleted: boolean;
1835
1837
  };
1836
1838
  /**
1837
1839
  * FetchMenuResponse
@@ -2430,6 +2432,7 @@ interface components {
2430
2432
  createdBy: string | null;
2431
2433
  updatedBy: string | null;
2432
2434
  venueId: string | null;
2435
+ contentHash: string | null;
2433
2436
  publicUrl: string;
2434
2437
  }[];
2435
2438
  events: {
@@ -3713,6 +3716,32 @@ declare class ArticlesResource extends BaseResource {
3713
3716
  patchFeatureImage(idOrAccessor: string, body: PatchFeatureImageRequest): Promise<FeatureImage>;
3714
3717
  }
3715
3718
 
3719
+ /** Result of a venue-scoped asset delete (mirrors the action's response). */
3720
+ interface DeleteAssetResponse {
3721
+ success: boolean;
3722
+ /** Whether the file + row were removed (vs. just unlinked at one entity). */
3723
+ deleted: boolean;
3724
+ }
3725
+ /**
3726
+ * Editable fields on a venue asset (mirrors the `editAsset` action's input,
3727
+ * minus the path-supplied id + tenant accessor). All optional — only the
3728
+ * supplied fields are written. `caption` / `alt` are per-locale records (a flat
3729
+ * string or a TipTap doc per locale); the action normalises strings to TipTap.
3730
+ */
3731
+ interface UpdateAssetInput {
3732
+ tags?: string[];
3733
+ caption?: Record<string, string | Record<string, unknown>>;
3734
+ alt?: Record<string, string | Record<string, unknown>>;
3735
+ isActive?: boolean;
3736
+ cropArea?: {
3737
+ x: number;
3738
+ y: number;
3739
+ width: number;
3740
+ height: number;
3741
+ };
3742
+ }
3743
+ /** The updated asset row (`editAsset`'s response — the central `assets` row). */
3744
+ type UpdateAssetResponse = Asset;
3716
3745
  declare class AssetsResource extends BaseResource {
3717
3746
  constructor(tokenManager: TokenManager, baseUrl: string);
3718
3747
  /**
@@ -3727,6 +3756,36 @@ declare class AssetsResource extends BaseResource {
3727
3756
  * @returns Array of assets with public URLs
3728
3757
  */
3729
3758
  list(options: ListAssetsOptions): Promise<ListAssetsResponse>;
3759
+ /**
3760
+ * Permanently remove a venue asset by id — the storage object, the `assets`
3761
+ * row, and every junction link (an `everywhere` delete). The venue-wide
3762
+ * counterpart to deleting an asset from a single entity.
3763
+ *
3764
+ * Proxies the dual-mode `deleteAsset` server action via
3765
+ * `DELETE /venues/{venueId}/assets/{assetId}`. The action also publishes
3766
+ * `order3000.assets.updated`, so every open asset library for the venue
3767
+ * updates live.
3768
+ *
3769
+ * @param assetId - The globally-unique asset id
3770
+ * @returns `{ success, deleted }`
3771
+ */
3772
+ delete(assetId: string): Promise<DeleteAssetResponse>;
3773
+ /**
3774
+ * Edit a venue asset's metadata (tags / caption / alt / active flag / crop)
3775
+ * by id. Only the supplied fields are written; per-locale `caption` / `alt`
3776
+ * merge into the existing record rather than overwriting it.
3777
+ *
3778
+ * Proxies the dual-mode `editAsset` server action via
3779
+ * `PATCH /venues/{venueId}/assets/{assetId}`. The action also publishes
3780
+ * `order3000.assets.updated`, so every open asset library for the venue
3781
+ * updates live — the grid refetches and any open EditAssetModal showing this
3782
+ * asset re-seeds to reflect the edit.
3783
+ *
3784
+ * @param assetId - The globally-unique asset id
3785
+ * @param input - The fields to change
3786
+ * @returns The updated asset row
3787
+ */
3788
+ update(assetId: string, input: UpdateAssetInput): Promise<UpdateAssetResponse>;
3730
3789
  }
3731
3790
 
3732
3791
  declare class BasketsResource extends BaseResource {
package/dist/client.d.mts CHANGED
@@ -1826,12 +1826,14 @@ interface components {
1826
1826
  createdBy: string | null;
1827
1827
  updatedBy: string | null;
1828
1828
  venueId: string | null;
1829
+ contentHash: string | null;
1829
1830
  };
1830
1831
  publicUrl: string | null;
1831
1832
  };
1832
1833
  /** DeleteAssetResponse */
1833
1834
  DeleteAssetResponse: {
1834
1835
  success: boolean;
1836
+ deleted: boolean;
1835
1837
  };
1836
1838
  /**
1837
1839
  * FetchMenuResponse
@@ -2430,6 +2432,7 @@ interface components {
2430
2432
  createdBy: string | null;
2431
2433
  updatedBy: string | null;
2432
2434
  venueId: string | null;
2435
+ contentHash: string | null;
2433
2436
  publicUrl: string;
2434
2437
  }[];
2435
2438
  events: {
@@ -3713,6 +3716,32 @@ declare class ArticlesResource extends BaseResource {
3713
3716
  patchFeatureImage(idOrAccessor: string, body: PatchFeatureImageRequest): Promise<FeatureImage>;
3714
3717
  }
3715
3718
 
3719
+ /** Result of a venue-scoped asset delete (mirrors the action's response). */
3720
+ interface DeleteAssetResponse {
3721
+ success: boolean;
3722
+ /** Whether the file + row were removed (vs. just unlinked at one entity). */
3723
+ deleted: boolean;
3724
+ }
3725
+ /**
3726
+ * Editable fields on a venue asset (mirrors the `editAsset` action's input,
3727
+ * minus the path-supplied id + tenant accessor). All optional — only the
3728
+ * supplied fields are written. `caption` / `alt` are per-locale records (a flat
3729
+ * string or a TipTap doc per locale); the action normalises strings to TipTap.
3730
+ */
3731
+ interface UpdateAssetInput {
3732
+ tags?: string[];
3733
+ caption?: Record<string, string | Record<string, unknown>>;
3734
+ alt?: Record<string, string | Record<string, unknown>>;
3735
+ isActive?: boolean;
3736
+ cropArea?: {
3737
+ x: number;
3738
+ y: number;
3739
+ width: number;
3740
+ height: number;
3741
+ };
3742
+ }
3743
+ /** The updated asset row (`editAsset`'s response — the central `assets` row). */
3744
+ type UpdateAssetResponse = Asset;
3716
3745
  declare class AssetsResource extends BaseResource {
3717
3746
  constructor(tokenManager: TokenManager, baseUrl: string);
3718
3747
  /**
@@ -3727,6 +3756,36 @@ declare class AssetsResource extends BaseResource {
3727
3756
  * @returns Array of assets with public URLs
3728
3757
  */
3729
3758
  list(options: ListAssetsOptions): Promise<ListAssetsResponse>;
3759
+ /**
3760
+ * Permanently remove a venue asset by id — the storage object, the `assets`
3761
+ * row, and every junction link (an `everywhere` delete). The venue-wide
3762
+ * counterpart to deleting an asset from a single entity.
3763
+ *
3764
+ * Proxies the dual-mode `deleteAsset` server action via
3765
+ * `DELETE /venues/{venueId}/assets/{assetId}`. The action also publishes
3766
+ * `order3000.assets.updated`, so every open asset library for the venue
3767
+ * updates live.
3768
+ *
3769
+ * @param assetId - The globally-unique asset id
3770
+ * @returns `{ success, deleted }`
3771
+ */
3772
+ delete(assetId: string): Promise<DeleteAssetResponse>;
3773
+ /**
3774
+ * Edit a venue asset's metadata (tags / caption / alt / active flag / crop)
3775
+ * by id. Only the supplied fields are written; per-locale `caption` / `alt`
3776
+ * merge into the existing record rather than overwriting it.
3777
+ *
3778
+ * Proxies the dual-mode `editAsset` server action via
3779
+ * `PATCH /venues/{venueId}/assets/{assetId}`. The action also publishes
3780
+ * `order3000.assets.updated`, so every open asset library for the venue
3781
+ * updates live — the grid refetches and any open EditAssetModal showing this
3782
+ * asset re-seeds to reflect the edit.
3783
+ *
3784
+ * @param assetId - The globally-unique asset id
3785
+ * @param input - The fields to change
3786
+ * @returns The updated asset row
3787
+ */
3788
+ update(assetId: string, input: UpdateAssetInput): Promise<UpdateAssetResponse>;
3730
3789
  }
3731
3790
 
3732
3791
  declare class BasketsResource extends BaseResource {
package/dist/client.mjs CHANGED
@@ -493,9 +493,47 @@ class AssetsResource extends BaseResource {
493
493
  if (options.type) {
494
494
  queryParams.set("type", options.type);
495
495
  }
496
+ return this.request("GET", `?${queryParams.toString()}`);
497
+ }
498
+ /**
499
+ * Permanently remove a venue asset by id — the storage object, the `assets`
500
+ * row, and every junction link (an `everywhere` delete). The venue-wide
501
+ * counterpart to deleting an asset from a single entity.
502
+ *
503
+ * Proxies the dual-mode `deleteAsset` server action via
504
+ * `DELETE /venues/{venueId}/assets/{assetId}`. The action also publishes
505
+ * `order3000.assets.updated`, so every open asset library for the venue
506
+ * updates live.
507
+ *
508
+ * @param assetId - The globally-unique asset id
509
+ * @returns `{ success, deleted }`
510
+ */
511
+ async delete(assetId) {
496
512
  return this.request(
497
- "GET",
498
- `?${queryParams.toString()}`
513
+ "DELETE",
514
+ `/${encodeURIComponent(assetId)}`
515
+ );
516
+ }
517
+ /**
518
+ * Edit a venue asset's metadata (tags / caption / alt / active flag / crop)
519
+ * by id. Only the supplied fields are written; per-locale `caption` / `alt`
520
+ * merge into the existing record rather than overwriting it.
521
+ *
522
+ * Proxies the dual-mode `editAsset` server action via
523
+ * `PATCH /venues/{venueId}/assets/{assetId}`. The action also publishes
524
+ * `order3000.assets.updated`, so every open asset library for the venue
525
+ * updates live — the grid refetches and any open EditAssetModal showing this
526
+ * asset re-seeds to reflect the edit.
527
+ *
528
+ * @param assetId - The globally-unique asset id
529
+ * @param input - The fields to change
530
+ * @returns The updated asset row
531
+ */
532
+ async update(assetId, input) {
533
+ return this.request(
534
+ "PATCH",
535
+ `/${encodeURIComponent(assetId)}`,
536
+ input
499
537
  );
500
538
  }
501
539
  }
package/dist/schemas.cjs CHANGED
@@ -1051,7 +1051,8 @@ const deleteAdResponseSchema = v4.z.object({
1051
1051
  });
1052
1052
 
1053
1053
  const deleteAssetResponseSchema = v4.z.object({
1054
- success: v4.z.boolean()
1054
+ success: v4.z.boolean(),
1055
+ deleted: v4.z.boolean()
1055
1056
  });
1056
1057
 
1057
1058
  const deleteCalloutResponseSchema = v4.z.object({
@@ -2925,6 +2926,7 @@ const fetchRitualResponseSchema = v4.z.object({
2925
2926
  createdBy: v4.z.nullable(v4.z.string()),
2926
2927
  updatedBy: v4.z.nullable(v4.z.string()),
2927
2928
  venueId: v4.z.nullable(v4.z.string()),
2929
+ contentHash: v4.z.nullable(v4.z.string()),
2928
2930
  publicUrl: v4.z.string()
2929
2931
  })
2930
2932
  ),
@@ -4247,7 +4249,8 @@ const uploadAssetResponseSchema = v4.z.object({
4247
4249
  updatedAt: v4.z.nullable(v4.z.any()),
4248
4250
  createdBy: v4.z.nullable(v4.z.string()),
4249
4251
  updatedBy: v4.z.nullable(v4.z.string()),
4250
- venueId: v4.z.nullable(v4.z.string())
4252
+ venueId: v4.z.nullable(v4.z.string()),
4253
+ contentHash: v4.z.nullable(v4.z.string())
4251
4254
  }),
4252
4255
  publicUrl: v4.z.nullable(v4.z.string())
4253
4256
  });
@@ -889,6 +889,7 @@ declare const schemas: {
889
889
  }, zod_v4_core.$strip>;
890
890
  readonly DeleteAssetResponse: zod.ZodObject<{
891
891
  success: zod.ZodBoolean;
892
+ deleted: zod.ZodBoolean;
892
893
  }, zod_v4_core.$strip>;
893
894
  readonly DeleteCalloutResponse: zod.ZodObject<{
894
895
  id: zod.ZodString;
@@ -2417,6 +2418,7 @@ declare const schemas: {
2417
2418
  createdBy: zod.ZodNullable<zod.ZodString>;
2418
2419
  updatedBy: zod.ZodNullable<zod.ZodString>;
2419
2420
  venueId: zod.ZodNullable<zod.ZodString>;
2421
+ contentHash: zod.ZodNullable<zod.ZodString>;
2420
2422
  publicUrl: zod.ZodString;
2421
2423
  }, zod_v4_core.$strip>>;
2422
2424
  events: zod.ZodArray<zod.ZodObject<{
@@ -3861,6 +3863,7 @@ declare const schemas: {
3861
3863
  createdBy: zod.ZodNullable<zod.ZodString>;
3862
3864
  updatedBy: zod.ZodNullable<zod.ZodString>;
3863
3865
  venueId: zod.ZodNullable<zod.ZodString>;
3866
+ contentHash: zod.ZodNullable<zod.ZodString>;
3864
3867
  }, zod_v4_core.$strip>;
3865
3868
  publicUrl: zod.ZodNullable<zod.ZodString>;
3866
3869
  }, zod_v4_core.$strip>;
@@ -889,6 +889,7 @@ declare const schemas: {
889
889
  }, zod_v4_core.$strip>;
890
890
  readonly DeleteAssetResponse: zod.ZodObject<{
891
891
  success: zod.ZodBoolean;
892
+ deleted: zod.ZodBoolean;
892
893
  }, zod_v4_core.$strip>;
893
894
  readonly DeleteCalloutResponse: zod.ZodObject<{
894
895
  id: zod.ZodString;
@@ -2417,6 +2418,7 @@ declare const schemas: {
2417
2418
  createdBy: zod.ZodNullable<zod.ZodString>;
2418
2419
  updatedBy: zod.ZodNullable<zod.ZodString>;
2419
2420
  venueId: zod.ZodNullable<zod.ZodString>;
2421
+ contentHash: zod.ZodNullable<zod.ZodString>;
2420
2422
  publicUrl: zod.ZodString;
2421
2423
  }, zod_v4_core.$strip>>;
2422
2424
  events: zod.ZodArray<zod.ZodObject<{
@@ -3861,6 +3863,7 @@ declare const schemas: {
3861
3863
  createdBy: zod.ZodNullable<zod.ZodString>;
3862
3864
  updatedBy: zod.ZodNullable<zod.ZodString>;
3863
3865
  venueId: zod.ZodNullable<zod.ZodString>;
3866
+ contentHash: zod.ZodNullable<zod.ZodString>;
3864
3867
  }, zod_v4_core.$strip>;
3865
3868
  publicUrl: zod.ZodNullable<zod.ZodString>;
3866
3869
  }, zod_v4_core.$strip>;
package/dist/schemas.mjs CHANGED
@@ -1049,7 +1049,8 @@ const deleteAdResponseSchema = z.object({
1049
1049
  });
1050
1050
 
1051
1051
  const deleteAssetResponseSchema = z.object({
1052
- success: z.boolean()
1052
+ success: z.boolean(),
1053
+ deleted: z.boolean()
1053
1054
  });
1054
1055
 
1055
1056
  const deleteCalloutResponseSchema = z.object({
@@ -2923,6 +2924,7 @@ const fetchRitualResponseSchema = z.object({
2923
2924
  createdBy: z.nullable(z.string()),
2924
2925
  updatedBy: z.nullable(z.string()),
2925
2926
  venueId: z.nullable(z.string()),
2927
+ contentHash: z.nullable(z.string()),
2926
2928
  publicUrl: z.string()
2927
2929
  })
2928
2930
  ),
@@ -4245,7 +4247,8 @@ const uploadAssetResponseSchema = z.object({
4245
4247
  updatedAt: z.nullable(z.any()),
4246
4248
  createdBy: z.nullable(z.string()),
4247
4249
  updatedBy: z.nullable(z.string()),
4248
- venueId: z.nullable(z.string())
4250
+ venueId: z.nullable(z.string()),
4251
+ contentHash: z.nullable(z.string())
4249
4252
  }),
4250
4253
  publicUrl: z.nullable(z.string())
4251
4254
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "order3000",
3
- "version": "1.9.0",
3
+ "version": "1.10.0",
4
4
  "description": "order3000 node.js sdk",
5
5
  "main": "./dist/client.cjs",
6
6
  "module": "./dist/client.mjs",
@@ -58,8 +58,8 @@
58
58
  "tsx": "^4.19.2",
59
59
  "typescript": "^5.9.3",
60
60
  "@kolaveri/eslint-config": "1.11.0",
61
- "@kolaveri/prettier-config": "1.0.6",
62
- "@kolaveri/tsconfig": "1.0.1"
61
+ "@kolaveri/tsconfig": "1.0.1",
62
+ "@kolaveri/prettier-config": "1.0.6"
63
63
  },
64
64
  "files": [
65
65
  "dist"