@stack-spot/portal-network 0.13.1 → 0.14.1
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 +15 -0
- package/dist/api/eventBus.d.ts +64 -0
- package/dist/api/eventBus.d.ts.map +1 -0
- package/dist/api/eventBus.js +41 -0
- package/dist/api/eventBus.js.map +1 -0
- package/dist/api/workspace.d.ts +2276 -0
- package/dist/api/workspace.d.ts.map +1 -0
- package/dist/api/workspace.js +19 -72
- package/dist/api/workspace.js.map +1 -1
- package/dist/apis.json +8 -0
- package/dist/client/event-bus.d.ts +22 -0
- package/dist/client/event-bus.d.ts.map +1 -0
- package/dist/client/event-bus.js +98 -0
- package/dist/client/event-bus.js.map +1 -0
- package/dist/client/workspace.d.ts +72 -1
- package/dist/client/workspace.d.ts.map +1 -1
- package/dist/client/workspace.js +91 -1
- package/dist/client/workspace.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/package.json +6 -4
- package/src/api/eventBus.ts +171 -0
- package/src/api/workspace.ts +89 -201
- package/src/apis.json +8 -0
- package/src/client/event-bus.ts +82 -0
- package/src/client/workspace.ts +61 -0
- package/src/index.ts +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.14.1](https://github.com/stack-spot/portal-commons/compare/portal-network@v0.14.0...portal-network@v0.14.1) (2024-08-15)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* ws type ([bd605ee](https://github.com/stack-spot/portal-commons/commit/bd605ee2e95692336294cdf37e6c7036249f1eb6))
|
|
9
|
+
|
|
10
|
+
## [0.14.0](https://github.com/stack-spot/portal-commons/compare/portal-network@v0.13.1...portal-network@v0.14.0) (2024-08-15)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
* Initial ws refactor ([75c7fa4](https://github.com/stack-spot/portal-commons/commit/75c7fa4d0e288948d1a3a7a227d0eb23f556367a))
|
|
16
|
+
* refactor event bus client ([b15a059](https://github.com/stack-spot/portal-commons/commit/b15a059b09b9d9513f7b660139448dc89f757104))
|
|
17
|
+
|
|
3
18
|
## [0.13.1](https://github.com/stack-spot/portal-commons/compare/portal-network@v0.13.0...portal-network@v0.13.1) (2024-08-13)
|
|
4
19
|
|
|
5
20
|
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* EventBusApi
|
|
3
|
+
* 0.2.7
|
|
4
|
+
* DO NOT MODIFY - This file has been generated using oazapfts.
|
|
5
|
+
* See https://www.npmjs.com/package/oazapfts
|
|
6
|
+
*/
|
|
7
|
+
import * as Oazapfts from "@oazapfts/runtime";
|
|
8
|
+
export declare const defaults: Oazapfts.Defaults<Oazapfts.CustomHeaders>;
|
|
9
|
+
export declare const servers: {
|
|
10
|
+
generatedServerUrl: string;
|
|
11
|
+
};
|
|
12
|
+
export type Event = {
|
|
13
|
+
/** Mandatory, defined by the client application */
|
|
14
|
+
id: string;
|
|
15
|
+
/** Mandatory, '/{workspaceSlug}/{app_name}' */
|
|
16
|
+
source: string;
|
|
17
|
+
/** Mandatory, fixed to '1.0' */
|
|
18
|
+
specversion: string;
|
|
19
|
+
/** Mandatory, UTC ISO 8601 ('YYYY-MM-DDTHH:MM:SSZ'), defined by client application */
|
|
20
|
+
time: string;
|
|
21
|
+
/** Mandatory, 'workspace_slug.event_name' */
|
|
22
|
+
"type": string;
|
|
23
|
+
/** Mandatory, application-specific event data */
|
|
24
|
+
data: {
|
|
25
|
+
[key: string]: object;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
export type SendEventsRequest = {
|
|
29
|
+
/** List of events */
|
|
30
|
+
events: Event[];
|
|
31
|
+
};
|
|
32
|
+
export type EventResult = object;
|
|
33
|
+
export type Error = EventResult & {
|
|
34
|
+
eventId?: string;
|
|
35
|
+
errorCode?: string;
|
|
36
|
+
errorMessage?: string;
|
|
37
|
+
};
|
|
38
|
+
export type Success = EventResult & {
|
|
39
|
+
eventId?: string;
|
|
40
|
+
partition?: number;
|
|
41
|
+
offset?: number;
|
|
42
|
+
timestamp?: number;
|
|
43
|
+
};
|
|
44
|
+
export type EventProcessingResponse = {
|
|
45
|
+
errorCount: number;
|
|
46
|
+
results: (Error | Success)[];
|
|
47
|
+
};
|
|
48
|
+
export type StatusType = number;
|
|
49
|
+
export type SendEncryptedEventsRequest = {
|
|
50
|
+
/** Base64 encoded + encrypted Events */
|
|
51
|
+
data: string;
|
|
52
|
+
/** Base64 encoded + encrypted random Symmetric Key */
|
|
53
|
+
sessionKey: string;
|
|
54
|
+
};
|
|
55
|
+
export declare function sendEvents({ stackspotCustomerIp, sendEventsRequest }: {
|
|
56
|
+
stackspotCustomerIp?: string;
|
|
57
|
+
sendEventsRequest: SendEventsRequest;
|
|
58
|
+
}, opts?: Oazapfts.RequestOpts): Promise<EventProcessingResponse>;
|
|
59
|
+
export declare function sendEncryptedEvents({ stackspotCustomerIp, sendEncryptedEventsRequest }: {
|
|
60
|
+
stackspotCustomerIp?: string;
|
|
61
|
+
sendEncryptedEventsRequest: SendEncryptedEventsRequest;
|
|
62
|
+
}, opts?: Oazapfts.RequestOpts): Promise<EventProcessingResponse>;
|
|
63
|
+
export declare function getPublicKey(opts?: Oazapfts.RequestOpts): Promise<string>;
|
|
64
|
+
//# sourceMappingURL=eventBus.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eventBus.d.ts","sourceRoot":"","sources":["../../src/api/eventBus.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,QAAQ,MAAM,mBAAmB,CAAC;AAE9C,eAAO,MAAM,QAAQ,EAAE,QAAQ,CAAC,QAAQ,CAAC,QAAQ,CAAC,aAAa,CAG9D,CA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AmB,EAAE,iBAAiB,EAAE,EAAE;IACnE,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,iBAAiB,EAAE,iBAAiB,CAAC;CACxC,EAAE,IAAI,CAAC,EAAE,QAAQ,CAAC,WAAW,oCAoC7B;AACD,wBAAgB,mBAAmB,CAAC,EAAE,mBAAmB,EAAE,0BAA0B,EAAE,EAAE;IACrF,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,0BAA0B,EAAE,0BAA0B,CAAC;CAC1D,EAAE,IAAI,CAAC,EAAE,QAAQ,CAAC,WAAW,oCAoC7B;AACD,wBAAgB,YAAY,CAAC,IAAI,CAAC,EAAE,QAAQ,CAAC,WAAW,mBA+BvD"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* EventBusApi
|
|
3
|
+
* 0.2.7
|
|
4
|
+
* DO NOT MODIFY - This file has been generated using oazapfts.
|
|
5
|
+
* See https://www.npmjs.com/package/oazapfts
|
|
6
|
+
*/
|
|
7
|
+
import * as Oazapfts from "@oazapfts/runtime";
|
|
8
|
+
export const defaults = {
|
|
9
|
+
headers: {},
|
|
10
|
+
baseUrl: "https://idp-event-bus-api.dev.stackspot.com",
|
|
11
|
+
};
|
|
12
|
+
const oazapfts = Oazapfts.runtime(defaults);
|
|
13
|
+
export const servers = {
|
|
14
|
+
generatedServerUrl: "https://idp-event-bus-api.dev.stackspot.com"
|
|
15
|
+
};
|
|
16
|
+
export function sendEvents({ stackspotCustomerIp, sendEventsRequest }, opts) {
|
|
17
|
+
return oazapfts.ok(oazapfts.fetchJson("/v1/events", oazapfts.json({
|
|
18
|
+
...opts,
|
|
19
|
+
method: "POST",
|
|
20
|
+
body: sendEventsRequest,
|
|
21
|
+
headers: oazapfts.mergeHeaders(opts?.headers, {
|
|
22
|
+
"stackspot-customer-ip": stackspotCustomerIp
|
|
23
|
+
})
|
|
24
|
+
})));
|
|
25
|
+
}
|
|
26
|
+
export function sendEncryptedEvents({ stackspotCustomerIp, sendEncryptedEventsRequest }, opts) {
|
|
27
|
+
return oazapfts.ok(oazapfts.fetchJson(`/v1/events/workspace/${encodeURIComponent(workspaceSlug)}/event/${encodeURIComponent(eventName)}`, oazapfts.json({
|
|
28
|
+
...opts,
|
|
29
|
+
method: "POST",
|
|
30
|
+
body: sendEncryptedEventsRequest,
|
|
31
|
+
headers: oazapfts.mergeHeaders(opts?.headers, {
|
|
32
|
+
"stackspot-customer-ip": stackspotCustomerIp
|
|
33
|
+
})
|
|
34
|
+
})));
|
|
35
|
+
}
|
|
36
|
+
export function getPublicKey(opts) {
|
|
37
|
+
return oazapfts.ok(oazapfts.fetchJson("/v1/events/key", {
|
|
38
|
+
...opts
|
|
39
|
+
}));
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=eventBus.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eventBus.js","sourceRoot":"","sources":["../../src/api/eventBus.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,QAAQ,MAAM,mBAAmB,CAAC;AAE9C,MAAM,CAAC,MAAM,QAAQ,GAA8C;IAC/D,OAAO,EAAE,EAAE;IACX,OAAO,EAAE,6CAA6C;CACzD,CAAC;AACF,MAAM,QAAQ,GAAG,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;AAC5C,MAAM,CAAC,MAAM,OAAO,GAAG;IACnB,kBAAkB,EAAE,6CAA6C;CACpE,CAAC;AA4CF,MAAM,UAAU,UAAU,CAAC,EAAE,mBAAmB,EAAE,iBAAiB,EAGlE,EAAE,IAA2B;IAC1B,OAAO,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC,SAAS,CA2BlC,YAAY,EAAE,QAAQ,CAAC,IAAI,CAAC;QAC3B,GAAG,IAAI;QACP,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,iBAAiB;QACvB,OAAO,EAAE,QAAQ,CAAC,YAAY,CAAC,IAAI,EAAE,OAAO,EAA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