@compassdigital/sdk.typescript 4.988.0 → 4.989.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/lib/index.d.ts +8 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +9 -0
- package/lib/index.js.map +1 -1
- package/lib/interface/menu-intake.d.ts +22 -0
- package/lib/interface/menu-intake.d.ts.map +1 -0
- package/lib/interface/menu-intake.js +5 -0
- package/lib/interface/menu-intake.js.map +1 -0
- package/manifest.json +7 -0
- package/package.json +2 -2
- package/src/index.ts +22 -0
- package/src/interface/menu-intake.ts +40 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export interface StockEvent {
|
|
2
|
+
specversion: '1.0';
|
|
3
|
+
id: string;
|
|
4
|
+
type: 'io.compassdigital.partner.stock.updated';
|
|
5
|
+
source: string;
|
|
6
|
+
time: string;
|
|
7
|
+
data: StockUpdatedData;
|
|
8
|
+
}
|
|
9
|
+
export interface StockUpdatedData {
|
|
10
|
+
station_id: string;
|
|
11
|
+
changes: StockChange[];
|
|
12
|
+
}
|
|
13
|
+
export interface StockChange {
|
|
14
|
+
id: string;
|
|
15
|
+
in_stock: boolean;
|
|
16
|
+
}
|
|
17
|
+
export type PostMenuStockEventsBody = StockEvent;
|
|
18
|
+
export interface PostMenuStockEventsResponse {
|
|
19
|
+
id?: string;
|
|
20
|
+
received_at?: string;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=menu-intake.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"menu-intake.d.ts","sourceRoot":"","sources":["../../src/interface/menu-intake.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,UAAU;IAC1B,WAAW,EAAE,KAAK,CAAC;IAEnB,EAAE,EAAE,MAAM,CAAC;IAEX,IAAI,EAAE,yCAAyC,CAAC;IAEhD,MAAM,EAAE,MAAM,CAAC;IAEf,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,gBAAgB,CAAC;CACvB;AAED,MAAM,WAAW,gBAAgB;IAEhC,UAAU,EAAE,MAAM,CAAC;IAEnB,OAAO,EAAE,WAAW,EAAE,CAAC;CACvB;AAED,MAAM,WAAW,WAAW;IAE3B,EAAE,EAAE,MAAM,CAAC;IAEX,QAAQ,EAAE,OAAO,CAAC;CAClB;AAID,MAAM,MAAM,uBAAuB,GAAG,UAAU,CAAC;AAEjD,MAAM,WAAW,2BAA2B;IAC3C,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,WAAW,CAAC,EAAE,MAAM,CAAC;CACrB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"menu-intake.js","sourceRoot":"","sources":["../../src/interface/menu-intake.ts"],"names":[],"mappings":";AAAA,oBAAoB;AACpB,sDAAsD"}
|
package/manifest.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@compassdigital/sdk.typescript",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.989.0",
|
|
4
4
|
"description": "Compass Digital Labs TypeScript SDK",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"main": "./lib/index.js",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
62
|
"@compassdigital/review": "^7.6.3",
|
|
63
|
-
"@compassdigital/sdk.typescript.cli": "^4.
|
|
63
|
+
"@compassdigital/sdk.typescript.cli": "^4.65.0",
|
|
64
64
|
"@swc/core": "^1.4.1",
|
|
65
65
|
"@swc/jest": "^0.2.36",
|
|
66
66
|
"@types/jest": "^30.0.0",
|
package/src/index.ts
CHANGED
|
@@ -1772,6 +1772,8 @@ import {
|
|
|
1772
1772
|
PostAuditEventResponse,
|
|
1773
1773
|
} from './interface/audit';
|
|
1774
1774
|
|
|
1775
|
+
import { PostMenuStockEventsBody, PostMenuStockEventsResponse } from './interface/menu-intake';
|
|
1776
|
+
|
|
1775
1777
|
import { BaseServiceClient, RequestOptions, ServiceClientOptions, ResponsePromise } from './base';
|
|
1776
1778
|
export * from './base';
|
|
1777
1779
|
|
|
@@ -20517,4 +20519,24 @@ export class ServiceClient extends BaseServiceClient {
|
|
|
20517
20519
|
): ResponsePromise<PostAuditEventResponse> {
|
|
20518
20520
|
return this.request('audit', '/audit/ingest', 'POST', `/audit/ingest`, body, options);
|
|
20519
20521
|
}
|
|
20522
|
+
|
|
20523
|
+
/**
|
|
20524
|
+
* POST /menu/stock-events - Push stock changes for one station
|
|
20525
|
+
*
|
|
20526
|
+
* @param body
|
|
20527
|
+
* @param options - additional request options
|
|
20528
|
+
*/
|
|
20529
|
+
post_menu_stock_events(
|
|
20530
|
+
body: PostMenuStockEventsBody,
|
|
20531
|
+
options?: RequestOptions,
|
|
20532
|
+
): ResponsePromise<PostMenuStockEventsResponse> {
|
|
20533
|
+
return this.request(
|
|
20534
|
+
'menu-intake',
|
|
20535
|
+
'/menu/stock-events',
|
|
20536
|
+
'POST',
|
|
20537
|
+
`/menu/stock-events`,
|
|
20538
|
+
body,
|
|
20539
|
+
options,
|
|
20540
|
+
);
|
|
20541
|
+
}
|
|
20520
20542
|
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
// THIS FILE IS AUTOMATICALLY GENERATED, DO NOT MODIFY
|
|
3
|
+
|
|
4
|
+
import { RequestQuery, BaseRequest } from './util';
|
|
5
|
+
|
|
6
|
+
export interface StockEvent {
|
|
7
|
+
specversion: '1.0';
|
|
8
|
+
// Unique per event and identical on every retry of that event. This is the idempotency key.
|
|
9
|
+
id: string;
|
|
10
|
+
// Must be exactly this value. Unknown types are rejected, not ignored.
|
|
11
|
+
type: 'io.compassdigital.partner.stock.updated';
|
|
12
|
+
// The vendor id Centric issued. Must match the vendor the token is scoped to write as.
|
|
13
|
+
source: string;
|
|
14
|
+
// When the state changed in the sender's system. Required, but diagnostic only: ordering uses the timestamp Centric records on receipt.
|
|
15
|
+
time: string;
|
|
16
|
+
data: StockUpdatedData;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface StockUpdatedData {
|
|
20
|
+
// The station the changes apply to, from the location payload. Scoping is per station: a change applies to that item on every menu scheduled at the station.
|
|
21
|
+
station_id: string;
|
|
22
|
+
// Absolute states, no duplicate ids within a batch.
|
|
23
|
+
changes: StockChange[];
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface StockChange {
|
|
27
|
+
// An item or modifier id from the menu pull. One field, no type discriminator; Centric resolves it. An id not on any menu scheduled at the station is recorded as a no-op, not an error.
|
|
28
|
+
id: string;
|
|
29
|
+
// The current state: false is out of stock (86'd), true is available. Absolute state, never a toggle.
|
|
30
|
+
in_stock: boolean;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// POST /menu/stock-events - Push stock changes for one station
|
|
34
|
+
|
|
35
|
+
export type PostMenuStockEventsBody = StockEvent;
|
|
36
|
+
|
|
37
|
+
export interface PostMenuStockEventsResponse {
|
|
38
|
+
id?: string;
|
|
39
|
+
received_at?: string;
|
|
40
|
+
}
|