@cosmoops/connect-sdk 0.48.0 → 0.50.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.
@@ -267,9 +267,16 @@ export interface PlanAddonConsumable {
267
267
  export interface PlanAddon {
268
268
  id: string;
269
269
  name: string;
270
- /** GST-exclusive, in paise. */
270
+ /** GST-exclusive, in paise. Per plan cycle, or per year when `billingCadence` is `"annual"`. */
271
271
  price: number;
272
272
  consumable?: PlanAddonConsumable | null;
273
+ /**
274
+ * When the add-on is billed. `"annual"` = once on the first cycle that holds
275
+ * it, then on each anniversary - on a monthly plan too - so render its price
276
+ * as "/year". `"plan"` (or absent, from a Connect that predates the field) =
277
+ * every plan cycle, as before.
278
+ */
279
+ billingCadence?: "plan" | "annual" | null;
273
280
  }
274
281
  /**
275
282
  * A plan feature with its label, as the **catalogue** read reports it.
@@ -1786,6 +1793,14 @@ export interface StoreCommitResult {
1786
1793
  /** The document id each operation wrote, positionally aligned with the operations sent. */
1787
1794
  ids: string[];
1788
1795
  }
1796
+ /** What `data.getMany` answers - see `POST /data-get-many`. */
1797
+ export interface StoreGetManyResult {
1798
+ /**
1799
+ * Positionally aligned with the ids asked for, `null` where a document does
1800
+ * not exist. A missing document is an ordinary answer here, not a 404.
1801
+ */
1802
+ items: Array<StoreDocument | null>;
1803
+ }
1789
1804
  /** One entry from the `kv` store. */
1790
1805
  export interface KvEntry {
1791
1806
  key: string;
@@ -2951,6 +2966,45 @@ export interface CallSettings {
2951
2966
  /** Whether this member may change it - their `channel:manage`. Draw the switch disabled when not. */
2952
2967
  canManage: boolean;
2953
2968
  }
2969
+ /** A step of Connect's calling compliance journey - `connect.calls.getCallingReadiness()`. */
2970
+ export interface CallingReadinessStep {
2971
+ key: "intent" | "business" | "number" | "header" | "autodialer" | "consent" | "rules";
2972
+ label: string;
2973
+ status: "not_started" | "submitted" | "returned" | "done";
2974
+ /** Whether the business needs it for the calls it said it makes. */
2975
+ required: boolean;
2976
+ /** A returned step's reason, or what the numbers say. */
2977
+ note: string | null;
2978
+ }
2979
+ /** One kind of calling, and whether the workspace may run it today. */
2980
+ export interface CallingReadinessRun {
2981
+ /** `service` covers existing customers; `promotional` is any sales call. */
2982
+ purpose: "service" | "promotional";
2983
+ /** `preview`: a rep presses dial. `automatic`: software paces the dialing. */
2984
+ mode: "preview" | "automatic";
2985
+ allowed: boolean;
2986
+ /** The first thing in the way, worded for the member. `null` when allowed. */
2987
+ reason: string | null;
2988
+ }
2989
+ /**
2990
+ * Where the workspace stands on the steps Indian telecom rules ask of a
2991
+ * business before it calls - `connect.calls.getCallingReadiness()`. Read
2992
+ * `runs`, not `steps`, to decide what to offer: Connect evaluates them with
2993
+ * the gates the dialer refuses on.
2994
+ */
2995
+ export interface CallingReadiness {
2996
+ intent: "service_only" | "service_and_sales" | null;
2997
+ progress: {
2998
+ done: number;
2999
+ required: number;
3000
+ };
3001
+ steps: CallingReadinessStep[];
3002
+ runs: CallingReadinessRun[];
3003
+ /** Connect's journey screen, carrying your `client_id` when SSO is on. */
3004
+ setupUrl: string;
3005
+ /** Whether this member may take the steps - their `channel:manage`. */
3006
+ canManage: boolean;
3007
+ }
2954
3008
  export interface CallingAvailability {
2955
3009
  status: CallingAvailabilityStatus;
2956
3010
  /** The workspace's business number, E.164, when it holds one. */
@@ -3190,3 +3244,43 @@ export interface RegisterPushDeviceResponse {
3190
3244
  /** Hand this to `revokeDevice` to turn the same browser off again. */
3191
3245
  id: string;
3192
3246
  }
3247
+ /**
3248
+ * One task, onto one of this application's declared task queues, for one
3249
+ * workspace it serves. Hand-written like every wire type here;
3250
+ * `conformance.test.ts` holds it to `EnqueueApplicationTaskInputSchema`.
3251
+ */
3252
+ export interface EnqueueTaskInput {
3253
+ workspaceId: string;
3254
+ /** A queue declared for this application in Console. */
3255
+ queue: string;
3256
+ /** Any JSON. Delivered back as `payload`. Keep it to ids - 100 KB at most. */
3257
+ payload?: unknown;
3258
+ /**
3259
+ * A dedup key. A second enqueue with the same name for the same workspace
3260
+ * answers `duplicate` and queues nothing - name a self-chaining step after
3261
+ * the step (`campaign-42-page-3`) so two runners cannot both queue it.
3262
+ */
3263
+ name?: string;
3264
+ /** ISO-8601, at most 30 days ahead. Omit to run as soon as the queue's rate allows. */
3265
+ scheduleAt?: string;
3266
+ }
3267
+ export interface EnqueueTaskResponse {
3268
+ /**
3269
+ * `unavailable` means this Connect deployment has no task queue (local
3270
+ * development). Nothing was queued; fall back to whatever you would do
3271
+ * without one.
3272
+ */
3273
+ status: "queued" | "duplicate" | "unavailable";
3274
+ scheduleAt: string | null;
3275
+ }
3276
+ /** What Cloud Tasks POSTs to a queue's URL - and what `verifyConnectTask` returns. */
3277
+ export interface ConnectTaskDelivery<TPayload = unknown> {
3278
+ /** The workspace the enqueue was gated on - trust this, not anything in `payload`. */
3279
+ workspaceId: string;
3280
+ queue: string;
3281
+ payload: TPayload;
3282
+ /** From Cloud Tasks' own headers: 0 on the first attempt. */
3283
+ retryCount: number;
3284
+ /** Cloud Tasks' task id, stable across retries. */
3285
+ taskName: string | null;
3286
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cosmoops/connect-sdk",
3
- "version": "0.48.0",
3
+ "version": "0.50.0",
4
4
  "description": "Official server-side SDK for the CosmoOps Connect platform API - Login with Connect, entitlements, billing and metering.",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "type": "commonjs",