@nevermined-io/commons 0.4.6 → 0.5.2

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 +36 -1
  30. package/dist/lib/types/types.d.ts.map +1 -1
  31. package/dist/lib/types/types.js +122 -87
  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 +40 -1
package/dist/index.js CHANGED
@@ -2,3 +2,5 @@ export * from './lib/types/index.js';
2
2
  export * from './lib/ddo/index.js';
3
3
  export * from './lib/constants/index.js';
4
4
  export { DDO } from './lib/ddo/DDO.js';
5
+
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export * from './lib/types/index.js'\nexport * from './lib/ddo/index.js'\nexport * from './lib/constants/index.js'\nexport { DDO } from './lib/ddo/DDO.js'\n"],"names":["DDO"],"mappings":"AAAA,cAAc,uBAAsB;AACpC,cAAc,qBAAoB;AAClC,cAAc,2BAA0B;AACxC,SAASA,GAAG,QAAQ,mBAAkB"}
@@ -1,3 +1,5 @@
1
1
  export const NETWORK_FEE_DENOMINATOR = 10000n;
2
2
  // The default encryption method
3
3
  export const DEFAULT_ENCRYPTION_METHOD = 'PSK-RSA';
4
+
5
+ //# sourceMappingURL=AssetConstants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/lib/constants/AssetConstants.ts"],"sourcesContent":["export const NETWORK_FEE_DENOMINATOR = 10000n\n\n// The type of the encryption methods supported for the private data included in the metadata\nexport type EncryptionMethod = 'PSK-RSA' | 'PSK-ECDSA'\n\n// The default encryption method\nexport const DEFAULT_ENCRYPTION_METHOD = 'PSK-RSA' as EncryptionMethod\n"],"names":["NETWORK_FEE_DENOMINATOR","DEFAULT_ENCRYPTION_METHOD"],"mappings":"AAAA,OAAO,MAAMA,0BAA0B,MAAM,CAAA;AAK7C,gCAAgC;AAChC,OAAO,MAAMC,4BAA4B,UAA6B"}
@@ -1 +1,3 @@
1
1
  export { DEFAULT_ENCRYPTION_METHOD, NETWORK_FEE_DENOMINATOR } from './AssetConstants.js';
2
+
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/lib/constants/index.ts"],"sourcesContent":["export { DEFAULT_ENCRYPTION_METHOD, NETWORK_FEE_DENOMINATOR } from './AssetConstants.js'\nexport type { EncryptionMethod } from './AssetConstants.js'\n"],"names":["DEFAULT_ENCRYPTION_METHOD","NETWORK_FEE_DENOMINATOR"],"mappings":"AAAA,SAASA,yBAAyB,EAAEC,uBAAuB,QAAQ,sBAAqB"}
@@ -23,7 +23,7 @@ export declare class DDO {
23
23
  created: string;
24
24
  updated?: string;
25
25
  metadata: Metadata;
26
- registry: Registry;
26
+ registry?: Registry;
27
27
  constructor(ddo?: Partial<DDO>);
28
28
  }
