@degenerate/generic 0.2.4 → 0.2.6

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/LICENSE.md ADDED
@@ -0,0 +1,63 @@
1
+ # LICENSE
2
+
3
+ ## Open-Source License: Apache License 2.0
4
+
5
+ Copyright (c) [2024], [Degenerateiinc.ca]
6
+
7
+ Licensed under the Apache License, Version 2.0 (the "License");
8
+ you may not use this file except in compliance with the License.
9
+ You may obtain a copy of the License at:
10
+
11
+ [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0)
12
+
13
+ Unless required by applicable law or agreed to in writing, software
14
+ distributed under the License is distributed on an "AS IS" BASIS,
15
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ See the License for the specific language governing permissions and
17
+ limitations under the License.
18
+
19
+ ## Additional Terms for Proprietary Extensions and Features
20
+
21
+ The SAFE Platform includes features and functionalities that may extend beyond the open-source scope of this license, including but not limited to:
22
+
23
+ 1. **Advanced Enterprise Features**:
24
+ - Modules and tools tailored for enterprise-level scalability, security, and analytics.
25
+ - Customizable AI-driven extensions designed for high-volume data processing and decision-making.
26
+ - Separate licensing agreements are required for accessing these features.
27
+
28
+ 2. **Marketplace Components**:
29
+ - Extensions, plugins, and templates available through the SAFE Marketplace may include specific licensing terms.
30
+ - Revenue-sharing agreements apply for developers contributing paid components to the Marketplace.
31
+ - Use of these components may require additional payments or subscription plans.
32
+
33
+ 3. **Partnered Integrations**:
34
+ - SAFE Platform offers pre-integrated solutions with third-party platforms such as CRM systems, payment gateways, or cloud services.
35
+ - These integrations may require accepting additional terms from the third-party providers.
36
+ - Usage is governed by both this License and the third-party terms where applicable.
37
+
38
+ 4. **Subscription-Based Analytics**:
39
+ - Advanced analytics features, including real-time data insights, AI model performance metrics, and user behavior analysis.
40
+ - These are provided through subscription services managed under proprietary agreements.
41
+ - Subscriptions may include tiered pricing based on data volume, number of users, or access levels.
42
+
43
+ 5. **Industry-Specific Solutions**:
44
+ - SAFE Platform provides pre-configured templates and rules tailored for industries such as finance, healthcare, and logistics.
45
+ - These solutions include proprietary intellectual property that is not covered by the open-source license.
46
+ - Licensing agreements specify terms for usage and redistribution of these industry-specific components.
47
+
48
+ By using the SAFE Platform, you agree to abide by these additional terms where applicable. For more details, contact [Your Organization's Contact Information].
49
+
50
+ ## Contribution and Use
51
+
52
+ 1. **Community Contributions**:
53
+ - Contributions to the SAFE Platform's open-source repository are governed by the Apache License 2.0.
54
+ - By submitting a contribution, you agree that your work will be licensed under this license.
55
+ - Contributions must adhere to the project's coding standards and submission guidelines.
56
+
57
+ 2. **Proprietary Extensions**:
58
+ - Contributions extending into proprietary areas require pre-approval by the administrators in the .
59
+ - These contributions may be subject to separate agreements defining revenue sharing, ownership rights, and maintenance responsibilities.
60
+
61
+ ## Notices
62
+
63
+ This license file is intended to reflect a hybrid open-source and proprietary model for the SAFE Platform. It provides clarity for both community contributors and commercial users. For specific questions or legal inquiries, contact [Your Organization's Contact Information].
package/README.md CHANGED
@@ -1,3 +1,20 @@
1
- # @Degenerate/generic Package
1
+ [Back to @degenerate documentation](../../README.md)
2
+ [Back to @degenerate packages documentation](../README.md)
3
+
4
+ # <p align="center" style="color:#2589BD; font-size:36px;"><b>@degenerate/generic Package</b></p>
5
+
6
+ The `@degenerate/generic` package package contains all the generic functions and models for use in the SAFE ecosystem. The package is used to provide common functionality across the different services in the SAFE environment.
7
+
8
+ ## Contents
9
+
10
+ 1. [Installation](#installation)
11
+
12
+
13
+ ## Installation
14
+
15
+ To install the `@degenerate/generic` package, use the following command:
16
+
17
+ ```bash
18
+ npm install @degenerate/generic
19
+ ```
2
20
 
3
- This package contains generic functions and models for use in the SAFE ecosystem. The package is used to provide common functionality across the different services in the SAFE environment.
@@ -1,7 +1,4 @@
1
1
  import { z } from 'zod';
2
- /**
3
- * This contains the interfaces for all event data types that can be run on the network.
4
- */
5
2
  /**
6
3
  * This is the types of events that can be run on the network.
7
4
  */
@@ -105,7 +102,7 @@ export declare const ShareDataEventSchema: z.ZodObject<{
105
102
  eventSource: z.ZodString;
106
103
  eventSourceTruthType: z.ZodEnum<["Crypto", "Oauth", "ShareBlock"]>;
107
104
  eventSourceTruthProofType: z.ZodEnum<["Hash", "Signature"]>;
108
- eventSourceTruthProof: z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodType<Buffer<ArrayBuffer>, z.ZodTypeDef, Buffer<ArrayBuffer>>]>;
105
+ EventSourceTruthProof: z.ZodString;
109
106
  triggerCondition: z.ZodFunction<z.ZodTuple<[z.ZodAny], z.ZodUnknown>, z.ZodBoolean>;
110
107
  shareDataEventInformation: z.ZodArray<z.ZodObject<{
111
108
  shareData: z.ZodArray<z.ZodObject<{
@@ -150,7 +147,7 @@ export declare const ShareDataEventSchema: z.ZodObject<{
150
147
  eventSource: string;
151
148
  eventSourceTruthType: "Crypto" | "Oauth" | "ShareBlock";
152
149
  eventSourceTruthProofType: "Hash" | "Signature";
153
- eventSourceTruthProof: string | number | Buffer<ArrayBuffer>;
150
+ EventSourceTruthProof: string;
154
151
  triggerCondition: (args_0: any, ...args: unknown[]) => boolean;
155
152
  shareDataEventInformation: {
156
153
  shareData: {
@@ -169,7 +166,7 @@ export declare const ShareDataEventSchema: z.ZodObject<{
169
166
  eventSource: string;
170
167
  eventSourceTruthType: "Crypto" | "Oauth" | "ShareBlock";
171
168
  eventSourceTruthProofType: "Hash" | "Signature";
172
- eventSourceTruthProof: string | number | Buffer<ArrayBuffer>;
169
+ EventSourceTruthProof: string;
173
170
  triggerCondition: (args_0: any, ...args: unknown[]) => boolean;
174
171
  shareDataEventInformation: {
175
172
  shareData: {
@@ -1 +1 @@
1
- {"version":3,"file":"share-event-models.d.ts","sourceRoot":"","sources":["../../../src/models/events/share-event-models.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;GAEG;AAIH;;GAEG;AACH,oBAAY,cAAc;IACtB,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ACzB,SAAS,cAAc;CAC1B;AAED,eAAO,MAAM,oBAAoB,uDAI/B,CAAC;AAEH;;GAEG;AACH,oBAAY,oBAAoB;IAC5B,MAAM,WAAW;IACjB,KAAK,UAAU;IACf,UAAU,eAAe;CAC5B;AAED,eAAO,MAAM,0BAA0B,8CAIrC,CAAC;AAEH;;GAEG;AACH,oBAAY,yBAAyB;IACjC,IAAI,SAAS;IACb,SAAS,cAAc;CAC1B;AAED,eAAO,MAAM,+BAA+B,kCAG1C,CAAC;AAEH;;GAEG;AACH,oBAAY,4BAA4B;IACpC,QAAQ,aAAa;IACrB,MAAM,WAAW;CACpB;AAED,eAAO,MAAM,kCAAkC,mCAG7C,CAAC;AAIH;;GAEG;AACH,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;EAK1C,CAAC;AAEH,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAC;AAEzF;;GAEG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGhC,CAAC;AAEH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEpE;;GAEG;AAEH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAY/B,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
@@ -5,6 +5,16 @@ const zod_1 = require("zod");
5
5
  /**
6
6
  * This contains the interfaces for all event data types that can be run on the network.
7
7
  */
8
+ //#region CustomTypes
9
+ /**
10
+ * This is the custom type for the buffer required for zod.
11
+ */
12
+ const BufferSchema = zod_1.z.custom((data) => {
13
+ return Buffer.isBuffer(data);
14
+ }, {
15
+ message: "Invalid buffer",
16
+ });
17
+ //#endregion CustomTypes
8
18
  //#region Share Event Data Enums
9
19
  /**
10
20
  * This is the types of events that can be run on the network.
@@ -85,7 +95,8 @@ exports.ShareDataEventSchema = zod_1.z.object({
85
95
  eventSource: zod_1.z.string(),
86
96
  eventSourceTruthType: exports.EventSourceTruthTypeSchema,
87
97
  eventSourceTruthProofType: exports.EventSourceTruthProofTypeSchema,
88
- eventSourceTruthProof: zod_1.z.union([zod_1.z.string(), zod_1.z.number(), zod_1.z.instanceof(Buffer)]),
98
+ EventSourceTruthProof: zod_1.z.string(),
99
+ // eventSourceTruthProof: z.union([z.string(), BufferSchema]),
89
100
  triggerCondition: zod_1.z.function().args(zod_1.z.any()).returns(zod_1.z.boolean()),
90
101
  shareDataEventInformation: zod_1.z.array(exports.IShareDataEventSchema),
91
102
  eventContext: zod_1.z.record(zod_1.z.any()),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@degenerate/generic",
3
- "version": "0.2.4",
3
+ "version": "0.2.6",
4
4
  "description": "This contains the generic information needed for the ShareData Adaptive Framework Ecosystem (SAFE) network",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -37,7 +37,7 @@
37
37
  "jsonwebtoken": "^9.0.2",
38
38
  "zod": "^3.24.1"
39
39
  },
40
- "gitHead": "b4650f64e893661657b8495a29e510fd4ca2e7df",
40
+ "gitHead": "a1ef457f3b707fb642b2e3296239c74bd75614b8",
41
41
  "devDependencies": {
42
42
  "@eslint/js": "^9.17.0",
43
43
  "@types/eslint__js": "^8.42.3",
package/LICENCE.md DELETED
@@ -1,15 +0,0 @@
1
- ISC License
2
-
3
- Copyright (c) [2024] [Degenerateiinc.ca]
4
-
5
- Permission to use, copy, modify, and/or distribute this software for any
6
- purpose with or without fee is hereby granted, provided that the above
7
- copyright notice and this permission notice appear in all copies.
8
-
9
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
10
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
11
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
12
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
13
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
14
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
15
- PERFORMANCE OF THIS SOFTWARE.