@beyondplusmm/doehpos-sdk 0.1.0 → 0.2.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/CHANGELOG.md CHANGED
@@ -4,6 +4,18 @@ All notable changes to `@beyondplusmm/doehpos-sdk` are documented here. This pro
4
4
  [Semantic Versioning](https://semver.org/). The stable surface is `delivery`;
5
5
  `@experimental` modules may change in a minor release until they graduate.
6
6
 
7
+ ## 0.2.0
8
+
9
+ ### Changed
10
+
11
+ - **kitchen** and **loyalty** graduated from `@experimental` to **stable** — now
12
+ exercised end to end by the Expo reference app (`apps/expo-reference`). Their
13
+ module files moved from `modules/experimental/` to `modules/`; the public
14
+ import surface (`import { KitchenModule, LoyaltyModule } from "@beyondplusmm/doehpos-sdk"`)
15
+ is unchanged.
16
+ - `marketplace` and `rider` remain `@experimental` until exercised by the
17
+ reference app.
18
+
7
19
  ## 0.1.0
8
20
 
9
21
  Initial release — a typed port of the validated golden client.
package/README.md CHANGED
@@ -5,6 +5,22 @@ validated [golden client](../../README.md#provenance) — the SDK exists so the
5
5
  public integration surface can never drift from the contract that was proven
6
6
  live (14/14) against the sandbox.
7
7
 
8
+ ## Install
9
+
10
+ ```bash
11
+ npm install @beyondplusmm/doehpos-sdk
12
+ # or
13
+ pnpm add @beyondplusmm/doehpos-sdk
14
+ # or
15
+ yarn add @beyondplusmm/doehpos-sdk
16
+ ```
17
+
18
+ - **npm:** https://www.npmjs.com/package/@beyondplusmm/doehpos-sdk
19
+ - **GitHub:** https://github.com/beyondplusmyanmar-lab/doeh-sdk
20
+ - Download the raw tarball: `npm pack @beyondplusmm/doehpos-sdk`
21
+
22
+ ## Usage
23
+
8
24
  ```ts
9
25
  import { DoehClient } from "@beyondplusmm/doehpos-sdk";
10
26
 
@@ -53,9 +69,10 @@ const result = await queue.flush(); // reuses the same key — exactly one order
53
69
 
54
70
  ## Stability
55
71
 
56
- `delivery` is the **stable** surface. `kitchen`, `loyalty`, `marketplace`, and
57
- `rider` are **`@experimental`** generated from their OpenAPI specs and the
58
- golden client, but not yet exercised by the reference app. They graduate
72
+ `delivery`, `kitchen`, and `loyalty` are the **stable** surface all exercised
73
+ by the Expo reference app (`kitchen`/`loyalty` graduated in 0.2.0). `marketplace`
74
+ and `rider` remain **`@experimental`** generated from their OpenAPI specs and
75
+ the golden client, but not yet exercised by the reference app. Modules graduate
59
76
  experimental → reference-app-exercised → stable. Evidence promotes an API;
60
77
  a schema only permits it.
61
78
 
package/dist/client.d.ts CHANGED
@@ -12,8 +12,8 @@
12
12
  import { type Environment } from "./config.js";
13
13
  import { Transport, type FetchLike } from "./transport.js";
14
14
  import { DeliveryModule } from "./modules/delivery.js";
15
- import { KitchenModule } from "./modules/experimental/kitchen.js";
16
- import { LoyaltyModule } from "./modules/experimental/loyalty.js";
15
+ import { KitchenModule } from "./modules/kitchen.js";
16
+ import { LoyaltyModule } from "./modules/loyalty.js";
17
17
  import { MarketplaceModule } from "./modules/experimental/marketplace.js";
18
18
  import { RiderModule } from "./modules/experimental/rider.js";
19
19
  export interface DoehClientOptions {
@@ -37,9 +37,9 @@ export interface DoehClientOptions {
37
37
  }
38
38
  export declare class DoehClient {
39
39
  readonly delivery: DeliveryModule;
40
- /** @experimental Not yet exercised by the reference app. */
40
+ /** Stable since 0.2.0 (reference-app exercised). */
41
41
  readonly kitchen: KitchenModule;
42
- /** @experimental Not yet exercised by the reference app. */
42
+ /** Stable since 0.2.0 (reference-app exercised). */
43
43
  readonly loyalty: LoyaltyModule;
44
44
  /** @experimental Not yet exercised by the reference app. */
45
45
  readonly marketplace: MarketplaceModule;
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAoC,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AACjF,OAAO,EAAE,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC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ACF"}
package/dist/client.js CHANGED
@@ -12,8 +12,8 @@
12
12
  import { BASE_URLS, DEFAULTS, SDK_VERSION } from "./config.js";
13
13
  import { Transport } from "./transport.js";
14
14
  import { DeliveryModule } from "./modules/delivery.js";
15
- import { KitchenModule } from "./modules/experimental/kitchen.js";
16
- import { LoyaltyModule } from "./modules/experimental/loyalty.js";
15
+ import { KitchenModule } from "./modules/kitchen.js";
16
+ import { LoyaltyModule } from "./modules/loyalty.js";
17
17
  import { MarketplaceModule } from "./modules/experimental/marketplace.js";
18
18
  import { RiderModule } from "./modules/experimental/rider.js";
19
19
  export class DoehClient {
@@ -1 +1 @@
1
- {"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,WAAW,EAAoB,MAAM,aAAa,CAAC;AACjF,OAAO,EAAE,SAAS,EAAkB,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAC1E,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAsB9D,MAAM,OAAO,UAAU;IAcrB,YAAY,IAAuB;QACjC,IAAI,CAAC,IAAI,CAAC,MAAM;YAAE,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC;QACnE,MAAM,GAAG,GAAG,IAAI,CAAC,WAAW,IAAI,SAAS,CAAC;QAC1C,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,IAAI,SAAS,CAAC,GAAG,CAAC,CAAC;QAC/C,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS;YAC9B,CAAC,CAAC,GAAG,IAAI,CAAC,SAAS,aAAa,WAA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AC,aAAa;YACrC,KAAK,EAAE,IAAI,CAAC,KAAK;SAClB,CAAC,CAAC;QAEH,IAAI,CAAC,QAAQ,GAAG,IAAI,cAAc,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACnD,IAAI,CAAC,OAAO,GAAG,IAAI,aAAa,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACjD,IAAI,CAAC,OAAO,GAAG,IAAI,aAAa,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACjD,IAAI,CAAC,WAAW,GAAG,IAAI,iBAAiB,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACzD,IAAI,CAAC,KAAK,GAAG,IAAI,WAAW,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAC/C,CAAC;IAED,8EAA8E;IAC9E,IAAI,UAAU;QACZ,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;CACF"}
package/dist/index.d.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  /**
2
2
  * @beyondplusmm/doehpos-sdk — official TypeScript SDK for the Doeh POS public API.
3
3
  *
4
- * A typed port of the validated golden client. The stable surface is `delivery`;
5
- * kitchen/loyalty/marketplace/rider are @experimental until exercised by the
6
- * reference app.
4
+ * A typed port of the validated golden client. The stable surface is `delivery`,
5
+ * `kitchen`, and `loyalty` (all reference-app exercised); `marketplace`/`rider`
6
+ * remain @experimental until exercised by the reference app.
7
7
  */
8
8
  export { DoehClient } from "./client.js";
9
9
  export type { DoehClientOptions } from "./client.js";
@@ -13,8 +13,8 @@ export { OfflineQueue, MemoryStorage, type QueueStorage, type QueuedMutation, ty
13
13
  export type { Currency, OrderStatus, OrderCreate, Order, OrderResponse, ErrorBody, CallOptions, } from "./types.js";
14
14
  export { DoehError, DoehTransportError, DoehApiError, ApiKeyInvalidError, ApiKeyExpiredError, ApiKeyRevokedError, EnvMismatchError, ScopeDeniedError, TransportDisabledError, OrderNotFoundError, ReplayError, InvalidAmountError, UnsupportedCurrencyError, BadBodyError, RateLimitedError, isRetryable, mapApiError, } from "./errors.js";
15
15
  export { DeliveryModule } from "./modules/delivery.js";
16
- export { KitchenModule, type TicketCreate, type TicketResponse } from "./modules/experimental/kitchen.js";
17
- export { LoyaltyModule, type EarnInput, type AccountResponse } from "./modules/experimental/loyalty.js";
16
+ export { KitchenModule, type TicketCreate, type TicketResponse } from "./modules/kitchen.js";
17
+ export { LoyaltyModule, type EarnInput, type AccountResponse } from "./modules/loyalty.js";
18
18
  export { MarketplaceModule, type ListingCreate, type ListingResponse, } from "./modules/experimental/marketplace.js";
19
19
  export { RiderModule, type JobCreate, type JobResponse } from "./modules/experimental/rider.js";
20
20
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,YAAY,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAErD,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AAEvE,OAAO,EAAE,sBAAsB,EAAE,KAAK,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAEvE,OAAO,EACL,YAAY,EACZ,aAAa,EACb,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,UAAU,EACf,KAAK,WAAW,GACjB,MAAM,YAAY,CAAC;AAEpB,YAAY,EACV,QAAQ,EACR,WAAW,EACX,WAAW,EACX,KAAK,EACL,aAAa,EACb,SAAS,EACT,WAAW,GACZ,MAAM,YAAY,CAAC;AAGpB,OAAO,EACL,SAAS,EACT,kBAAkB,EAClB,YAAY,EACZ,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,gBAAgB,EAChB,gBAAgB,EAChB,sBAAsB,EACtB,kBAAkB,EAClB,WAAW,EACX,kBAAkB,EAClB,wBAAwB,EACxB,YAAY,EACZ,gBAAgB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Z,gBAAgB,EAChB,WAAW,EACX,WAAW,GACZ,MAAM,aAAa,CAAC;AAGrB,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,KAAK,YAAY,EAAE,KAAK,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC7F,OAAO,EAAE,aAAa,EAAE,KAAK,SAAS,EAAE,KAAK,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC3F,OAAO,EACL,iBAAiB,EACjB,KAAK,aAAa,EAClB,KAAK,eAAe,GACrB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,KAAK,SAAS,EAAE,KAAK,WAAW,EAAE,MAAM,iCAAiC,CAAC"}
package/dist/index.js CHANGED
@@ -1,9 +1,9 @@
1
1
  /**
2
2
  * @beyondplusmm/doehpos-sdk — official TypeScript SDK for the Doeh POS public API.
3
3
  *
4
- * A typed port of the validated golden client. The stable surface is `delivery`;
5
- * kitchen/loyalty/marketplace/rider are @experimental until exercised by the
6
- * reference app.
4
+ * A typed port of the validated golden client. The stable surface is `delivery`,
5
+ * `kitchen`, and `loyalty` (all reference-app exercised); `marketplace`/`rider`
6
+ * remain @experimental until exercised by the reference app.
7
7
  */
8
8
  export { DoehClient } from "./client.js";
9
9
  export { BASE_URLS, SDK_VERSION } from "./config.js";
@@ -13,8 +13,8 @@ export { OfflineQueue, MemoryStorage, } from "./queue.js";
13
13
  export { DoehError, DoehTransportError, DoehApiError, ApiKeyInvalidError, ApiKeyExpiredError, ApiKeyRevokedError, EnvMismatchError, ScopeDeniedError, TransportDisabledError, OrderNotFoundError, ReplayError, InvalidAmountError, UnsupportedCurrencyError, BadBodyError, RateLimitedError, isRetryable, mapApiError, } from "./errors.js";
14
14
  // Module classes + their types (handy for typing app code).
15
15
  export { DeliveryModule } from "./modules/delivery.js";
16
- export { KitchenModule } from "./modules/experimental/kitchen.js";
17
- export { LoyaltyModule } from "./modules/experimental/loyalty.js";
16
+ export { KitchenModule } from "./modules/kitchen.js";
17
+ export { LoyaltyModule } from "./modules/loyalty.js";
18
18
  export { MarketplaceModule, } from "./modules/experimental/marketplace.js";
19
19
  export { RiderModule } from "./modules/experimental/rider.js";
20
20
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAGzC,OAAO,EAAE,SAAS,EAAE,WAAW,EAAoB,MAAM,aAAa,CAAC;AAEvE,OAAO,EAAE,sBAAsB,EAAe,MAAM,kBAAkB,CAAC;AAEvE,OAAO,EACL,YAAY,EACZ,aAAa,GAKd,MAAM,YAAY,CAAC;AAYpB,yEAAyE;AACzE,OAAO,EACL,SAAS,EACT,kBAAkB,EAClB,YAAY,EACZ,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,gBAAgB,EAChB,gBAAgB,EAChB,sBAAsB,EACtB,kBAAkB,EAClB,WAAW,EACX,kBAAkB,EAClB,wBAAwB,EACxB,YAAY,EACZ,gBAAgB,EAChB,WAAW,EACX,WAAW,GACZ,MAAM,aAAa,CAAC;AAErB,4DAA4D;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,aAAa,EAA0C,MAAM,mCAAmC,CAAC;AAC1G,OAAO,EAAE,aAAa,EAAwC,MAAM,mCAAmC,CAAC;AACxG,OAAO,EACL,iBAAiB,GAGlB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAoC,MAAM,iCAAiC,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAGzC,OAAO,EAAE,SAAS,EAAE,WAAW,EAAoB,MAAM,aAAa,CAAC;AAEvE,OAAO,EAAE,sBAAsB,EAAe,MAAM,kBAAkB,CAAC;AAEvE,OAAO,EACL,YAAY,EACZ,aAAa,GAKd,MAAM,YAAY,CAAC;AAYpB,yEAAyE;AACzE,OAAO,EACL,SAAS,EACT,kBAAkB,EAClB,YAAY,EACZ,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,gBAAgB,EAChB,gBAAgB,EAChB,sBAAsB,EACtB,kBAAkB,EAClB,WAAW,EACX,kBAAkB,EAClB,wBAAwB,EACxB,YAAY,EACZ,gBAAgB,EAChB,WAAW,EACX,WAAW,GACZ,MAAM,aAAa,CAAC;AAErB,4DAA4D;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,aAAa,EAA0C,MAAM,sBAAsB,CAAC;AAC7F,OAAO,EAAE,aAAa,EAAwC,MAAM,sBAAsB,CAAC;AAC3F,OAAO,EACL,iBAAiB,GAGlB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAoC,MAAM,iCAAiC,CAAC"}
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Kitchen — stable.
3
+ *
4
+ * POST /v1/kitchen/tickets create a ticket (idempotent with an Idempotency-Key)
5
+ * GET /v1/kitchen/tickets/{id} read back
6
+ *
7
+ * Scope is derived from the key server-side; there is no shop/branch argument.
8
+ * Graduated from @experimental in 0.2.0 once exercised by the Expo reference app.
9
+ */
10
+ import type { Transport } from "../transport.js";
11
+ import type { CallOptions } from "../types.js";
12
+ export interface TicketCreate {
13
+ station: string;
14
+ items: string[];
15
+ }
16
+ export interface TicketResponse {
17
+ ok: boolean;
18
+ idempotent?: boolean;
19
+ ticket: {
20
+ id: string;
21
+ [k: string]: unknown;
22
+ };
23
+ }
24
+ export declare class KitchenModule {
25
+ private readonly transport;
26
+ constructor(transport: Transport);
27
+ /** Create a kitchen ticket. Idempotent with an Idempotency-Key. */
28
+ createTicket(input: TicketCreate, opts?: CallOptions): Promise<TicketResponse>;
29
+ /** Read a kitchen ticket back by id. */
30
+ getTicket(id: string, opts?: CallOptions): Promise<TicketResponse>;
31
+ }
32
+ //# sourceMappingURL=kitchen.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"kitchen.d.ts","sourceRoot":"","sources":["../../src/modules/kitchen.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAG/C,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB;AACD,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,OAAO,CAAC;IACZ,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,MAAM,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAC;CAC9C;AAID,qBAAa,aAAa;IACZ,OAAO,CAAC,QAAQ,CAAC,SAAS;gBAAT,SAAS,EAAE,SAAS;IAEjD,mEAAmE;IAC7D,YAAY,CAAC,KAAK,EAAE,YAAY,EAAE,IAAI,GAAE,WAAgB,GAAG,OAAO,CAAC,cAAc,CAAC;IAYxF,wCAAwC;IAClC,SAAS,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,GAAE,WAAgB,GAAG,OAAO,CAAC,cAAc,CAAC;CAU7E"}
@@ -1,10 +1,10 @@
1
- import { generateIdempotencyKey } from "../../idempotency.js";
1
+ import { generateIdempotencyKey } from "../idempotency.js";
2
2
  const PATH_ID = /^[A-Za-z0-9_]+$/;
3
3
  export class KitchenModule {
4
4
  constructor(transport) {
5
5
  this.transport = transport;
6
6
  }
7
- /** @experimental */
7
+ /** Create a kitchen ticket. Idempotent with an Idempotency-Key. */
8
8
  async createTicket(input, opts = {}) {
9
9
  const { body } = await this.transport.request({
10
10
  method: "POST",
@@ -16,7 +16,7 @@ export class KitchenModule {
16
16
  });
17
17
  return body;
18
18
  }
19
- /** @experimental */
19
+ /** Read a kitchen ticket back by id. */
20
20
  async getTicket(id, opts = {}) {
21
21
  if (!PATH_ID.test(id))
22
22
  throw new RangeError(`invalid ticket id ${JSON.stringify(id)}`);
@@ -0,0 +1 @@
1
+ {"version":3,"file":"kitchen.js","sourceRoot":"","sources":["../../src/modules/kitchen.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAY3D,MAAM,OAAO,GAAG,iBAAiB,CAAC;AAElC,MAAM,OAAO,aAAa;IACxB,YAA6B,SAAoB;QAApB,cAAS,GAAT,SAAS,CAAW;IAAG,CAAC;IAErD,mEAAmE;IACnE,KAAK,CAAC,YAAY,CAAC,KAAmB,EAAE,OAAoB,EAAE;QAC5D,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,OAAO,CAAiB;YAC5D,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,qBAAqB;YAC3B,IAAI,EAAE,KAAK;YACX,cAAc,EAAE,IAAI,CAAC,cAAc,IAAI,sBAAsB,CAAC,SAAS,CAAC;YACxE,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,MAAM,EAAE,IAAI,CAAC,MAAM;SACpB,CAAC,CAAC;QACH,OAAO,IAAI,CAAC;IACd,CAAC;IAED,wCAAwC;IACxC,KAAK,CAAC,SAAS,CAAC,EAAU,EAAE,OAAoB,EAAE;QAChD,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;YAAE,MAAM,IAAI,UAAU,CAAC,qBAAqB,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;QACvF,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,OAAO,CAAiB;YAC5D,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,uBAAuB,EAAE,EAAE;YACjC,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,MAAM,EAAE,IAAI,CAAC,MAAM;SACpB,CAAC,CAAC;QACH,OAAO,IAAI,CAAC;IACd,CAAC;CACF"}
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Loyalty — stable.
3
+ *
4
+ * POST /v1/loyalty/members/{id}/earn award points (auto-provisions the member)
5
+ * GET /v1/loyalty/members/{id} read the member's balance
6
+ *
7
+ * `earn` auto-provisions the member account. Member ids must match [A-Za-z0-9_]+
8
+ * (no hyphens). Graduated from @experimental in 0.2.0 once exercised by the Expo
9
+ * reference app.
10
+ */
11
+ import type { Transport } from "../transport.js";
12
+ import type { CallOptions } from "../types.js";
13
+ export interface EarnInput {
14
+ points: number;
15
+ reason?: string;
16
+ }
17
+ export interface AccountResponse {
18
+ ok: boolean;
19
+ idempotent?: boolean;
20
+ account: {
21
+ balance: number;
22
+ [k: string]: unknown;
23
+ };
24
+ }
25
+ export declare class LoyaltyModule {
26
+ private readonly transport;
27
+ constructor(transport: Transport);
28
+ /** Award points to a member (auto-provisions the account). Idempotent with an Idempotency-Key. */
29
+ earn(memberId: string, input: EarnInput, opts?: CallOptions): Promise<AccountResponse>;
30
+ /** Read a member's balance back by id. */
31
+ getMember(memberId: string, opts?: CallOptions): Promise<AccountResponse>;
32
+ }
33
+ //# sourceMappingURL=loyalty.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loyalty.d.ts","sourceRoot":"","sources":["../../src/modules/loyalty.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAG/C,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AACD,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,OAAO,CAAC;IACZ,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,OAAO,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAC;CACpD;AAID,qBAAa,aAAa;IACZ,OAAO,CAAC,QAAQ,CAAC,SAAS;gBAAT,SAAS,EAAE,SAAS;IAEjD,kGAAkG;IAC5F,IAAI,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,GAAE,WAAgB,GAAG,OAAO,CAAC,eAAe,CAAC;IAahG,0CAA0C;IACpC,SAAS,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,GAAE,WAAgB,GAAG,OAAO,CAAC,eAAe,CAAC;CAUpF"}
@@ -1,10 +1,10 @@
1
- import { generateIdempotencyKey } from "../../idempotency.js";
1
+ import { generateIdempotencyKey } from "../idempotency.js";
2
2
  const MEMBER_ID = /^[A-Za-z0-9_]+$/;
3
3
  export class LoyaltyModule {
4
4
  constructor(transport) {
5
5
  this.transport = transport;
6
6
  }
7
- /** @experimental */
7
+ /** Award points to a member (auto-provisions the account). Idempotent with an Idempotency-Key. */
8
8
  async earn(memberId, input, opts = {}) {
9
9
  if (!MEMBER_ID.test(memberId))
10
10
  throw new RangeError(`invalid member id ${JSON.stringify(memberId)}`);
@@ -18,7 +18,7 @@ export class LoyaltyModule {
18
18
  });
19
19
  return body;
20
20
  }
21
- /** @experimental */
21
+ /** Read a member's balance back by id. */
22
22
  async getMember(memberId, opts = {}) {
23
23
  if (!MEMBER_ID.test(memberId))
24
24
  throw new RangeError(`invalid member id ${JSON.stringify(memberId)}`);
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loyalty.js","sourceRoot":"","sources":["../../src/modules/loyalty.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAY3D,MAAM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@@
1
1
  {
2
2
  "name": "@beyondplusmm/doehpos-sdk",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "Official TypeScript SDK for the Doeh POS public API — a typed port of the validated golden client.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -21,8 +21,9 @@
21
21
  ],
22
22
  "sideEffects": false,
23
23
  "scripts": {
24
- "build": "tsc -p tsconfig.json",
25
- "prepack": "tsc -p tsconfig.json",
24
+ "clean": "rm -rf dist",
25
+ "build": "rm -rf dist && tsc -p tsconfig.json",
26
+ "prepack": "rm -rf dist && tsc -p tsconfig.json",
26
27
  "test": "pnpm build && node --test test/",
27
28
  "test:integration": "pnpm build && node test/golden.integration.mjs"
28
29
  },
package/src/client.ts CHANGED
@@ -12,8 +12,8 @@
12
12
  import { BASE_URLS, DEFAULTS, SDK_VERSION, type Environment } from "./config.js";
13
13
  import { Transport, type FetchLike } from "./transport.js";
14
14
  import { DeliveryModule } from "./modules/delivery.js";
15
- import { KitchenModule } from "./modules/experimental/kitchen.js";
16
- import { LoyaltyModule } from "./modules/experimental/loyalty.js";
15
+ import { KitchenModule } from "./modules/kitchen.js";
16
+ import { LoyaltyModule } from "./modules/loyalty.js";
17
17
  import { MarketplaceModule } from "./modules/experimental/marketplace.js";
18
18
  import { RiderModule } from "./modules/experimental/rider.js";
19
19
 
@@ -39,11 +39,11 @@ export interface DoehClientOptions {
39
39
 
40
40
  export class DoehClient {
41
41
  readonly delivery: DeliveryModule;
42
-
43
- /** @experimental Not yet exercised by the reference app. */
42
+ /** Stable since 0.2.0 (reference-app exercised). */
44
43
  readonly kitchen: KitchenModule;
45
- /** @experimental Not yet exercised by the reference app. */
44
+ /** Stable since 0.2.0 (reference-app exercised). */
46
45
  readonly loyalty: LoyaltyModule;
46
+
47
47
  /** @experimental Not yet exercised by the reference app. */
48
48
  readonly marketplace: MarketplaceModule;
49
49
  /** @experimental Not yet exercised by the reference app. */
package/src/index.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  /**
2
2
  * @beyondplusmm/doehpos-sdk — official TypeScript SDK for the Doeh POS public API.
3
3
  *
4
- * A typed port of the validated golden client. The stable surface is `delivery`;
5
- * kitchen/loyalty/marketplace/rider are @experimental until exercised by the
6
- * reference app.
4
+ * A typed port of the validated golden client. The stable surface is `delivery`,
5
+ * `kitchen`, and `loyalty` (all reference-app exercised); `marketplace`/`rider`
6
+ * remain @experimental until exercised by the reference app.
7
7
  */
8
8
  export { DoehClient } from "./client.js";
9
9
  export type { DoehClientOptions } from "./client.js";
@@ -54,8 +54,8 @@ export {
54
54
 
55
55
  // Module classes + their types (handy for typing app code).
56
56
  export { DeliveryModule } from "./modules/delivery.js";
57
- export { KitchenModule, type TicketCreate, type TicketResponse } from "./modules/experimental/kitchen.js";
58
- export { LoyaltyModule, type EarnInput, type AccountResponse } from "./modules/experimental/loyalty.js";
57
+ export { KitchenModule, type TicketCreate, type TicketResponse } from "./modules/kitchen.js";
58
+ export { LoyaltyModule, type EarnInput, type AccountResponse } from "./modules/loyalty.js";
59
59
  export {
60
60
  MarketplaceModule,
61
61
  type ListingCreate,
@@ -1,13 +1,15 @@
1
1
  /**
2
- * Kitchen — EXPERIMENTAL.
2
+ * Kitchen — stable.
3
3
  *
4
- * @experimental Schema/golden-client-derived; not yet exercised by the Expo
5
- * reference app. Shapes may change before they graduate to the stable contract.
6
- * Promotion rule: experimental -> reference-app exercised -> stable.
4
+ * POST /v1/kitchen/tickets create a ticket (idempotent with an Idempotency-Key)
5
+ * GET /v1/kitchen/tickets/{id} read back
6
+ *
7
+ * Scope is derived from the key server-side; there is no shop/branch argument.
8
+ * Graduated from @experimental in 0.2.0 once exercised by the Expo reference app.
7
9
  */
8
- import type { Transport } from "../../transport.js";
9
- import type { CallOptions } from "../../types.js";
10
- import { generateIdempotencyKey } from "../../idempotency.js";
10
+ import type { Transport } from "../transport.js";
11
+ import type { CallOptions } from "../types.js";
12
+ import { generateIdempotencyKey } from "../idempotency.js";
11
13
 
12
14
  export interface TicketCreate {
13
15
  station: string;
@@ -24,7 +26,7 @@ const PATH_ID = /^[A-Za-z0-9_]+$/;
24
26
  export class KitchenModule {
25
27
  constructor(private readonly transport: Transport) {}
26
28
 
27
- /** @experimental */
29
+ /** Create a kitchen ticket. Idempotent with an Idempotency-Key. */
28
30
  async createTicket(input: TicketCreate, opts: CallOptions = {}): Promise<TicketResponse> {
29
31
  const { body } = await this.transport.request<TicketResponse>({
30
32
  method: "POST",
@@ -37,7 +39,7 @@ export class KitchenModule {
37
39
  return body;
38
40
  }
39
41
 
40
- /** @experimental */
42
+ /** Read a kitchen ticket back by id. */
41
43
  async getTicket(id: string, opts: CallOptions = {}): Promise<TicketResponse> {
42
44
  if (!PATH_ID.test(id)) throw new RangeError(`invalid ticket id ${JSON.stringify(id)}`);
43
45
  const { body } = await this.transport.request<TicketResponse>({
@@ -1,13 +1,16 @@
1
1
  /**
2
- * Loyalty — EXPERIMENTAL.
2
+ * Loyalty — stable.
3
3
  *
4
- * @experimental Schema/golden-client-derived; not yet exercised by the Expo
5
- * reference app. `earn` auto-provisions the member account. Member ids must
6
- * match [A-Za-z0-9_]+ (no hyphens).
4
+ * POST /v1/loyalty/members/{id}/earn award points (auto-provisions the member)
5
+ * GET /v1/loyalty/members/{id} read the member's balance
6
+ *
7
+ * `earn` auto-provisions the member account. Member ids must match [A-Za-z0-9_]+
8
+ * (no hyphens). Graduated from @experimental in 0.2.0 once exercised by the Expo
9
+ * reference app.
7
10
  */
8
- import type { Transport } from "../../transport.js";
9
- import type { CallOptions } from "../../types.js";
10
- import { generateIdempotencyKey } from "../../idempotency.js";
11
+ import type { Transport } from "../transport.js";
12
+ import type { CallOptions } from "../types.js";
13
+ import { generateIdempotencyKey } from "../idempotency.js";
11
14
 
12
15
  export interface EarnInput {
13
16
  points: number;
@@ -24,7 +27,7 @@ const MEMBER_ID = /^[A-Za-z0-9_]+$/;
24
27
  export class LoyaltyModule {
25
28
  constructor(private readonly transport: Transport) {}
26
29
 
27
- /** @experimental */
30
+ /** Award points to a member (auto-provisions the account). Idempotent with an Idempotency-Key. */
28
31
  async earn(memberId: string, input: EarnInput, opts: CallOptions = {}): Promise<AccountResponse> {
29
32
  if (!MEMBER_ID.test(memberId)) throw new RangeError(`invalid member id ${JSON.stringify(memberId)}`);
30
33
  const { body } = await this.transport.request<AccountResponse>({
@@ -38,7 +41,7 @@ export class LoyaltyModule {
38
41
  return body;
39
42
  }
40
43
 
41
- /** @experimental */
44
+ /** Read a member's balance back by id. */
42
45
  async getMember(memberId: string, opts: CallOptions = {}): Promise<AccountResponse> {
43
46
  if (!MEMBER_ID.test(memberId)) throw new RangeError(`invalid member id ${JSON.stringify(memberId)}`);
44
47
  const { body } = await this.transport.request<AccountResponse>({
@@ -1,30 +0,0 @@
1
- /**
2
- * Kitchen — EXPERIMENTAL.
3
- *
4
- * @experimental Schema/golden-client-derived; not yet exercised by the Expo
5
- * reference app. Shapes may change before they graduate to the stable contract.
6
- * Promotion rule: experimental -> reference-app exercised -> stable.
7
- */
8
- import type { Transport } from "../../transport.js";
9
- import type { CallOptions } from "../../types.js";
10
- export interface TicketCreate {
11
- station: string;
12
- items: string[];
13
- }
14
- export interface TicketResponse {
15
- ok: boolean;
16
- idempotent?: boolean;
17
- ticket: {
18
- id: string;
19
- [k: string]: unknown;
20
- };
21
- }
22
- export declare class KitchenModule {
23
- private readonly transport;
24
- constructor(transport: Transport);
25
- /** @experimental */
26
- createTicket(input: TicketCreate, opts?: CallOptions): Promise<TicketResponse>;
27
- /** @experimental */
28
- getTicket(id: string, opts?: CallOptions): Promise<TicketResponse>;
29
- }
30
- //# sourceMappingURL=kitchen.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"kitchen.d.ts","sourceRoot":"","sources":["../../../src/modules/experimental/kitchen.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM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MAAM,EAAE,IAAI,CAAC,MAAM;SACpB,CAAC,CAAC;QACH,OAAO,IAAI,CAAC;IACd,CAAC;IAED,oBAAoB;IACpB,KAAK,CAAC,SAAS,CAAC,EAAU,EAAE,OAAoB,EAAE;QAChD,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;YAAE,MAAM,IAAI,UAAU,CAAC,qBAAqB,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;QACvF,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,OAAO,CAAiB;YAC5D,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,uBAAuB,EAAE,EAAE;YACjC,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,MAAM,EAAE,IAAI,CAAC,MAAM;SACpB,CAAC,CAAC;QACH,OAAO,IAAI,CAAC;IACd,CAAC;CACF"}
@@ -1,30 +0,0 @@
1
- /**
2
- * Loyalty — EXPERIMENTAL.
3
- *
4
- * @experimental Schema/golden-client-derived; not yet exercised by the Expo
5
- * reference app. `earn` auto-provisions the member account. Member ids must
6
- * match [A-Za-z0-9_]+ (no hyphens).
7
- */
8
- import type { Transport } from "../../transport.js";
9
- import type { CallOptions } from "../../types.js";
10
- export interface EarnInput {
11
- points: number;
12
- reason?: string;
13
- }
14
- export interface AccountResponse {
15
- ok: boolean;
16
- idempotent?: boolean;
17
- account: {
18
- balance: number;
19
- [k: string]: unknown;
20
- };
21
- }
22
- export declare class LoyaltyModule {
23
- private readonly transport;
24
- constructor(transport: Transport);
25
- /** @experimental */
26
- earn(memberId: string, input: EarnInput, opts?: CallOptions): Promise<AccountResponse>;
27
- /** @experimental */
28
- getMember(memberId: string, opts?: CallOptions): Promise<AccountResponse>;
29
- }
30
- //# sourceMappingURL=loyalty.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"loyalty.d.ts","sourceRoot":"","sources":["../../../src/modules/experimental/loyalty.ts"],"names":[],"m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