@nevermined-io/commons 0.4.5 → 0.5.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.
Files changed (36) hide show
  1. package/dist/index.js +2 -0
  2. package/dist/index.js.map +1 -0
  3. package/dist/lib/constants/AssetConstants.js +2 -0
  4. package/dist/lib/constants/AssetConstants.js.map +1 -0
  5. package/dist/lib/constants/index.js +2 -0
  6. package/dist/lib/constants/index.js.map +1 -0
  7. package/dist/lib/ddo/DDO.d.ts +1 -1
  8. package/dist/lib/ddo/DDO.d.ts.map +1 -1
  9. package/dist/lib/ddo/DDO.js +78 -62
  10. package/dist/lib/ddo/DDO.js.map +1 -0
  11. package/dist/lib/ddo/index.js +2 -0
  12. package/dist/lib/ddo/index.js.map +1 -0
  13. package/dist/lib/types/ContractsTypes.d.ts +1 -1
  14. package/dist/lib/types/ContractsTypes.d.ts.map +1 -1
  15. package/dist/lib/types/ContractsTypes.js +5 -14
  16. package/dist/lib/types/ContractsTypes.js.map +1 -0
  17. package/dist/lib/types/DDOTypes.js +8 -6
  18. package/dist/lib/types/DDOTypes.js.map +1 -0
  19. package/dist/lib/types/GeneralTypes.js +3 -1
  20. package/dist/lib/types/GeneralTypes.js.map +1 -0
  21. package/dist/lib/types/MetadataTypes.js +24 -23
  22. package/dist/lib/types/MetadataTypes.js.map +1 -0
  23. package/dist/lib/types/TransactionTypes.js +7 -2
  24. package/dist/lib/types/TransactionTypes.js.map +1 -0
  25. package/dist/lib/types/TranscoderTypes.js +11 -9
  26. package/dist/lib/types/TranscoderTypes.js.map +1 -0
  27. package/dist/lib/types/index.js +2 -0
  28. package/dist/lib/types/index.js.map +1 -0
  29. package/dist/lib/types/types.d.ts +93 -1
  30. package/dist/lib/types/types.d.ts.map +1 -1
  31. package/dist/lib/types/types.js +176 -69
  32. package/dist/lib/types/types.js.map +1 -0
  33. package/package.json +21 -1
  34. package/src/lib/ddo/DDO.ts +1 -1
  35. package/src/lib/types/ContractsTypes.ts +1 -1
  36. package/src/lib/types/types.ts +114 -1
@@ -254,9 +254,22 @@ export const NVM_COST_HEADER = 'NVMCreditsConsumed'
254
254
  export const DEFAULT_COST_CREDITS = '1'
255
255
 
256
256
  export enum OrganizationType {
257
- Free = 'Free',
258
257
  Premium = 'Premium',
259
258
  Enterprise = 'Enterprise',
259
+ /**
260
+ * An org whose paid subscription has lapsed past `currentPeriodEnd`.
261
+ * The org still exists (rows aren't deleted) but no Premium feature
262
+ * gates clear. Webhooks + lapse cron set this; new orgs are never
263
+ * created in this state. Replaces the old `Free` value which was
264
+ * misnamed — a paid-but-expired state was being shown as "Free"
265
+ * which overlapped semantically with non-org personal accounts.
266
+ */
267
+ Lapsed = 'Lapsed',
268
+ /**
269
+ * Legacy bucket for orgs pre-dating tiers (pre-Phase 2). Inherits
270
+ * Premium caps + features so existing orgs aren't unfairly blocked.
271
+ * Not assigned by any new code path.
272
+ */
260
273
  Other = 'Other',
261
274
  }
262
275
 
@@ -265,6 +278,44 @@ export enum OrganizationMemberRole {
265
278
  Member = 'Member',
266
279
  }
267
280
 