29
29
  export declare class AgentDDO extends DDO {
@@ -1 +1 @@
1
- {"version":3,"file":"DDO.d.ts","sourceRoot":"","sources":["../../../src/lib/ddo/DDO.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,QAAQ,EAAE,IAAI,EAAe,MAAM,4BAA4B,CAAA;AACvF,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AAQ1D,KAAK,QAAQ,GAAG,QAAQ,GAAG,IAAI,CAAA;AAE/B,qBAAa,GAAG;IACd;;;;OAIG;WACW,SAAS,CAAC,GAAG,EAAE,GAAG,GAAG,MAAM;IAIzC;;;;OAIG;WACW,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,GAAG;IAMjD;;OAEG;IACI,EAAE,SAAK;IAIP,CAAC,UAAU,CAAC,SAA4B;IAExC,IAAI,EAAE,SAAS,CAA2D;IAE1E,OAAO,EAAE,MAAM,CAAqD;IAEpE,OAAO,CAAC,EAAE,MAAM,CAAA;IAEhB,QAAQ,EAAE,QAAQ,CAgBxB;IAEM,QAAQ,EAAE,QAAQ,CAAA;gBAEN,GAAG,GAAE,OAAO,CAAC,GAAG,CAAM;CAK1C;AAED,qBAAa,QAAS,SAAQ,GAAG;IACf,QAAQ,EAAE,QAAQ,CAMjC;gBAEkB,GAAG,GAAE,OAAO,CAAC,QAAQ,CAAM;WAIhC,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,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,QAAQ,EAAE,IAAI,CAK7B;gBAEkB,GAAG,GAAE,OAAO,CAAC,OAAO,CAAM;WAI/B,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO;CAYxF"}
@@ -1,97 +1,113 @@
1
- const jsonReplacer = (_key, value) => {
1
+ const jsonReplacer = (_key, value)=>{
2
2
  // Modify the value or return undefined to exclude the property
3
3
  return typeof value === 'bigint' ? value.toString() : value;
4
4
  };
5
5
  export class DDO {
6
6
  /**
7
- * Serializes the DDO object.
8
- * @param ddo - The {@link DDO} to be serialized.
9
- * @returns DDO serialized.
10
- */
11
- static serialize(ddo) {
7
+ * Serializes the DDO object.
8
+ * @param ddo - The {@link DDO} to be serialized.
9
+ * @returns DDO serialized.
10
+ */ static serialize(ddo) {
12
11
  return JSON.stringify(ddo, jsonReplacer, 2);
13
12
  }
14
13
  /**
15
- * Deserializes the DDO object.
16
- * @param ddoString - The serialized {@link DDO} to be deserialized.
17
- * @returns The deserialized {@link DDO}.
18
- */
19
- static deserialize(ddoString) {
14
+ * Deserializes the DDO object.
15
+ * @param ddoString - The serialized {@link DDO} to be deserialized.
16
+ * @returns The deserialized {@link DDO}.
17
+ */ static deserialize(ddoString) {
20
18
  const ddo = JSON.parse(ddoString);
21
19
  return new DDO(ddo);
22
20
  }
23
- /**
24
- * DID, decentralizes ID.
25
- */
26
- id = '';
27
- // public didSeed = ''
28
- ['@context'] = 'https://w3id.org/did/v1';
29
- _nvm = { userId: '', userAddress: '', appId: '', versions: [] };
30
- created = new Date().toISOString().replace(/\.[0-9]{3}/, '');
31
- updated;
32
- metadata = {
33
- serviceEndpoint: '',
34
- main: {
35
- name: '',
36
- description: '',
37
- dateCreated: '',
38
- datePublished: '',
39
- license: '',
40
- tags: [],
41
- },
42
- curation: {
43
- numVotes: 0,
44
- rating: 0,
45
- schema: '',
46
- isListed: true,
47
- },
48
- };
49
- registry;
50
- constructor(ddo = {}) {
21
+ constructor(ddo = {}){
22
+ /**
23
+ * DID, decentralizes ID.
24
+ */ this.id = '';
25
+ // public didSeed = ''
26
+ this['@context'] = 'https://w3id.org/did/v1';
27
+ this._nvm = {
28
+ userId: '',
29
+ userAddress: '',
30
+ appId: '',
31
+ versions: []
32
+ };
33
+ this.created = new Date().toISOString().replace(/\.[0-9]{3}/, '');
34
+ this.metadata = {
35
+ serviceEndpoint: '',
36
+ main: {
37
+ name: '',
38
+ description: '',
39
+ dateCreated: '',
40
+ datePublished: '',
41
+ license: '',
42
+ tags: []
43
+ },
44
+ curation: {
45
+ numVotes: 0,
46
+ rating: 0,
47
+ schema: '',
48
+ isListed: true
49
+ }
50
+ };
51
51
  Object.assign(this, ddo, {
52
- created: (ddo && ddo.created) || new Date().toISOString().replace(/\.[0-9]{3}/, ''),
52
+ created: ddo && ddo.created || new Date().toISOString().replace(/\.[0-9]{3}/, '')
53
53
  });
54
54
  }
55
55
  }
56
56
  export class AgentDDO extends DDO {
57
- registry = {
58
- owner: '0x',
59
- creator: '0x',
60
- url: '',
61
- lastUpdated: 0n,
62
- plans: [],
63
- };
64
- constructor(ddo = {}) {
65
- super(ddo);
57
+ constructor(ddo = {}){
58
+ super(ddo), this.registry = {
59
+ owner: '0x',
60
+ creator: '0x',
61
+ url: '',
62
+ lastUpdated: 0n,
63
+ plans: []
64
+ };
66
65
  }
67
66
  static getInstance(userId, userAddress, appId) {
68
67
  return new AgentDDO({
69
68
  id: '',
70
- _nvm: { userId, userAddress, appId: appId || '', versions: [] },
71
- registry: { owner: '0x', creator: '0x', url: '', lastUpdated: 0n, plans: [] },
69
+ _nvm: {
70
+ userId,
71
+ userAddress,
72
+ appId: appId || '',
73
+ versions: []
74
+ },
75
+ registry: {
76
+ owner: '0x',
77
+ creator: '0x',
78
+ url: '',
79
+ lastUpdated: 0n,
80
+ plans: []
81
+ }
72
82
  });
73
83
  }
74
84
  }
75
85
  export class PlanDDO extends DDO {
76
- registry = {
77
- owner: '0x',
78
- price: {},
79
- credits: {},
80
- lastUpdated: 0n,
81
- };
82
- constructor(ddo = {}) {
83
- super(ddo);
86
+ constructor(ddo = {}){
87
+ super(ddo), this.registry = {
88
+ owner: '0x',
89
+ price: {},
90
+ credits: {},
91
+ lastUpdated: 0n
92
+ };
84
93
  }
85
94
  static getInstance(userId, userAddress, appId) {
86
95
  return new PlanDDO({
87
96
  id: '',
88
- _nvm: { userId, userAddress, appId: appId || '', versions: [] },
97
+ _nvm: {
98
+ userId,
99
+ userAddress,
100
+ appId: appId || '',
101
+ versions: []
102
+ },
89
103
  registry: {
90
104
  owner: '0x',
91
105
  price: {},
92
106
  credits: {},
93
- lastUpdated: 0n,
94
- },
107
+ lastUpdated: 0n
108
+ }
95
109
  });
96
110
  }
97
111
  }
112
+
113
+ //# sourceMappingURL=DDO.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/lib/ddo/DDO.ts"],"sourcesContent":["import { CreditsConfig, DIDAgent, Plan, PriceConfig } from '../types/ContractsTypes.js'\nimport { Metadata, NvmConfig } from '../types/DDOTypes.js'\n\nconst jsonReplacer = (_key: string, value: unknown) => {\n // Modify the value or return undefined to exclude the property\n return typeof value === 'bigint' ? value.toString() : value\n}\n\n// Union type for registry\ntype Registry = DIDAgent | Plan\n\nexport class DDO {\n /**\n * Serializes the DDO object.\n * @param ddo - The {@link DDO} to be serialized.\n * @returns DDO serialized.\n */\n public static serialize(ddo: DDO): string {\n return JSON.stringify(ddo, jsonReplacer, 2)\n }\n\n /**\n * Deserializes the DDO object.\n * @param ddoString - The serialized {@link DDO} to be deserialized.\n * @returns The deserialized {@link DDO}.\n */\n public static deserialize(ddoString: string): DDO {\n const ddo = JSON.parse(ddoString)\n\n return new DDO(ddo)\n }\n\n /**\n * DID, decentralizes ID.\n */\n public id = ''\n\n // public didSeed = ''\n\n public ['@context'] = 'https://w3id.org/did/v1'\n\n public _nvm: NvmConfig = { userId: '', userAddress: '', appId: '', versions: [] }\n\n public created: string = new Date().toISOString().replace(/\\.[0-9]{3}/, '')\n\n public updated?: string\n\n public metadata: Metadata = {\n serviceEndpoint: '',\n main: {\n name: '',\n description: '',\n dateCreated: '',\n datePublished: '',\n license: '',\n tags: [],\n },\n curation: {\n numVotes: 0,\n rating: 0,\n schema: '',\n isListed: true,\n },\n }\n\n public registry?: Registry\n\n public constructor(ddo: Partial<DDO> = {}) {\n Object.assign(this, ddo, {\n created: (ddo && ddo.created) || new Date().toISOString().replace(/\\.[0-9]{3}/, ''),\n })\n }\n}\n\nexport class AgentDDO extends DDO {\n public override registry: DIDAgent = {\n owner: '0x',\n creator: '0x',\n url: '',\n lastUpdated: 0n,\n plans: [],\n }\n\n public constructor(ddo: Partial<AgentDDO> = {}) {\n super(ddo)\n }\n\n public static getInstance(userId: string, userAddress: string, appId?: string): AgentDDO {\n return new AgentDDO({\n id: '',\n _nvm: { userId, userAddress, appId: appId || '', versions: [] },\n registry: { owner: '0x', creator: '0x', url: '', lastUpdated: 0n, plans: [] },\n })\n }\n}\n\nexport class PlanDDO extends DDO {\n public override registry: Plan = {\n owner: '0x',\n price: {} as PriceConfig,\n credits: {} as CreditsConfig,\n lastUpdated: 0n,\n }\n\n public constructor(ddo: Partial<PlanDDO> = {}) {\n super(ddo)\n }\n\n public static getInstance(userId: string, userAddress: string, appId?: string): PlanDDO {\n return new PlanDDO({\n id: '',\n _nvm: { userId, userAddress, appId: appId || '', versions: [] },\n registry: {\n owner: '0x',\n price: {} as PriceConfig,\n credits: {} as CreditsConfig,\n lastUpdated: 0n,\n },\n })\n }\n}\n"],"names":["jsonReplacer","_key","value","toString","DDO","serialize","ddo","JSON","stringify","deserialize","ddoString","parse","id","_nvm","userId","userAddress","appId","versions","created","Date","toISOString","replace","metadata","serviceEndpoint","main","name","description","dateCreated","datePublished","license","tags","curation","numVotes","rating","schema","isListed","Object","assign","AgentDDO","registry","owner","creator","url","lastUpdated","plans","getInstance","PlanDDO","price","credits"],"mappings":"AAGA,MAAMA,eAAe,CAACC,MA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;YACJC,MAAM;gBAAEC;gBAAQC;gBAAaC,OAAOA,SAAS;gBAAIC,UAAU,EAAE;YAAC;YAC9DsB,UAAU;gBAAEC,OAAO;gBAAMC,SAAS;gBAAMC,KAAK;gBAAIC,aAAa,EAAE;gBAAEC,OAAO,EAAE;YAAC;QAC9E;IACF;AACF;AAEA,OAAO,MAAME,gBAAgB1C;IAQ3B,YAAmBE,MAAwB,CAAC,CAAC,CAAE;QAC7C,KAAK,CAACA,WARQiC,WAAiB;YAC/BC,OAAO;YACPO,OAAO,CAAC;YACRC,SAAS,CAAC;YACVL,aAAa,EAAE;QACjB;IAIA;IAEA,OAAcE,YAAY/B,MAAc,EAAEC,WAAmB,EAAEC,KAAc,EAAW;QACtF,OAAO,IAAI8B,QAAQ;YACjBlC,IAAI;YACJC,MAAM;gBAAEC;gBAAQC;gBAAaC,OAAOA,SAAS;gBAAIC,UAAU,EAAE;YAAC;YAC9DsB,UAAU;gBACRC,OAAO;gBACPO,OAAO,CAAC;gBACRC,SAAS,CAAC;gBACVL,aAAa,EAAE;YACjB;QACF;IACF;AACF"}
@@ -1 +1,3 @@
1
1
  export * from './DDO.js';
2
+
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/lib/ddo/index.ts"],"sourcesContent":["export * from './DDO.js'\n"],"names":[],"mappings":"AAAA,cAAc,WAAU"}
@@ -81,7 +81,7 @@ export interface CreditsConfig {
81
81
  */
82
82
  nftAddress?: Address;
83
83
  }
84
- export declare class Plan {
84
+ export interface Plan {
85
85
  owner: Address;
86
86
  price: PriceConfig;
87
87
  credits: CreditsConfig;
@@ -1 +1 @@
1
- {"version":3,"file":"ContractsTypes.d.ts","sourceRoot":"","sources":["../../../src/lib/types/ContractsTypes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AAS9B,oBAAY,cAAc;IACxB,gBAAgB,IAAA;IAChB,UAAU,IAAA;IACV,cAAc,I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E,MAAM,CAAA;CACpB"}
@@ -5,22 +5,13 @@
5
5
  /// If ONLY_PLAN_ROLE it means the credits can be redeemed by an account with specifics grants for the plan
6
6
  /// If OWNER_OR_GLOBAL_ROLE means Only the owner OR accounts with CREDITS_BURNER_ROLE can redeem
7
7
  /// If ONLY_SUBSCRIBER means only the subscriber (the one who holds the credits NFT) can redeem
8
- export var RedemptionType;
9
- (function (RedemptionType) {
8
+ export var RedemptionType = /*#__PURE__*/ function(RedemptionType) {
10
9
  RedemptionType[RedemptionType["ONLY_GLOBAL_ROLE"] = 0] = "ONLY_GLOBAL_ROLE";
11
10
  RedemptionType[RedemptionType["ONLY_OWNER"] = 1] = "ONLY_OWNER";
12
11
  RedemptionType[RedemptionType["ONLY_PLAN_ROLE"] = 2] = "ONLY_PLAN_ROLE";
13
12
  RedemptionType[RedemptionType["OWNER_OR_GLOBAL_ROLE"] = 3] = "OWNER_OR_GLOBAL_ROLE";
14
13
  RedemptionType[RedemptionType["ONLY_SUBSCRIBER"] = 4] = "ONLY_SUBSCRIBER";
15
- })(RedemptionType || (RedemptionType = {}));
16
- /// Definition of a plan
17
- export class Plan {
18
- // The owner of the Plan
19
- owner;
20
- // The price configuration of the plan
21
- price;
22
- // The credits configuration of the plan
23
- credits;
24
- // The timestamp of the last time the plan definition was updated
25
- lastUpdated;
26
- }
14
+ return RedemptionType;
15
+ }({});
16
+
17
+ //# sourceMappingURL=ContractsTypes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/lib/types/ContractsTypes.ts"],"sourcesContent":["import { Address } from 'viem'\n\n/// Different types of redemptions criterias that can be used when redeeming credits\n/// @notice 0 - ONLY_GLOBAL_ROLE, 1 - ONLY_OWNER, 2 - ROLE_AND_OWNER\n/// If ONLY_GLOBAL_ROLE it means the credits can be redeemed only by an account with the `CREDITS_BURNER_ROLE`\n/// If ONLY_OWNER it means the credits can be redeemed only by the owner of the Plan\n/// If ONLY_PLAN_ROLE it means the credits can be redeemed by an account with specifics grants for the plan\n/// If OWNER_OR_GLOBAL_ROLE means Only the owner OR accounts with CREDITS_BURNER_ROLE can redeem\n/// If ONLY_SUBSCRIBER means only the subscriber (the one who holds the credits NFT) can redeem\nexport enum RedemptionType {\n ONLY_GLOBAL_ROLE,\n ONLY_OWNER,\n ONLY_PLAN_ROLE,\n OWNER_OR_GLOBAL_ROLE,\n ONLY_SUBSCRIBER,\n}\n\nexport interface DIDAgent {\n // The owner of the asset\n owner: Address\n // Asset original creator, this can't be modified after the asset is registered\n creator: Address\n // URL to the metadata associated to the DID\n url: string\n // When was the DID last updated\n lastUpdated: bigint\n // Array of plans that can be used to purchase access to the asset\n plans: bigint[]\n}\n\n/// Definition of the price configuration for a plan\nexport interface PriceConfig {\n /**\n * @notice Indicates if the price is in cryptocurrency (true) or fiat currency (false)\n */\n isCrypto: boolean\n /**\n * @notice Indicates if the price is in cryptocurrency (true) or fiat currency (false)\n */\n tokenAddress?: Address\n /**\n * The amounts to be paid for the plan\n * @notice only if the price is not calculated by a smart contract\n */\n amounts: bigint[]\n /**\n * The receivers of the payments of the plan\n * @notice only if the price is not calculated by a smart contract\n */\n receivers: string[]\n /**\n * The address of the smart contract that calculates the price\n */\n externalPriceAddress?: Address\n /**\n * The address of the fee controller contract, if any\n * @notice if not given, the fee controller is the default one\n */\n feeController?: Address\n /**\n * @notice The template contract address associated with the plan\n */\n templateAddress?: Address\n}\n\n/// Definition of the credits configuration for a plan\nexport interface CreditsConfig {\n /**\n * @notice Indicates if the redemption amount is fixed (true) or dynamic (false)\n */\n isRedemptionAmountFixed: boolean\n /**\n * How the credits can be redeemed\n */\n redemptionType: RedemptionType\n /**\n * Whether the credits burn proof signed by the user is required\n */\n onchainMirror: boolean\n /**\n * The duration of the credits in seconds\n */\n durationSecs: bigint\n /**\n * The amount of credits that are granted when purchasing the plan\n */\n amount: bigint\n /**\n * The minimum number of credits redeemed when using the plan\n */\n minAmount: bigint\n /**\n * The maximum number of credits redeemed when using the plan\n * @notice only if isRedemptionAmountFixed is false\n */\n maxAmount: bigint\n /**\n * The address of the NFT contract that represents the plan's credits\n */\n nftAddress?: Address\n}\n\n/// Definition of a plan\nexport interface Plan {\n // The owner of the Plan\n owner: Address\n // The price configuration of the plan\n price: PriceConfig\n // The credits configuration of the plan\n credits: CreditsConfig\n // The timestamp of the last time the plan definition was updated\n lastUpdated: bigint\n}\n"],"names":["RedemptionType"],"mappings":"AAEA,oFAAoF;AACpF,oEAAoE;AACpE,8GAA8G;AAC9G,oFAAoF;AACpF,2GAA2G;AAC3G,gGAAgG;AAChG,+FAA+F;AAC/F,OAAO,IAAA,AAAKA,wCAAAA;;;;;;WAAAA;MAMX"}
@@ -1,14 +1,16 @@
1
- export var ApiAuthenticationType;
2
- (function (ApiAuthenticationType) {
1
+ export var ApiAuthenticationType = /*#__PURE__*/ function(ApiAuthenticationType) {
3
2
  ApiAuthenticationType["none"] = "none";
4
3
  ApiAuthenticationType["basic"] = "basic";
5
4
  ApiAuthenticationType["bearer"] = "bearer";
6
5
  ApiAuthenticationType["oauth"] = "oauth";
7
- })(ApiAuthenticationType || (ApiAuthenticationType = {}));
8
- export var AgentTaskStatus;
9
- (function (AgentTaskStatus) {
6
+ return ApiAuthenticationType;
7
+ }({});
8
+ export var AgentTaskStatus = /*#__PURE__*/ function(AgentTaskStatus) {
10
9
  AgentTaskStatus["SUCCESS"] = "Success";
11
10
  AgentTaskStatus["FAILURE"] = "Failure";
12
11
  AgentTaskStatus["PENDING"] = "Pending";
13
12
  AgentTaskStatus["IN_PROGRESS"] = "In_Progress";
14
- })(AgentTaskStatus || (AgentTaskStatus = {}));
13
+ return AgentTaskStatus;
14
+ }({});
15
+
16
+ //# sourceMappingURL=DDOTypes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/lib/types/DDOTypes.ts"],"sourcesContent":["import { CreditsConfig, PriceConfig } from './ContractsTypes.js'\n\nexport interface Metadata {\n serviceEndpoint: string\n main: MetadataMainAttributes\n agent?: AgentMetadata\n additionalInformation?: unknown\n curation: Curation\n plan?: PlanMetadata\n}\n\nexport interface NvmConfigVersions {\n id: number\n updated: string\n checksum: string\n}\nexport interface NvmConfig {\n userId: string\n userAddress: string\n appId: string\n versions: NvmConfigVersions[]\n}\n\nexport interface Proof {\n created: string\n creator: string\n signatureValue: string\n type: string\n}\n\nexport interface MetadataMainAttributes {\n name: string\n description?: string\n author?: string\n dateCreated?: string\n datePublished?: string\n license?: string\n tags?: string[]\n}\n\n/**\n * Interface describing an asset of type `service`\n */\nexport interface AgentMetadata {\n /**\n * Type of Web service\n */\n apiType?: 'restful' | 'graphql' | 'rpc' | 'other'\n\n /**\n * Authentication required by the API\n */\n authentication?: ResourceAuthentication\n\n /**\n * List of endpoints of the API exposed by the Agent\n */\n endpoints?: ApiEndpoint[]\n\n /**\n * List of open endpoints available for the agent. These endpoints are not protected.\n * This attribute is useful to indicate which endpoints are available for public access (documentation, definitions, etc).\n */\n openEndpoints?: string[]\n\n requiredHeaders?: { [verb: string]: string }[]\n\n encryptedAttributes?: string\n}\n\nexport interface PlanMetadata {\n isTrialPlan?: boolean\n productId?: string\n priceId?: string\n recurringSubscription?: boolean\n accessLimit: 'credits' | 'time'\n fiatPaymentProvider?: 'stripe' | 'braintree'\n currency?: string\n /**\n * x402 payment scheme identifier (e.g., 'nvm:erc4337')\n */\n x402Scheme?: string\n /**\n * URL of the x402 facilitator endpoint\n */\n x402FacilitatorUrl?: string\n /**\n * URL to the x402 scheme specification\n */\n x402SpecUrl?: string\n}\n\nexport interface AgentRegistry {\n owner: string\n creator: string\n url: string\n lastUpdated: string\n plans: string[]\n}\n\nexport interface PlanRegistry {\n owner: string\n lastUpdated: string\n price: PriceConfig\n credits: CreditsConfig\n}\n\nexport interface ResourceAuthentication {\n type: ApiAuthenticationType\n\n user?: string\n password?: string\n token?: string\n encrypted?: boolean\n privateParameters?: { [name: string]: string }[]\n}\n\n/**\n * Curation attributes of Assets Metadata.\n * @see https://github.com/nevermined-io/docs/blob/master/docs/architecture/specs/metadata/README.md#curation-attributes\n */\nexport interface Curation {\n /**\n * Decimal value between 0 and 1. 0 is the default value.\n * @example 0.93\n */\n rating: number\n\n /**\n * Number of votes. 0 is the default value.\n * @example 123\n */\n numVotes: number\n\n /**\n * Schema applied to calculate the rating.\n * @example \"Binary Voting\"\n */\n schema?: string\n\n /**\n * Flag unsuitable content.\n * @example true\n */\n isListed?: boolean\n}\n\nexport enum ApiAuthenticationType {\n none = 'none',\n basic = 'basic',\n bearer = 'bearer',\n oauth = 'oauth',\n}\n\nexport type ApiEndpoint = { [verb: string]: string }\n\nexport enum AgentTaskStatus {\n SUCCESS = 'Success',\n FAILURE = 'Failure',\n PENDING = 'Pending',\n IN_PROGRESS = 'In_Progress',\n}\n"],"names":["ApiAuthenticationType","AgentTaskStatus"],"mappings":"AAmJA,OAAO,IAAA,AAAKA,+CAAAA;;;;;WAAAA;MAKX;AAID,OAAO,IAAA,AAAKC,yCAAAA;;;;;WAAAA;MAKX"}
@@ -1 +1,3 @@
1
- export {};
1
+ export { };
2
+
3
+ //# sourceMappingURL=GeneralTypes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/lib/types/GeneralTypes.ts"],"sourcesContent":["export interface Balance {\n eth: bigint\n nevermined: bigint\n}\n\nexport interface Eip712Data {\n message: string\n chainId: number\n}\n\nexport interface TypedDataDomain {\n name: string\n version: string\n chainId: number\n}\n\nexport interface TypedDataTypes {\n Nevermined: {\n name: string\n type: string\n }[]\n}\n\nexport interface PriceBreakdown {\n grossCharge: bigint\n ownerMargin: bigint\n nvmMargin: bigint\n stripeFee?: bigint\n nvmCharge: bigint\n orgMargin?: bigint\n}\n\nexport interface BraintreeTwoTxBreakdown extends PriceBreakdown {\n /** Amount to charge on the platform gateway (grossed-up NVM fee) in micro-units */\n platformChargeMicroUnits: bigint\n /** Amount to charge on the merchant gateway in micro-units */\n merchantChargeMicroUnits: bigint\n /** NVM's net profit after Braintree takes its cut from the platform transaction */\n nvmNetMicroUnits: bigint\n}\n"],"names":[],"mappings":"AAgCA,WAOC"}
@@ -5,58 +5,59 @@
5
5
  * * OnlyImmutable - Try to resolve the metadata only from the immutable data store URL
6
6
  * * OnlyMetadataAPI - Try to resolve the metadata only from the Metadata API. It gets the metadata api url from the DIDRegistry
7
7
  * * NoRegisry - Gets the metadata from the Metadata API using as endpoint the metadata api url from the SDK config. This method don't gets any on-chain information because assumes the DID is not registered on-chain
8
- */
9
- export var DIDResolvePolicy;
10
- (function (DIDResolvePolicy) {
8
+ */ export var DIDResolvePolicy = /*#__PURE__*/ function(DIDResolvePolicy) {
11
9
  DIDResolvePolicy[DIDResolvePolicy["ImmutableFirst"] = 0] = "ImmutableFirst";
12
10
  DIDResolvePolicy[DIDResolvePolicy["MetadataAPIFirst"] = 1] = "MetadataAPIFirst";
13
11
  DIDResolvePolicy[DIDResolvePolicy["OnlyImmutable"] = 2] = "OnlyImmutable";
14
12
  DIDResolvePolicy[DIDResolvePolicy["OnlyMetadataAPI"] = 3] = "OnlyMetadataAPI";
15
13
  DIDResolvePolicy[DIDResolvePolicy["NoRegistry"] = 4] = "NoRegistry";
16
- })(DIDResolvePolicy || (DIDResolvePolicy = {}));
14
+ return DIDResolvePolicy;
15
+ }({});
17
16
  /**
18
17
  * Where the metadata will be published. Options:
19
18
  * - OnlyMetadataAPI, The metadata will be stored only in the Metadata/Marketplace API
20
19
  * - IPFS, The metadata will be stored in the Metadata/Marketplace API and IPFS
21
20
  * - Filecoin, The metadata will be stored in the Metadata/Marketplace API and Filecoin
22
21
  * - Arweave, The metadata will be stored in the Metadata/Marketplace API and Arweave
23
- */
24
- export var PublishMetadataOptions;
25
- (function (PublishMetadataOptions) {
22
+ */ export var PublishMetadataOptions = /*#__PURE__*/ function(PublishMetadataOptions) {
26
23
  PublishMetadataOptions[PublishMetadataOptions["OnlyMetadataAPI"] = 0] = "OnlyMetadataAPI";
27
24
  PublishMetadataOptions[PublishMetadataOptions["IPFS"] = 1] = "IPFS";
28
25
  PublishMetadataOptions[PublishMetadataOptions["Filecoin"] = 2] = "Filecoin";
29
26
  PublishMetadataOptions[PublishMetadataOptions["Arweave"] = 3] = "Arweave";
30
- })(PublishMetadataOptions || (PublishMetadataOptions = {}));
27
+ return PublishMetadataOptions;
28
+ }({});
31
29
  /**
32
30
  * It specifies if the DID will be published on-chain initially or not.
33
- */
34
- export var PublishOnChainOptions;
35
- (function (PublishOnChainOptions) {
31
+ */ export var PublishOnChainOptions = /*#__PURE__*/ function(PublishOnChainOptions) {
36
32
  PublishOnChainOptions[PublishOnChainOptions["DIDRegistry"] = 0] = "DIDRegistry";
37
33
  PublishOnChainOptions[PublishOnChainOptions["OnlyOffchain"] = 1] = "OnlyOffchain";
38
- })(PublishOnChainOptions || (PublishOnChainOptions = {}));
34
+ return PublishOnChainOptions;
35
+ }({});
39
36
  export class AssetPublicationOptions {
40
- metadata = PublishMetadataOptions.OnlyMetadataAPI;
41
- did = PublishOnChainOptions.DIDRegistry;
37
+ constructor(){
38
+ this.metadata = 0;
39
+ this.did = 0;
40
+ }
42
41
  }
43
- export var PermissionType;
44
- (function (PermissionType) {
42
+ export var PermissionType = /*#__PURE__*/ function(PermissionType) {
45
43
  PermissionType["Read"] = "read";
46
44
  PermissionType["Update"] = "update";
47
45
  PermissionType["Delete"] = "delete";
48
46
  PermissionType["Admin"] = "admin";
49
- })(PermissionType || (PermissionType = {}));
50
- export var PaymentMethodsAccepted;
51
- (function (PaymentMethodsAccepted) {
47
+ return PermissionType;
48
+ }({});
49
+ export var PaymentMethodsAccepted = /*#__PURE__*/ function(PaymentMethodsAccepted) {
52
50
  PaymentMethodsAccepted["Crypto"] = "crypto";
53
51
  PaymentMethodsAccepted["Fiat"] = "fiat";
54
52
  PaymentMethodsAccepted["All"] = "all";
55
53
  PaymentMethodsAccepted["NotSelected"] = "notSelected";
56
- })(PaymentMethodsAccepted || (PaymentMethodsAccepted = {}));
57
- export var State;
58
- (function (State) {
54
+ return PaymentMethodsAccepted;
55
+ }({});
56
+ export var State = /*#__PURE__*/ function(State) {
59
57
  State["Disabled"] = "disabled";
60
58
  State["Unconfirmed"] = "unconfirmed";
61
59
  State["Confirmed"] = "confirmed";
62
- })(State || (State = {}));
60
+ return State;
61
+ }({});
62
+
63
+ //# sourceMappingURL=MetadataTypes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/lib/types/MetadataTypes.ts"],"sourcesContent":["import { DDO } from '../ddo/DDO.js'\n\n/**\n * It described the policy to be used when resolving an asset. It has the following options:\n * * ImmutableFirst - It checks if there is a reference to an immutable data-store (IPFS, Filecoin, etc) on-chain. If that's the case uses the URL to resolve the Metadata. If not try to resolve the metadata using the URL of the Metadata/Marketplace API\n * * MetadataAPIFirst - Try to resolve the metadata from the Marketplace/Metadata API, if it can't tries to resolve using the immutable url\n * * OnlyImmutable - Try to resolve the metadata only from the immutable data store URL\n * * OnlyMetadataAPI - Try to resolve the metadata only from the Metadata API. It gets the metadata api url from the DIDRegistry\n * * NoRegisry - Gets the metadata from the Metadata API using as endpoint the metadata api url from the SDK config. This method don't gets any on-chain information because assumes the DID is not registered on-chain\n */\nexport enum DIDResolvePolicy {\n ImmutableFirst = 0,\n MetadataAPIFirst = 1,\n OnlyImmutable = 2,\n OnlyMetadataAPI = 3,\n NoRegistry = 4,\n}\n\n/**\n * Where the metadata will be published. Options:\n * - OnlyMetadataAPI, The metadata will be stored only in the Metadata/Marketplace API\n * - IPFS, The metadata will be stored in the Metadata/Marketplace API and IPFS\n * - Filecoin, The metadata will be stored in the Metadata/Marketplace API and Filecoin\n * - Arweave, The metadata will be stored in the Metadata/Marketplace API and Arweave\n */\nexport enum PublishMetadataOptions {\n OnlyMetadataAPI = 0,\n IPFS = 1,\n Filecoin = 2,\n Arweave = 3,\n}\n\n/**\n * It specifies if the DID will be published on-chain initially or not.\n */\nexport enum PublishOnChainOptions {\n DIDRegistry = 0, // The DID and the reference to the DDO will be stored in the DIDRegistry contract\n OnlyOffchain = 1, // THE DID won't be stored on-chain and will be lazy-registered when needed\n}\n\nexport class AssetPublicationOptions {\n metadata?: PublishMetadataOptions = PublishMetadataOptions.OnlyMetadataAPI\n did?: PublishOnChainOptions = PublishOnChainOptions.DIDRegistry\n}\n\nexport interface SearchResults {\n value: number\n relation: 'eq' | 'gte'\n}\n\nexport interface QueryResult {\n results: DDO[]\n page: number\n totalPages: number\n totalResults: { [jsonPath: string]: any }\n}\n\nexport interface MarketplaceResults<Entity> {\n page: number\n results: Entity[]\n total_pages: number\n total_results: SearchResults\n}\n\nexport interface SearchQuery {\n offset?: number\n page?: number\n text?: string\n query?: unknown\n sort?: unknown\n show_unlisted?: boolean\n appId?: string\n}\n\nexport enum PermissionType {\n Read = 'read',\n Update = 'update',\n Delete = 'delete',\n Admin = 'admin',\n}\n\nexport interface NewPermission {\n userId: string\n type: PermissionType[]\n issuer: string\n holder: string\n}\n\nexport interface Permission extends NewPermission {\n id: string\n issuanceDate: Date\n}\n\nexport enum PaymentMethodsAccepted {\n Crypto = 'crypto',\n Fiat = 'fiat',\n All = 'all',\n NotSelected = 'notSelected',\n}\n\nexport enum State {\n Disabled = 'disabled',\n Unconfirmed = 'unconfirmed',\n Confirmed = 'confirmed',\n}\n\nexport interface Stripe {\n accountId?: string | null\n accountType?: 'express' | 'standard' | null\n isAccountValidated?: boolean\n accountCreatedAt?: string\n accountUpdatedAt?: string\n additionalInformation?: unknown\n}\n\nexport interface BraintreeMerchant {\n merchantId?: string | null\n isAccountValidated?: boolean\n accountCreatedAt?: string\n accountUpdatedAt?: string\n accessToken?: string | null\n refreshToken?: string | null\n tokenExpiresAt?: string | null\n // Map of ISO 4217 currency code → Braintree merchantAccountId. Each entry\n // represents a currency-bound child account under the seller's Braintree\n // account; we route transaction.sale to the right one based on the plan\n // currency. Discovered via gateway.merchantAccount.all() at OAuth time.\n merchantAccountIdsByCurrency?: Record<string, string>\n // Derived for API output (the keys of merchantAccountIdsByCurrency). Set by\n // GetUserProfileDto.stripBraintreeTokens; not persisted.\n supportedCurrencies?: string[]\n additionalInformation?: unknown\n}\n\nexport interface AdditionalInformation {\n privyUserId?: string\n privyWalletId?: string\n}\n\nexport interface NewProfile {\n isListed: boolean\n state: State\n addresses: string[]\n nickname: string\n name?: string\n email?: string\n live?: Stripe\n sandbox?: Stripe\n braintreeLive?: BraintreeMerchant\n braintreeSandbox?: BraintreeMerchant\n paymentCountry?: string\n additionalInformation?: unknown\n}\n\nexport interface Profile extends NewProfile {\n userId: string\n creationDate: Date\n updateDate: Date\n}\n\nexport interface ReducedProfile {\n userId: string\n nickname?: string\n live?: Stripe\n sandbox?: Stripe\n braintreeLive?: BraintreeMerchant\n braintreeSandbox?: BraintreeMerchant\n additionalInformation?: unknown\n}\n"],"names":["DIDResolvePolicy","PublishMetadataOptions","PublishOnChainOptions","AssetPublicationOptions","metadata","did","PermissionType","PaymentMethodsAccepted","State"],"mappings":"AAEA;;;;;;;CAOC,GACD,OAAO,IAAA,AAAKA,0CAAAA;;;;;;WAAAA;MAMX;AAED;;;;;;CAMC,GACD,OAAO,IAAA,AAAKC,gDAAAA;;;;;WAAAA;MAKX;AAED;;CAEC,GACD,OAAO,IAAA,AAAKC,+CAAAA;;;WAAAA;MAGX;AAED,OAAO,MAAMC;;aACXC;aACAC;;AACF;AA+BA,OAAO,IAAA,AAAKC,wCAAAA;;;;;WAAAA;MAKX;AAcD,OAAO,IAAA,AAAKC,gDAAAA;;;;;WAAAA;MAKX;AAED,OAAO,IAAA,AAAKC,+BAAAA;;;;WAAAA;MAIX"}
@@ -1,4 +1,9 @@
1
1
  /**
2
2
  * Shared transaction types used by both API and webapp
3
- */
4
- export {};
3
+ */ /**
4
+ * Credits information for a purchased plan
5
+ */ /**
6
+ * Response from GET /api/v1/transactions/plans-purchased-detailed
7
+ */ export { };
8
+
9
+ //# sourceMappingURL=TransactionTypes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/lib/types/TransactionTypes.ts"],"sourcesContent":["/**\n * Shared transaction types used by both API and webapp\n */\n\n/**\n * Credits information for a purchased plan\n */\nexport interface PlanCreditsInfo {\n /** Indicates if the redemption amount is fixed (true) or dynamic (false) */\n isRedemptionAmountFixed: boolean\n /** For EXPIRABLE plans: percentage consumed (0-100). For FIXED/DYNAMIC: remaining credits */\n consumptionInfo: number\n /** For EXPIRABLE plans: true if expired. For FIXED/DYNAMIC: true if no credits left */\n isExpired: boolean\n /** Current credits balance */\n currentBalance: string\n /** Total credits originally granted */\n totalCredits: string\n /** Purchase date for expirable plans */\n purchaseDate?: string\n /** Duration in seconds for expirable plans */\n durationSecs?: number\n}\n\n/**\n * Single item from the plans-purchased-detailed API response\n */\nexport interface PurchasedPlanItem {\n /** Plan detailed information */\n plan?: {\n id: string\n [key: string]: unknown\n }\n /** Agents associated to this plan */\n agents?: unknown[]\n /** Credits consumption information */\n creditsInfo?: PlanCreditsInfo | null\n /** List of transactions for this plan */\n transactions?: unknown[]\n}\n\n/**\n * Response from GET /api/v1/transactions/plans-purchased-detailed\n */\nexport interface PlanPurchasedDetailedResponse {\n /** Current page number */\n page: number\n /** Total number of pages */\n totalPages: number\n /** Total number of results found */\n totalResults: number\n /** List of purchased plans with detailed information */\n results: PurchasedPlanItem[]\n}\n"],"names":[],"mappings":"AAAA;;CAEC,GAED;;CAEC,GAmCD;;CAEC,GACD,WASC"}
@@ -1,5 +1,4 @@
1
- export var Flavor;
2
- (function (Flavor) {
1
+ export var Flavor = /*#__PURE__*/ function(Flavor) {
3
2
  Flavor[Flavor["Avatar"] = 0] = "Avatar";
4
3
  Flavor[Flavor["Cover"] = 1] = "Cover";
5
4
  Flavor[Flavor["Animation"] = 2] = "Animation";
@@ -9,9 +8,9 @@ export var Flavor;
9
8
  Flavor[Flavor["Terms"] = 6] = "Terms";
10
9
  Flavor[Flavor["Private"] = 7] = "Private";
11
10
  Flavor[Flavor["SampleData"] = 8] = "SampleData";
12
- })(Flavor || (Flavor = {}));
13
- export var FlavorFolder;
14
- (function (FlavorFolder) {
11
+ return Flavor;
12
+ }({});
13
+ export var FlavorFolder = /*#__PURE__*/ function(FlavorFolder) {
15
14
  FlavorFolder["Avatars"] = "avatars";
16
15
  FlavorFolder["Covers"] = "covers";
17
16
  FlavorFolder["Animations"] = "animations";
@@ -21,10 +20,13 @@ export var FlavorFolder;
21
20
  FlavorFolder["Terms"] = "terms";
22
21
  FlavorFolder["Privates"] = "private";
23
22
  FlavorFolder["SampleData"] = "sample-data";
24
- })(FlavorFolder || (FlavorFolder = {}));
25
- export var TranscodingStatus;
26
- (function (TranscodingStatus) {
23
+ return FlavorFolder;
24
+ }({});
25
+ export var TranscodingStatus = /*#__PURE__*/ function(TranscodingStatus) {
27
26
  TranscodingStatus["Pending"] = "Pending";
28
27
  TranscodingStatus["Done"] = "Done";
29
28
  TranscodingStatus["Error"] = "Error";
30
- })(TranscodingStatus || (TranscodingStatus = {}));
29
+ return TranscodingStatus;
30
+ }({});
31
+
32
+ //# sourceMappingURL=TranscoderTypes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/lib/types/TranscoderTypes.ts"],"sourcesContent":["export enum Flavor {\n Avatar = 0,\n Cover = 1,\n Animation = 2,\n Image = 3,\n Video = 4,\n Audio = 5,\n Terms = 6,\n Private = 7,\n SampleData = 8,\n}\n\nexport enum FlavorFolder {\n Avatars = 'avatars',\n Covers = 'covers',\n Animations = 'animations',\n Images = 'images',\n Videos = 'videos',\n Audios = 'audios',\n Terms = 'terms',\n Privates = 'private',\n SampleData = 'sample-data',\n}\n\nexport enum TranscodingStatus {\n Pending = 'Pending',\n Done = 'Done',\n Error = 'Error',\n}\n"],"names":["Flavor","FlavorFolder","TranscodingStatus"],"mappings":"AAAA,OAAO,IAAA,AAAKA,gCAAAA;;;;;;;;;;WAAAA;MAUX;AAED,OAAO,IAAA,AAAKC,sCAAAA;;;;;;;;;;WAAAA;MAUX;AAED,OAAO,IAAA,AAAKC,2CAAAA;;;;WAAAA;MAIX"}
@@ -5,3 +5,5 @@ export * from './MetadataTypes.js';
5
5
  export * from './TransactionTypes.js';
6
6
  export * from './TranscoderTypes.js';
7
7
  export * from './types.js';
8
+
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/lib/types/index.ts"],"sourcesContent":["export * from './ContractsTypes.js'\nexport * from './DDOTypes.js'\nexport * from './GeneralTypes.js'\nexport * from './MetadataTypes.js'\nexport * from './TransactionTypes.js'\nexport * from './TranscoderTypes.js'\nexport * from './types.js'\n"],"names":[],"mappings":"AAAA,cAAc,sBAAqB;AACnC,cAAc,gBAAe;AAC7B,cAAc,oBAAmB;AACjC,cAAc,qBAAoB;AAClC,cAAc,wBAAuB;AACrC,cAAc,uBAAsB;AACpC,cAAc,aAAY"}
@@ -224,9 +224,22 @@ export declare const NVM_USERID_HEADER = "NVM-User-id";
224
224
  export declare const NVM_COST_HEADER = "NVMCreditsConsumed";
225
225
  export declare const DEFAULT_COST_CREDITS = "1";
226
226
  export declare enum OrganizationType {
227
- Free = "Free",
228
227
  Premium = "Premium",
229
228
  Enterprise = "Enterprise",
229
+ /**
230
+ * An org whose paid subscription has lapsed past `currentPeriodEnd`.
231
+ * The org still exists (rows aren't deleted) but no Premium feature
232
+ * gates clear. Webhooks + lapse cron set this; new orgs are never
233
+ * created in this state. Replaces the old `Free` value which was
234
+ * misnamed — a paid-but-expired state was being shown as "Free"
235
+ * which overlapped semantically with non-org personal accounts.
236
+ */
237
+ Lapsed = "Lapsed",
238
+ /**
239
+ * Legacy bucket for orgs pre-dating tiers (pre-Phase 2). Inherits
240
+ * Premium caps + features so existing orgs aren't unfairly blocked.
241
+ * Not assigned by any new code path.
242
+ */
230
243
  Other = "Other"
231
244
  }
232
245
  export declare enum OrganizationMemberRole {
@@ -243,6 +256,28 @@ export declare enum OrganizationInvitationStatus {
243
256
  Revoked = "revoked",
244
257
  Expired = "expired"
245
258
  }
259
+ export declare enum OrganizationTierCurrency {
260
+ USD = "USD",
261
+ EUR = "EUR",
262
+ USDC = "USDC",
263
+ EURC = "EURC"
264
+ }
265
+ export declare enum OrganizationTierInterval {
266
+ Month = "month",
267
+ Year = "year",
268
+ OneShot = "one_shot"
269
+ }
270
+ export declare enum OrganizationTierSource {
271
+ StripeSubscription = "stripe_subscription",
272
+ CryptoOneShot = "crypto_one_shot"
273
+ }
274
+ export declare enum OrganizationSubscriptionStatus {
275
+ Active = "active",
276
+ PastDue = "past_due",
277
+ Canceled = "canceled",
278
+ Lapsed = "lapsed",
279
+ Trialing = "trialing"
280
+ }
246
281
  export declare enum UserProfileType {
247
282
  Merchant = "merchant",
248
283
  Consumer = "consumer",
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/lib/types/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAE5B,oBAAY,SAAS;IACnB,KAAK,UAAU;CAChB;AAED,MAAM,WAAW,QAAQ;IACvB,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,CAAC,EAAE,SAAS,EAAE,CAAA;IACnB,SAAS,CAAC,EAAE,IAAI,CAAC,UAAU,CAAA;CAC5B;AAED,MAAM,WAAW,OAAO,CAAC,CAAC;IACxB,QAAQ,EAAE,MAAM,CAAA;IAChB,IAAI,CAAC,EAAE,CAAC,CAAA;IACR,KAAK,CAAC,EAAE,CAAC,CAAA;IACT,MAAM,CAAC,EAAE,CAAC,CAAA;IACV,MAAM,EAAE;QAAE,SAAS,EAAE,MAAM,CAAA;KAAE,CAAA;IAC7B,QAAQ,EAAE,MAAM,CAAA;IAChB,GAAG,EAAE,MAAM,CAAA;IACX,IAAI,CAAC,EAAE,QAAQ,CAAA;CAChB;AAED,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,EAAE,MAAM,CAAA;IACZ,UAAU,EAAE,MAAM,CAAA;IAClB,YAAY,EAAE,MAAM,CAAA;IACpB,OAAO,EAAE,GAAG,EAAE,CAAA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,yBAAyB,CAAC,EAAE,MAAM,CAAA;IAClC,sBAAsB,CAAC,EAAE,MAAM,CAAA;IAC/B,yBAAyB,CAAC,EAAE,MAAM,CAAA;IAClC,yBAAyB,CAAC,EAAE,MAAM,CAAA;IAClC,2BAA2B,CAAC,EAAE,MAAM,CAAA;IAGpC,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,8BAA8B,CAAC,EAAE,MAAM,CAAA;IACvC,wBAAwB,CAAC,EAAE,MAAM,CAAA;IACjC,yBAAyB,CAAC,EAAE,MAAM,CAAA;IAClC,yBAAyB,CAAC,EAAE,MAAM,CAAA;IAClC,2BAA2B,CAAC,EAAE,MAAM,CAAA;CACrC;AAMD;;;;;;;;GAQG;AACH,oBAAY,6BAA6B;IAEvC,cAAc,mBAAmB;IACjC,aAAa,kBAAkB;IAC/B,mBAAmB,wBAAwB;IAC3C,kBAAkB,uBAAuB;IACzC,kBAAkB,uBAAuB;IACzC,cAAc,mBAAmB;IACjC,kBAAkB,uBAAuB;IACzC,kBAAkB,uBAAuB;IAEzC,aAAa,kBAAkB;IAC/B,YAAY,iBAAiB;IAC7B,cAAc,mBAAmB;IAEjC,cAAc,mBAAmB;IACjC,gBAAgB,qBAAqB;IACrC,kBAAkB,uBAAuB;IAEzC,iBAAiB,sBAAsB;IACvC,cAAc,mBAAmB;CAClC;AAMD;;;GAGG;AACH,oBAAY,qCAAqC;IAC/C,OAAO,YAAY;IACnB,MAAM,WAAW;IACjB,OAAO,YAAY;CACpB;AAED;;;GAGG;AACH,oBAAY,qBAAqB;IAC/B,OAAO,YAAY;IACnB,QAAQ,cAAc;IACtB,SAAS,cAAc;IACvB,MAAM,WAAW;IACjB,IAAI,SAAS;CACd"}
@@ -1,9 +1,8 @@
1
- export var AuthRoles;
2
- (function (AuthRoles) {
1
+ export var AuthRoles = /*#__PURE__*/ function(AuthRoles) {
3
2
  AuthRoles["Admin"] = "admin";
4
- })(AuthRoles || (AuthRoles = {}));
5
- export var PointsRulesCategory;
6
- (function (PointsRulesCategory) {
3
+ return AuthRoles;
4
+ }({});
5
+ export var PointsRulesCategory = /*#__PURE__*/ function(PointsRulesCategory) {
7
6
  PointsRulesCategory["wau"] = "wau";
8
7
  PointsRulesCategory["supply"] = "supply";
9
8
  PointsRulesCategory["purchases"] = "purchases";
@@ -11,9 +10,9 @@ export var PointsRulesCategory;
11
10
  PointsRulesCategory["curation"] = "curation";
12
11
  PointsRulesCategory["network"] = "network";
13
12
  PointsRulesCategory["other"] = "other";
14
- })(PointsRulesCategory || (PointsRulesCategory = {}));
15
- export var PointsRulesRecurrency;
16
- (function (PointsRulesRecurrency) {
13
+ return PointsRulesCategory;
14
+ }({});
15
+ export var PointsRulesRecurrency = /*#__PURE__*/ function(PointsRulesRecurrency) {
17
16
  PointsRulesRecurrency["unlimitted"] = "unlimitted";
18
17
  PointsRulesRecurrency["timeslimitted"] = "timeslimitted";
19
18
  PointsRulesRecurrency["onlyonce"] = "onlyonce";
@@ -23,52 +22,52 @@ export var PointsRulesRecurrency;
23
22
  PointsRulesRecurrency["capmonth"] = "capmonth";
24
23
  PointsRulesRecurrency["capyear"] = "capyear";
25
24
  PointsRulesRecurrency["other"] = "other";
26
- })(PointsRulesRecurrency || (PointsRulesRecurrency = {}));
27
- export var PointsEventStatus;
28
- (function (PointsEventStatus) {
25
+ return PointsRulesRecurrency;
26
+ }({});
27
+ export var PointsEventStatus = /*#__PURE__*/ function(PointsEventStatus) {
29
28
  PointsEventStatus["Pending"] = "Pending";
30
29
  PointsEventStatus["Processed"] = "Processed";
31
30
  PointsEventStatus["Failed"] = "Failed";
32
31
  PointsEventStatus["Skipped"] = "Skipped";
33
32
  PointsEventStatus["Other"] = "Other";
34
- })(PointsEventStatus || (PointsEventStatus = {}));
35
- export var NotificationType;
36
- (function (NotificationType) {
33
+ return PointsEventStatus;
34
+ }({});
35
+ export var NotificationType = /*#__PURE__*/ function(NotificationType) {
37
36
  NotificationType["SubscriptionReceived"] = "SubscriptionReceived";
38
37
  NotificationType["SubscriptionPurchased"] = "SubscriptionPurchased";
39
38
  NotificationType["AccountSetup"] = "AccountSetup";
40
39
  NotificationType["EmailValidation"] = "EmailValidation";
41
40
  NotificationType["Other"] = "Other";
42
- })(NotificationType || (NotificationType = {}));
43
- export var NotificationOriginator;
44
- (function (NotificationOriginator) {
41
+ return NotificationType;
42
+ }({});
43
+ export var NotificationOriginator = /*#__PURE__*/ function(NotificationOriginator) {
45
44
  NotificationOriginator["Nevermined"] = "Nevermined";
46
45
  NotificationOriginator["Other"] = "Other";
47
- })(NotificationOriginator || (NotificationOriginator = {}));
48
- export var NotificationReadStatus;
49
- (function (NotificationReadStatus) {
46
+ return NotificationOriginator;
47
+ }({});
48
+ export var NotificationReadStatus = /*#__PURE__*/ function(NotificationReadStatus) {
50
49
  NotificationReadStatus["Pending"] = "Pending";
51
50
  NotificationReadStatus["Read"] = "Read";
52
51
  NotificationReadStatus["Deleted"] = "Deleted";
53
52
  NotificationReadStatus["Other"] = "Other";
54
- })(NotificationReadStatus || (NotificationReadStatus = {}));
55
- export var NotificationDeliveryStatus;
56
- (function (NotificationDeliveryStatus) {
53
+ return NotificationReadStatus;
54
+ }({});
55
+ export var NotificationDeliveryStatus = /*#__PURE__*/ function(NotificationDeliveryStatus) {
57
56
  NotificationDeliveryStatus["Pending"] = "Pending";
58
57
  NotificationDeliveryStatus["Sent"] = "Sent";
59
58
  NotificationDeliveryStatus["Failed"] = "Failed";
60
59
  NotificationDeliveryStatus["NotRequired"] = "NotRequired";
61
60
  NotificationDeliveryStatus["Skipped"] = "Skipped";
62
61
  NotificationDeliveryStatus["Other"] = "Other";
63
- })(NotificationDeliveryStatus || (NotificationDeliveryStatus = {}));
64
- export var EmailChallengeStatus;
65
- (function (EmailChallengeStatus) {
62
+ return NotificationDeliveryStatus;
63
+ }({});
64
+ export var EmailChallengeStatus = /*#__PURE__*/ function(EmailChallengeStatus) {
66
65
  EmailChallengeStatus["Pending"] = "Pending";
67
66
  EmailChallengeStatus["Validated"] = "Validated";
68
67
  EmailChallengeStatus["Failed"] = "Failed";
69
- })(EmailChallengeStatus || (EmailChallengeStatus = {}));
70
- export var PlanTransactionType;
71
- (function (PlanTransactionType) {
68
+ return EmailChallengeStatus;
69
+ }({});
70
+ export var PlanTransactionType = /*#__PURE__*/ function(PlanTransactionType) {
72
71
  PlanTransactionType["Purchase"] = "Purchase";
73
72
  PlanTransactionType["Mint"] = "Mint";
74
73
  PlanTransactionType["Burn"] = "Burn";
@@ -81,12 +80,13 @@ export var PlanTransactionType;
81
80
  PlanTransactionType["CreditExpired"] = "CreditExpired";
82
81
  PlanTransactionType["CreditBackfill"] = "CreditBackfill";
83
82
  PlanTransactionType["CreditRefund"] = "CreditRefund";
84
- })(PlanTransactionType || (PlanTransactionType = {}));
85
- export var PlanTransactionPaymentType;
86
- (function (PlanTransactionPaymentType) {
83
+ return PlanTransactionType;
84
+ }({});
85
+ export var PlanTransactionPaymentType = /*#__PURE__*/ function(PlanTransactionPaymentType) {
87
86
  PlanTransactionPaymentType["Crypto"] = "Crypto";
88
87
  PlanTransactionPaymentType["Fiat"] = "Fiat";
89
- })(PlanTransactionPaymentType || (PlanTransactionPaymentType = {}));
88
+ return PlanTransactionPaymentType;
89
+ }({});
90
90
  /**
91
91
  * Settlement-reconciliation state for a plan transaction.
92
92
  *
@@ -98,42 +98,40 @@ export var PlanTransactionPaymentType;
98
98
  * matches the merchant's bank credit.
99
99
  * - `Failed`: a reconciliation attempt could not resolve the row against
100
100
  * the processor (e.g. missing charge, transient API error after retries).
101
- */
102
- export var PlanTransactionReconciliationStatus;
103
- (function (PlanTransactionReconciliationStatus) {
101
+ */ export var PlanTransactionReconciliationStatus = /*#__PURE__*/ function(PlanTransactionReconciliationStatus) {
104
102
  PlanTransactionReconciliationStatus["NotApplicable"] = "NotApplicable";
105
103
  PlanTransactionReconciliationStatus["Pending"] = "Pending";
106
104
  PlanTransactionReconciliationStatus["Settled"] = "Settled";
107
105
  PlanTransactionReconciliationStatus["Failed"] = "Failed";
108
- })(PlanTransactionReconciliationStatus || (PlanTransactionReconciliationStatus = {}));
109
- export var CheckoutSessionType;
110
- (function (CheckoutSessionType) {
106
+ return PlanTransactionReconciliationStatus;
107
+ }({});
108
+ export var CheckoutSessionType = /*#__PURE__*/ function(CheckoutSessionType) {
111
109
  CheckoutSessionType["embedded"] = "embedded";
112
110
  CheckoutSessionType["redirect"] = "redirect";
113
- })(CheckoutSessionType || (CheckoutSessionType = {}));
114
- export var WidgetLayout;
115
- (function (WidgetLayout) {
111
+ return CheckoutSessionType;
112
+ }({});
113
+ export var WidgetLayout = /*#__PURE__*/ function(WidgetLayout) {
116
114
  WidgetLayout["Horizontal"] = "Horizontal";
117
115
  WidgetLayout["Vertical"] = "Vertical";
118
116
  WidgetLayout["Reduced"] = "Reduced";
119
- })(WidgetLayout || (WidgetLayout = {}));
120
- export var StripeEventStatus;
121
- (function (StripeEventStatus) {
117
+ return WidgetLayout;
118
+ }({});
119
+ export var StripeEventStatus = /*#__PURE__*/ function(StripeEventStatus) {
122
120
  StripeEventStatus["Pending"] = "Pending";
123
121
  StripeEventStatus["Done"] = "Done";
124
122
  StripeEventStatus["Error"] = "Error";
125
123
  StripeEventStatus["Ignored"] = "Ignored";
126
124
  StripeEventStatus["Other"] = "Other";
127
- })(StripeEventStatus || (StripeEventStatus = {}));
128
- export var ResultType;
129
- (function (ResultType) {
125
+ return StripeEventStatus;
126
+ }({});
127
+ export var ResultType = /*#__PURE__*/ function(ResultType) {
130
128
  ResultType["matrix"] = "matrix";
131
129
  ResultType["vector"] = "vector";
132
130
  ResultType["scalar"] = "scalar";
133
131
  ResultType["string"] = "string";
134
- })(ResultType || (ResultType = {}));
135
- export var ApiKeyTxType;
136
- (function (ApiKeyTxType) {
132
+ return ResultType;
133
+ }({});
134
+ export var ApiKeyTxType = /*#__PURE__*/ function(ApiKeyTxType) {
137
135
  ApiKeyTxType["NewPlan"] = "NewPlan";
138
136
  ApiKeyTxType["NewAgent"] = "NewAgent";
139
137
  ApiKeyTxType["EditPlan"] = "EditPlan";
@@ -145,54 +143,92 @@ export var ApiKeyTxType;
145
143
  ApiKeyTxType["Burn"] = "Burn";
146
144
  ApiKeyTxType["AgentExecution"] = "AgentExecution";
147
145
  ApiKeyTxType["Other"] = "Other";
148
- })(ApiKeyTxType || (ApiKeyTxType = {}));
146
+ return ApiKeyTxType;
147
+ }({});
149
148
  export const DEFAULT_PAGE = 1;
150
149
  export const DEFAULT_OFFSET = 10_000;
151
- export var TaskLogLevel;
152
- (function (TaskLogLevel) {
150
+ export var TaskLogLevel = /*#__PURE__*/ function(TaskLogLevel) {
153
151
  TaskLogLevel["debug"] = "debug";
154
152
  TaskLogLevel["info"] = "info";
155
153
  TaskLogLevel["warn"] = "warn";
156
154
  TaskLogLevel["error"] = "error";
157
- })(TaskLogLevel || (TaskLogLevel = {}));
158
- export var PaymentPlanTypes;
159
- (function (PaymentPlanTypes) {
155
+ return TaskLogLevel;
156
+ }({});
157
+ export var PaymentPlanTypes = /*#__PURE__*/ function(PaymentPlanTypes) {
160
158
  PaymentPlanTypes["expirable"] = "expirable";
161
159
  PaymentPlanTypes["credits"] = "credits";
162
- })(PaymentPlanTypes || (PaymentPlanTypes = {}));
160
+ return PaymentPlanTypes;
161
+ }({});
163
162
  export const NVM_USERID_HEADER = 'NVM-User-id';
164
163
  export const NVM_COST_HEADER = 'NVMCreditsConsumed';
165
164
  export const DEFAULT_COST_CREDITS = '1';
166
- export var OrganizationType;
167
- (function (OrganizationType) {
168
- OrganizationType["Free"] = "Free";
165
+ export var OrganizationType = /*#__PURE__*/ function(OrganizationType) {
169
166
  OrganizationType["Premium"] = "Premium";
170
167
  OrganizationType["Enterprise"] = "Enterprise";
171
- OrganizationType["Other"] = "Other";
172
- })(OrganizationType || (OrganizationType = {}));
173
- export var OrganizationMemberRole;
174
- (function (OrganizationMemberRole) {
168
+ /**
169
+ * An org whose paid subscription has lapsed past `currentPeriodEnd`.
170
+ * The org still exists (rows aren't deleted) but no Premium feature
171
+ * gates clear. Webhooks + lapse cron set this; new orgs are never
172
+ * created in this state. Replaces the old `Free` value which was
173
+ * misnamed — a paid-but-expired state was being shown as "Free"
174
+ * which overlapped semantically with non-org personal accounts.
175
+ */ OrganizationType["Lapsed"] = "Lapsed";
176
+ /**
177
+ * Legacy bucket for orgs pre-dating tiers (pre-Phase 2). Inherits
178
+ * Premium caps + features so existing orgs aren't unfairly blocked.
179
+ * Not assigned by any new code path.
180
+ */ OrganizationType["Other"] = "Other";
181
+ return OrganizationType;
182
+ }({});
183
+ export var OrganizationMemberRole = /*#__PURE__*/ function(OrganizationMemberRole) {
175
184
  OrganizationMemberRole["Admin"] = "Admin";
176
185
  OrganizationMemberRole["Member"] = "Member";
177
- })(OrganizationMemberRole || (OrganizationMemberRole = {}));
178
- export var OrganizationCustomerStatus;
179
- (function (OrganizationCustomerStatus) {
186
+ return OrganizationMemberRole;
187
+ }({});
188
+ export var OrganizationCustomerStatus = /*#__PURE__*/ function(OrganizationCustomerStatus) {
180
189
  OrganizationCustomerStatus["Active"] = "active";
181
190
  OrganizationCustomerStatus["Blocked"] = "blocked";
182
- })(OrganizationCustomerStatus || (OrganizationCustomerStatus = {}));
183
- export var OrganizationInvitationStatus;
184
- (function (OrganizationInvitationStatus) {
191
+ return OrganizationCustomerStatus;
192
+ }({});
193
+ export var OrganizationInvitationStatus = /*#__PURE__*/ function(OrganizationInvitationStatus) {
185
194
  OrganizationInvitationStatus["Pending"] = "pending";
186
195
  OrganizationInvitationStatus["Accepted"] = "accepted";
187
196
  OrganizationInvitationStatus["Revoked"] = "revoked";
188
197
  OrganizationInvitationStatus["Expired"] = "expired";
189
- })(OrganizationInvitationStatus || (OrganizationInvitationStatus = {}));
190
- export var UserProfileType;
191
- (function (UserProfileType) {
198
+ return OrganizationInvitationStatus;
199
+ }({});
200
+ export var OrganizationTierCurrency = /*#__PURE__*/ function(OrganizationTierCurrency) {
201
+ OrganizationTierCurrency["USD"] = "USD";
202
+ OrganizationTierCurrency["EUR"] = "EUR";
203
+ OrganizationTierCurrency["USDC"] = "USDC";
204
+ OrganizationTierCurrency["EURC"] = "EURC";
205
+ return OrganizationTierCurrency;
206
+ }({});
207
+ export var OrganizationTierInterval = /*#__PURE__*/ function(OrganizationTierInterval) {
208
+ OrganizationTierInterval["Month"] = "month";
209
+ OrganizationTierInterval["Year"] = "year";
210
+ OrganizationTierInterval["OneShot"] = "one_shot";
211
+ return OrganizationTierInterval;
212
+ }({});
213
+ export var OrganizationTierSource = /*#__PURE__*/ function(OrganizationTierSource) {
214
+ OrganizationTierSource["StripeSubscription"] = "stripe_subscription";
215
+ OrganizationTierSource["CryptoOneShot"] = "crypto_one_shot";
216
+ return OrganizationTierSource;
217
+ }({});
218
+ export var OrganizationSubscriptionStatus = /*#__PURE__*/ function(OrganizationSubscriptionStatus) {
219
+ OrganizationSubscriptionStatus["Active"] = "active";
220
+ OrganizationSubscriptionStatus["PastDue"] = "past_due";
221
+ OrganizationSubscriptionStatus["Canceled"] = "canceled";
222
+ OrganizationSubscriptionStatus["Lapsed"] = "lapsed";
223
+ OrganizationSubscriptionStatus["Trialing"] = "trialing";
224
+ return OrganizationSubscriptionStatus;
225
+ }({});
226
+ export var UserProfileType = /*#__PURE__*/ function(UserProfileType) {
192
227
  UserProfileType["Merchant"] = "merchant";
193
228
  UserProfileType["Consumer"] = "consumer";
194
229
  UserProfileType["Hybrid"] = "hybrid";
195
- })(UserProfileType || (UserProfileType = {}));
230
+ return UserProfileType;
231
+ }({});
196
232
  // ---------------------------------------------------------------------------
197
233
  // Activity Feed — event vocabulary (Stage 3a)
198
234
  // ---------------------------------------------------------------------------
@@ -204,9 +240,7 @@ export var UserProfileType;
204
240
  *
205
241
  * Stage 3b (webhooks) will wire WEBHOOK_* emit calls.
206
242
  * Stage 4 (customers) will wire CUSTOMER_* emit calls.
207
- */
208
- export var OrganizationActivityEventType;
209
- (function (OrganizationActivityEventType) {
243
+ */ export var OrganizationActivityEventType = /*#__PURE__*/ function(OrganizationActivityEventType) {
210
244
  // Membership lifecycle
211
245
  OrganizationActivityEventType["MEMBER_INVITED"] = "member.invited";
212
246
  OrganizationActivityEventType["MEMBER_JOINED"] = "member.joined";
@@ -227,29 +261,30 @@ export var OrganizationActivityEventType;
227
261
  // Webhook delivery (Stage 3b adds emit)
228
262
  OrganizationActivityEventType["WEBHOOK_DELIVERED"] = "webhook.delivered";
229
263
  OrganizationActivityEventType["WEBHOOK_FAILED"] = "webhook.failed";
230
- })(OrganizationActivityEventType || (OrganizationActivityEventType = {}));
264
+ return OrganizationActivityEventType;
265
+ }({});
231
266
  // ---------------------------------------------------------------------------
232
267
  // Webhook subscription + delivery status enums (Stage 3b)
233
268
  // ---------------------------------------------------------------------------
234
269
  /**
235
270
  * Status of the last delivery attempt on a webhook subscription.
236
271
  * Stored as varchar on OrganizationWebhookSubscriptionEntity.
237
- */
238
- export var WebhookSubscriptionLastDeliveryStatus;
239
- (function (WebhookSubscriptionLastDeliveryStatus) {
272
+ */ export var WebhookSubscriptionLastDeliveryStatus = /*#__PURE__*/ function(WebhookSubscriptionLastDeliveryStatus) {
240
273
  WebhookSubscriptionLastDeliveryStatus["Success"] = "success";
241
274
  WebhookSubscriptionLastDeliveryStatus["Failed"] = "failed";
242
275
  WebhookSubscriptionLastDeliveryStatus["Pending"] = "pending";
243
- })(WebhookSubscriptionLastDeliveryStatus || (WebhookSubscriptionLastDeliveryStatus = {}));
276
+ return WebhookSubscriptionLastDeliveryStatus;
277
+ }({});
244
278
  /**
245
279
  * Lifecycle status of a single webhook delivery row.
246
280
  * Stored as varchar on OrganizationWebhookDeliveryEntity.
247
- */
248
- export var WebhookDeliveryStatus;
249
- (function (WebhookDeliveryStatus) {
281
+ */ export var WebhookDeliveryStatus = /*#__PURE__*/ function(WebhookDeliveryStatus) {
250
282
  WebhookDeliveryStatus["Pending"] = "pending";
251
283
  WebhookDeliveryStatus["InFlight"] = "in_flight";
252
284
  WebhookDeliveryStatus["Delivered"] = "delivered";
253
285
  WebhookDeliveryStatus["Failed"] = "failed";
254
286
  WebhookDeliveryStatus["Dead"] = "dead";
255
- })(WebhookDeliveryStatus || (WebhookDeliveryStatus = {}));
287
+ return WebhookDeliveryStatus;
288
+ }({});
289
+
290
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/lib/types/types.ts"],"sourcesContent":["import * as jose from 'jose'\n\nexport enum AuthRoles {\n Admin = 'admin',\n}\n\nexport interface AuthUser {\n userId: string\n address: string\n hash: string\n roles?: AuthRoles[]\n nvmApiKey?: jose.JWTPayload\n}\n\nexport interface Request<G> {\n hostname: string\n body?: G\n query?: G\n params?: G\n client: { localPort: number }\n protocol: string\n url: string\n user?: AuthUser\n}\n\nexport type DistinctPlans = {\n page: number\n totalPages: number\n totalResults: number\n results: any[]\n}\n\nexport enum PointsRulesCategory {\n wau = 'wau',\n supply = 'supply',\n purchases = 'purchases',\n demand = 'demand',\n curation = 'curation',\n network = 'network',\n other = 'other',\n}\n\nexport enum PointsRulesRecurrency {\n unlimitted = 'unlimitted',\n timeslimitted = 'timeslimitted',\n onlyonce = 'onlyonce',\n onceperitem = 'onceperitem',\n capday = 'capday',\n capweek = 'capweek',\n capmonth = 'capmonth',\n capyear = 'capyear',\n other = 'other',\n}\n\nexport enum PointsEventStatus {\n Pending = 'Pending',\n Processed = 'Processed',\n Failed = 'Failed',\n Skipped = 'Skipped',\n Other = 'Other',\n}\n\nexport enum NotificationType {\n SubscriptionReceived = 'SubscriptionReceived',\n SubscriptionPurchased = 'SubscriptionPurchased',\n AccountSetup = 'AccountSetup',\n EmailValidation = 'EmailValidation',\n Other = 'Other',\n}\n\nexport enum NotificationOriginator {\n Nevermined = 'Nevermined',\n Other = 'Other',\n}\n\nexport enum NotificationReadStatus {\n Pending = 'Pending',\n Read = 'Read',\n Deleted = 'Deleted',\n Other = 'Other',\n}\n\nexport enum NotificationDeliveryStatus {\n Pending = 'Pending',\n Sent = 'Sent',\n Failed = 'Failed',\n NotRequired = 'NotRequired',\n Skipped = 'Skipped',\n Other = 'Other',\n}\n\nexport enum EmailChallengeStatus {\n Pending = 'Pending',\n Validated = 'Validated',\n Failed = 'Failed',\n}\n\nexport enum PlanTransactionType {\n Purchase = 'Purchase',\n Mint = 'Mint',\n Burn = 'Burn',\n Transfer = 'Transfer',\n Error = 'Error',\n Other = 'Other',\n // Off-chain credits event log (nvm-monorepo#1276).\n CreditMint = 'CreditMint',\n CreditBurn = 'CreditBurn',\n CreditExpired = 'CreditExpired',\n CreditBackfill = 'CreditBackfill',\n CreditRefund = 'CreditRefund',\n}\n\nexport enum PlanTransactionPaymentType {\n Crypto = 'Crypto',\n Fiat = 'Fiat',\n}\n\n/**\n * Settlement-reconciliation state for a plan transaction.\n *\n * - `NotApplicable`: no external processor — crypto rows, or any row where\n * there is nothing to reconcile against.\n * - `Pending`: fiat charge created but the processor's real fee / net has\n * not yet been captured (Stripe typically settles T+2).\n * - `Settled`: the real processor fee is in `stripeFee` and `ownerMargin`\n * matches the merchant's bank credit.\n * - `Failed`: a reconciliation attempt could not resolve the row against\n * the processor (e.g. missing charge, transient API error after retries).\n */\nexport enum PlanTransactionReconciliationStatus {\n NotApplicable = 'NotApplicable',\n Pending = 'Pending',\n Settled = 'Settled',\n Failed = 'Failed',\n}\n\nexport enum CheckoutSessionType {\n embedded = 'embedded',\n redirect = 'redirect',\n}\n\nexport enum WidgetLayout {\n Horizontal = 'Horizontal',\n Vertical = 'Vertical',\n Reduced = 'Reduced',\n}\n\nexport enum StripeEventStatus {\n Pending = 'Pending',\n Done = 'Done',\n Error = 'Error',\n Ignored = 'Ignored',\n Other = 'Other',\n}\n\nexport enum ResultType {\n matrix = 'matrix',\n vector = 'vector',\n scalar = 'scalar',\n string = 'string',\n}\n\nexport enum ApiKeyTxType {\n NewPlan = 'NewPlan',\n NewAgent = 'NewAgent',\n EditPlan = 'EditPlan',\n EditAgent = 'EditAgent',\n Purchase = 'Purchase',\n Download = 'Download',\n AccessHit = 'AccessHit',\n Mint = 'Mint',\n Burn = 'Burn',\n AgentExecution = 'AgentExecution',\n Other = 'Other',\n}\n\nexport interface Metric {\n consumer: string\n did: string\n endpoint: string\n job: string\n namespace: string\n owner: string\n access_date: Date\n}\n\nexport interface AccessHistory {\n date: string\n owner: string\n consumer: string\n endpoint: string\n}\n\nexport interface LineItem {\n planId: string\n currency: string\n name: string\n price: number\n quantity: number\n description?: string\n imageUrl?: string\n}\n\nexport interface StripeLineItem {\n price_data: {\n currency: string\n product_data: {\n name: string\n description?: string\n images?: string[]\n metadata?: [string, string]\n }\n unit_amount_decimal: number\n }\n quantity: number\n}\n\nexport const DEFAULT_PAGE = 1\nexport const DEFAULT_OFFSET = 10_000\n\nexport interface PaginationOptions {\n page: number\n skip: number\n offset: number\n sortBy?: string\n sortOrder?: 'asc' | 'desc'\n}\n\nexport enum TaskLogLevel {\n debug = 'debug',\n info = 'info',\n warn = 'warn',\n error = 'error',\n}\n\nexport enum PaymentPlanTypes {\n expirable = 'expirable',\n credits = 'credits',\n}\n\nexport interface OrderResult {\n txHash: `0x${string}`\n planId: bigint\n planReceiver: `0x${string}`\n currency: string\n totalAmount: bigint\n numCredits: bigint\n paymentMethod: PlanTransactionPaymentType\n tokenAddress?: `0x${string}`\n}\n\nexport const NVM_USERID_HEADER = 'NVM-User-id'\nexport const NVM_COST_HEADER = 'NVMCreditsConsumed'\nexport const DEFAULT_COST_CREDITS = '1'\n\nexport enum OrganizationType {\n Premium = 'Premium',\n Enterprise = 'Enterprise',\n /**\n * An org whose paid subscription has lapsed past `currentPeriodEnd`.\n * The org still exists (rows aren't deleted) but no Premium feature\n * gates clear. Webhooks + lapse cron set this; new orgs are never\n * created in this state. Replaces the old `Free` value which was\n * misnamed — a paid-but-expired state was being shown as \"Free\"\n * which overlapped semantically with non-org personal accounts.\n */\n Lapsed = 'Lapsed',\n /**\n * Legacy bucket for orgs pre-dating tiers (pre-Phase 2). Inherits\n * Premium caps + features so existing orgs aren't unfairly blocked.\n * Not assigned by any new code path.\n */\n Other = 'Other',\n}\n\nexport enum OrganizationMemberRole {\n Admin = 'Admin',\n Member = 'Member',\n}\n\nexport enum OrganizationCustomerStatus {\n Active = 'active',\n Blocked = 'blocked',\n}\n\nexport enum OrganizationInvitationStatus {\n Pending = 'pending',\n Accepted = 'accepted',\n Revoked = 'revoked',\n Expired = 'expired',\n}\n\nexport enum OrganizationTierCurrency {\n USD = 'USD',\n EUR = 'EUR',\n USDC = 'USDC',\n EURC = 'EURC',\n}\n\nexport enum OrganizationTierInterval {\n Month = 'month',\n Year = 'year',\n OneShot = 'one_shot',\n}\n\nexport enum OrganizationTierSource {\n StripeSubscription = 'stripe_subscription',\n CryptoOneShot = 'crypto_one_shot',\n}\n\nexport enum OrganizationSubscriptionStatus {\n Active = 'active',\n PastDue = 'past_due',\n Canceled = 'canceled',\n Lapsed = 'lapsed',\n Trialing = 'trialing',\n}\n\nexport enum UserProfileType {\n Merchant = 'merchant',\n Consumer = 'consumer',\n Hybrid = 'hybrid',\n}\n\nexport interface Branding {\n // Theme name (e.g., 'default', 'gradient', 'dark', 'ocean', 'sunset', 'custom')\n themeName?: string\n\n // Company logo\n logo?: string\n\n // Left panel colors\n leftPanelHeadingTextColor?: string\n leftPanelBodyTextColor?: string\n leftPanelBackgroundColor1?: string\n leftPanelBackgroundColor2?: string\n leftPanelBackgroundImageUrl?: string // Alternative to background colors\n\n // Right card colors\n rightCardTextColor?: string\n rightCardButtonBackgroundColor?: string\n rightCardButtonTextColor?: string\n rightCardBackgroundColor1?: string\n rightCardBackgroundColor2?: string\n rightCardBackgroundImageUrl?: string // Alternative to background colors\n}\n\n// ---------------------------------------------------------------------------\n// Activity Feed — event vocabulary (Stage 3a)\n// ---------------------------------------------------------------------------\n\n/**\n * All event types that can be recorded in the organization activity feed.\n *\n * Stored as varchar strings in Postgres so new values can be added without\n * ALTER TYPE migrations (forward-compatible with Postgres enum limitations).\n *\n * Stage 3b (webhooks) will wire WEBHOOK_* emit calls.\n * Stage 4 (customers) will wire CUSTOMER_* emit calls.\n */\nexport enum OrganizationActivityEventType {\n // Membership lifecycle\n MEMBER_INVITED = 'member.invited',\n MEMBER_JOINED = 'member.joined',\n MEMBER_ROLE_CHANGED = 'member.role_changed',\n MEMBER_DEACTIVATED = 'member.deactivated',\n MEMBER_REACTIVATED = 'member.reactivated',\n MEMBER_REMOVED = 'member.removed',\n INVITATION_REVOKED = 'invitation.revoked',\n INVITATION_EXPIRED = 'invitation.expired',\n // Resource lifecycle\n AGENT_CREATED = 'agent.created',\n PLAN_CREATED = 'plan.created',\n PLAN_PURCHASED = 'plan.purchased',\n // Customer lifecycle (Stage 4 wires the emit)\n CUSTOMER_ADDED = 'customer.added',\n CUSTOMER_BLOCKED = 'customer.blocked',\n CUSTOMER_UNBLOCKED = 'customer.unblocked',\n // Webhook delivery (Stage 3b adds emit)\n WEBHOOK_DELIVERED = 'webhook.delivered',\n WEBHOOK_FAILED = 'webhook.failed',\n}\n\n// ---------------------------------------------------------------------------\n// Webhook subscription + delivery status enums (Stage 3b)\n// ---------------------------------------------------------------------------\n\n/**\n * Status of the last delivery attempt on a webhook subscription.\n * Stored as varchar on OrganizationWebhookSubscriptionEntity.\n */\nexport enum WebhookSubscriptionLastDeliveryStatus {\n Success = 'success',\n Failed = 'failed',\n Pending = 'pending',\n}\n\n/**\n * Lifecycle status of a single webhook delivery row.\n * Stored as varchar on OrganizationWebhookDeliveryEntity.\n */\nexport enum WebhookDeliveryStatus {\n Pending = 'pending',\n InFlight = 'in_flight',\n Delivered = 'delivered',\n Failed = 'failed',\n Dead = 'dead',\n}\n"],"names":["AuthRoles","PointsRulesCategory","PointsRulesRecurrency","PointsEventStatus","NotificationType","NotificationOriginator","NotificationReadStatus","NotificationDeliveryStatus","EmailChallengeStatus","PlanTransactionType","PlanTransactionPaymentType","PlanTransactionReconciliationStatus","CheckoutSessionType","WidgetLayout","StripeEventStatus","ResultType","ApiKeyTxType","DEFAULT_PAGE","DEFAULT_OFFSET","TaskLogLevel","PaymentPlanTypes","NVM_USERID_HEADER","NVM_COST_HEADER","DEFAULT_COST_CREDITS","OrganizationType","OrganizationMemberRole","OrganizationCustomerStatus","OrganizationInvitationStatus","OrganizationTierCurrency","OrganizationTierInterval","OrganizationTierSource","OrganizationSubscriptionStatus","UserProfileType","OrganizationActivityEventType","WebhookSubscriptionLastDeliveryStatus","WebhookDeliveryStatus"],"mappings":"AAEA,OAAO,IAAA,AAAKA,mCAAAA;;WAAAA;MAEX;AA4BD,OAAO,IAAA,AAAKC,6CAAAA;;;;;;;;WAAAA;MAQX;AAED,OAAO,IAAA,AAAKC,+CAAAA;;;;;;;;;;WAAAA;MAUX;AAED,OAAO,IAAA,AAAKC,2CAAAA;;;;;;WAAAA;MAMX;AAED,OAAO,IAAA,AAAKC,0CAAAA;;;;;;WAAAA;MAMX;AAED,OAAO,IAAA,AAAKC,gDAAAA;;;WAAAA;MAGX;AAED,OAAO,IAAA,AAAKC,gDAAAA;;;;;WAAAA;MAKX;AAED,OAAO,IAAA,AAAKC,oDAAAA;;;;;;;WAAAA;MAOX;AAED,OAAO,IAAA,AAAKC,8CAAAA;;;;WAAAA;MAIX;AAED,OAAO,IAAA,AAAKC,6CAAAA;;;;;;;IAOV,mDAAmD;;;;;;WAPzCA;MAaX;AAED,OAAO,IAAA,AAAKC,oDAAAA;;;WAAAA;MAGX;AAED;;;;;;;;;;;CAWC,GACD,OAAO,IAAA,AAAKC,6DAAAA;;;;;WAAAA;MAKX;AAED,OAAO,IAAA,AAAKC,6CAAAA;;;WAAAA;MAGX;AAED,OAAO,IAAA,AAAKC,sCAAAA;;;;WAAAA;MAIX;AAED,OAAO,IAAA,AAAKC,2CAAAA;;;;;;WAAAA;MAMX;AAED,OAAO,IAAA,AAAKC,oCAAAA;;;;;WAAAA;MAKX;AAED,OAAO,IAAA,AAAKC,sCAAAA;;;;;;;;;;;;WAAAA;MAYX;AA2CD,OAAO,MAAMC,eAAe,EAAC;AAC7B,OAAO,MAAMC,iBAAiB,OAAM;AAUpC,OAAO,IAAA,AAAKC,sCAAAA;;;;;WAAAA;MAKX;AAED,OAAO,IAAA,AAAKC,0CAAAA;;;WAAAA;MAGX;AAaD,OAAO,MAAMC,oBAAoB,cAAa;AAC9C,OAAO,MAAMC,kBAAkB,qBAAoB;AACnD,OAAO,MAAMC,uBAAuB,IAAG;AAEvC,OAAO,IAAA,AAAKC,0CAAAA;;;IAGV;;;;;;;GAOC;IAED;;;;GAIC;WAhBSA;MAkBX;AAED,OAAO,IAAA,AAAKC,gDAAAA;;;WAAAA;MAGX;AAED,OAAO,IAAA,AAAKC,oDAAAA;;;WAAAA;MAGX;AAED,OAAO,IAAA,AAAKC,sDAAAA;;;;;WAAAA;MAKX;AAED,OAAO,IAAA,AAAKC,kDAAAA;;;;;WAAAA;MAKX;AAED,OAAO,IAAA,AAAKC,kDAAAA;;;;WAAAA;MAIX;AAED,OAAO,IAAA,AAAKC,gDAAAA;;;WAAAA;MAGX;AAED,OAAO,IAAA,AAAKC,wDAAAA;;;;;;WAAAA;MAMX;AAED,OAAO,IAAA,AAAKC,yCAAAA;;;;WAAAA;MAIX;AAyBD,8EAA8E;AAC9E,8CAA8C;AAC9C,8EAA8E;AAE9E;;;;;;;;CAQC,GACD,OAAO,IAAA,AAAKC,uDAAAA;IACV,uBAAuB;;;;;;;;;IASvB,qBAAqB;;;;IAIrB,8CAA8C;;;;IAI9C,wCAAwC;;;WAlB9BA;MAqBX;AAED,8EAA8E;AAC9E,0DAA0D;AAC1D,8EAA8E;AAE9E;;;CAGC,GACD,OAAO,IAAA,AAAKC,+DAAAA;;;;WAAAA;MAIX;AAED;;;CAGC,GACD,OAAO,IAAA,AAAKC,+CAAAA;;;;;;WAAAA;MAMX"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nevermined-io/commons",
3
- "version": "0.4.6",
3
+ "version": "0.5.2",
4
4
  "type": "module",
5
5
  "main": "../dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -17,5 +17,25 @@
17
17
  "import": "./dist/index.js",
18
18
  "default": "./dist/index.js"
19
19
  }
20
+ },
21
+ "nx": {
22
+ "targets": {
23
+ "build": {
24
+ "executor": "nx:run-commands",
25
+ "outputs": [
26
+ "{projectRoot}/dist"
27
+ ],
28
+ "cache": true,
29
+ "inputs": [
30
+ "production",
31
+ "^production",
32
+ "{workspaceRoot}/.swcrc.lib.json"
33
+ ],
34
+ "options": {
35
+ "cwd": "libs/commons",
36
+ "command": "pnpm exec swc src -d dist --strip-leading-paths --config-file ../../.swcrc.lib.json"
37
+ }
38
+ }
39
+ }
20
40
  }
21
41
  }
@@ -63,7 +63,7 @@ export class DDO {
63
63
  },
64
64
  }
65
65
 
66
- public registry: Registry
66
+ public registry?: Registry
67
67
 
68
68
  public constructor(ddo: Partial<DDO> = {}) {
69
69
  Object.assign(this, ddo, {
@@ -101,7 +101,7 @@ export interface CreditsConfig {
101
101
  }
102
102
 
103
103
  /// Definition of a plan
104
- export class Plan {
104
+ export interface Plan {
105
105
  // The owner of the Plan
106
106
  owner: Address
107
107
  // The price configuration of the plan
@@ -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
 
@@ -277,6 +290,32 @@ export enum OrganizationInvitationStatus {
277
290
  Expired = 'expired',
278
291
  }
279
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
+
280
319
  export enum UserProfileType {
281
320
  Merchant = 'merchant',
282
321
  Consumer = 'consumer',