281
+ export enum OrganizationCustomerStatus {
282
+ Active = 'active',
283
+ Blocked = 'blocked',
284
+ }
285
+
286
+ export enum OrganizationInvitationStatus {
287
+ Pending = 'pending',
288
+ Accepted = 'accepted',
289
+ Revoked = 'revoked',
290
+ Expired = 'expired',
291
+ }
292
+
293
+ export enum OrganizationTierCurrency {
294
+ USD = 'USD',
295
+ EUR = 'EUR',
296
+ USDC = 'USDC',
297
+ EURC = 'EURC',
298
+ }
299
+
300
+ export enum OrganizationTierInterval {
301
+ Month = 'month',
302
+ Year = 'year',
303
+ OneShot = 'one_shot',
304
+ }
305
+
306
+ export enum OrganizationTierSource {
307
+ StripeSubscription = 'stripe_subscription',
308
+ CryptoOneShot = 'crypto_one_shot',
309
+ }
310
+
311
+ export enum OrganizationSubscriptionStatus {
312
+ Active = 'active',
313
+ PastDue = 'past_due',
314
+ Canceled = 'canceled',
315
+ Lapsed = 'lapsed',
316
+ Trialing = 'trialing',
317
+ }
318
+
268
319
  export enum UserProfileType {
269
320
  Merchant = 'merchant',
270
321
  Consumer = 'consumer',
@@ -293,3 +344,65 @@ export interface Branding {
293
344
  rightCardBackgroundColor2?: string
294
345
  rightCardBackgroundImageUrl?: string // Alternative to background colors
295
346
  }
347
+
348
+ // ---------------------------------------------------------------------------
349
+ // Activity Feed — event vocabulary (Stage 3a)
350
+ // ---------------------------------------------------------------------------
351
+
352
+ /**
353
+ * All event types that can be recorded in the organization activity feed.
354
+ *
355
+ * Stored as varchar strings in Postgres so new values can be added without
356
+ * ALTER TYPE migrations (forward-compatible with Postgres enum limitations).
357
+ *
358
+ * Stage 3b (webhooks) will wire WEBHOOK_* emit calls.
359
+ * Stage 4 (customers) will wire CUSTOMER_* emit calls.
360
+ */
361
+ export enum OrganizationActivityEventType {
362
+ // Membership lifecycle
363
+ MEMBER_INVITED = 'member.invited',
364
+ MEMBER_JOINED = 'member.joined',
365
+ MEMBER_ROLE_CHANGED = 'member.role_changed',
366
+ MEMBER_DEACTIVATED = 'member.deactivated',
367
+ MEMBER_REACTIVATED = 'member.reactivated',
368
+ MEMBER_REMOVED = 'member.removed',
369
+ INVITATION_REVOKED = 'invitation.revoked',
370
+ INVITATION_EXPIRED = 'invitation.expired',
371
+ // Resource lifecycle
372
+ AGENT_CREATED = 'agent.created',
373
+ PLAN_CREATED = 'plan.created',
374
+ PLAN_PURCHASED = 'plan.purchased',
375
+ // Customer lifecycle (Stage 4 wires the emit)
376
+ CUSTOMER_ADDED = 'customer.added',
377
+ CUSTOMER_BLOCKED = 'customer.blocked',
378
+ CUSTOMER_UNBLOCKED = 'customer.unblocked',
379
+ // Webhook delivery (Stage 3b adds emit)
380
+ WEBHOOK_DELIVERED = 'webhook.delivered',
381
+ WEBHOOK_FAILED = 'webhook.failed',
382
+ }
383
+
384
+ // ---------------------------------------------------------------------------
385
+ // Webhook subscription + delivery status enums (Stage 3b)
386
+ // ---------------------------------------------------------------------------
387
+
388
+ /**
389
+ * Status of the last delivery attempt on a webhook subscription.
390
+ * Stored as varchar on OrganizationWebhookSubscriptionEntity.
391
+ */
392
+ export enum WebhookSubscriptionLastDeliveryStatus {
393
+ Success = 'success',
394
+ Failed = 'failed',
395
+ Pending = 'pending',
396
+ }
397
+
398
+ /**
399
+ * Lifecycle status of a single webhook delivery row.
400
+ * Stored as varchar on OrganizationWebhookDeliveryEntity.
401
+ */
402
+ export enum WebhookDeliveryStatus {
403
+ Pending = 'pending',
404
+ InFlight = 'in_flight',
405
+ Delivered = 'delivered',
406
+ Failed = 'failed',
407
+ Dead = 'dead',
408
+ }